Merge pull request #1857 from C-Otto/tracks-1852

Show meaningful numbers in badge for completed projects and recurring actions
This commit is contained in:
Matt Rogers 2015-08-07 21:01:32 -04:00
commit bca2440ca0
2 changed files with 13 additions and 5 deletions

View file

@ -79,16 +79,19 @@ class ProjectsController < ApplicationController
@source_view = params['_source_view'] || 'project_list'
@page_title = t('projects.list_completed_projects')
items_per_page = 20
page = params[:page] || 1
projects_per_page = 20
@projects = current_user.projects.completed.paginate :page => page, :per_page => projects_per_page
@projects = current_user.projects.completed.paginate :page => page, :per_page => items_per_page
@count = @projects.count
@total = current_user.projects.completed.count
@no_projects = @projects.empty?
@range_low = (page.to_i-1) * projects_per_page + 1
@range_low = (page.to_i-1) * items_per_page + 1
@range_high = @range_low + @projects.size - 1
@range_low = 0 if @total == 0
@range_high = @total if @range_high > @total
init_not_done_counts(['project'])
end