This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SortablePaginator | |
# provides helpful metrics for the paginator and mustache templates | |
def paginator_data | |
per_page = config["paginator"]["per_page"] rescue 5 | |
paginator_sort = config["paginator"]["sort"] rescue 'desc' | |
current_page = master.page_data['current_page'].to_i | |
post_count = all.length | |
page_count = (post_count.to_f/per_page).ceil | |
if paginator_sort == 'asc' |