Revision 769:9af86029dc90 vendor/plugins
| vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb | ||
|---|---|---|
| 35 | 35 |
sort_init 'name' |
| 36 | 36 |
sort_update %w(name lft created_on updated_on) |
| 37 | 37 |
@limit = per_page_option |
| 38 |
@project_count = Project.visible_roots.count |
|
| 38 |
@project_count = Project.visible_roots.find(@projects).count
|
|
| 39 | 39 |
@project_pages = ActionController::Pagination::Paginator.new self, @project_count, @limit, params['page'] |
| 40 |
@offset ||= @project_pages.current.offset
|
|
| 40 |
@offset ||= @project_pages.current.offset |
|
| 41 | 41 |
end |
| 42 | 42 |
|
| 43 | 43 |
|
| ... | ... | |
| 47 | 47 |
@project = Project.new |
| 48 | 48 |
filter_projects |
| 49 | 49 |
|
| 50 |
debugger |
|
| 51 |
|
|
| 50 | 52 |
respond_to do |format| |
| 51 | 53 |
format.html {
|
| 52 | 54 |
paginate_projects |
| 53 |
@projects = Project.visible_roots.find(@filtered_projects, :offset => @offset, :limit => @limit, :order => sort_clause)
|
|
| 55 |
@projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause) |
|
| 54 | 56 |
|
| 55 | 57 |
if User.current.logged? |
| 56 | 58 |
# seems sort_by gives us case-sensitive ordering, which we don't want |
| ... | ... | |
| 63 | 65 |
format.api {
|
| 64 | 66 |
@offset, @limit = api_offset_and_limit |
| 65 | 67 |
@project_count = Project.visible.count |
| 66 |
@projects = Project.visible.find(@filtered_projects, :offset => @offset, :limit => @limit, :order => 'lft')
|
|
| 68 |
@projects = Project.visible.find(@projects, :offset => @offset, :limit => @limit, :order => 'lft') |
|
| 67 | 69 |
} |
| 68 | 70 |
format.atom {
|
| 69 | 71 |
projects = Project.visible.find(:all, :order => 'created_on DESC', :limit => Setting.feeds_limit.to_i) |
| ... | ... | |
| 72 | 74 |
format.js {
|
| 73 | 75 |
render :update do |page| |
| 74 | 76 |
paginate_projects |
| 75 |
@projects = Project.visible_roots.find(@filtered_projects, :offset => @offset, :limit => @limit, :order => sort_clause)
|
|
| 77 |
@projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause) |
|
| 76 | 78 |
page.replace_html 'projects', :partial => 'filtered_projects' |
| 77 | 79 |
end |
| 78 | 80 |
} |
| ... | ... | |
| 102 | 104 |
|
| 103 | 105 |
# intersection of both prject groups |
| 104 | 106 |
@projects = @projects && @tagged_projects_ids unless @tag_list.empty? |
| 105 |
|
|
| 106 |
debugger |
|
| 107 |
@filtered_projects = @projects |
|
| 108 | 107 |
end |
| 109 | 108 |
end |
| 110 | 109 |
end |
Also available in: Unified diff