Revert "Making sure we only load what is nessesary (we have a lot of old tickets...). Also defaulting to not showing closed backlogs.".

This reverts commit 6acbb343d1.
pull/6827/head
Joakim Kolsjö 15 years ago
parent 6acbb343d1
commit b0cb2b01e5
  1. 7
      app/controllers/backlogs_controller.rb
  2. 4
      app/models/backlog.rb
  3. 4
      app/models/item.rb
  4. 2
      app/views/backlogs/index.html.erb

@ -8,11 +8,10 @@ class BacklogsController < ApplicationController
protect_from_forgery :only => []
def index
cookies[:hide_closed_backlogs] = "true" unless cookies[:hide_closed_backlogs]
@hide_closed_backlogs = (cookies[:hide_closed_backlogs] == "true")
@items = Item.find_by_project(@project, @hide_closed_backlogs)
@items = Item.find_by_project(@project)
@item_template = Item.new
@backlogs = Backlog.find_by_project(@project, @hide_closed_backlogs)
@backlogs = Backlog.find_by_project(@project)
@hide_closed_backlogs = cookies[:hide_closed_backlogs]=="true"
end
def show

@ -56,8 +56,8 @@ class Backlog < ActiveRecord::Base
end
def self.find_by_project(project, hide_closed_backlogs = false)
find(:all, :include => :version, :conditions => "versions.project_id=#{project.id} #{"AND is_closed = false" if hide_closed_backlogs}", :order => "versions.effective_date ASC, versions.id ASC")
def self.find_by_project(project)
find(:all, :include => :version, :conditions => "versions.project_id=#{project.id}", :order => "versions.effective_date ASC, versions.id ASC")
end
def self.update(params)

@ -91,8 +91,8 @@ class Item < ActiveRecord::Base
find_by_issue_id(issue.id).destroy
end
def self.find_by_project(project, hide_closed = false)
find(:all, :include => [ :issue, :backlog ], :conditions => "issues.project_id=#{project.id} AND items.parent_id=0 #{"AND backlogs.is_closed = false" if hide_closed}", :order => "items.position ASC")
def self.find_by_project(project)
find(:all, :include => :issue, :conditions => "issues.project_id=#{project.id} and items.parent_id=0", :order => "items.position ASC")
end
def self.remove_with_issue(issue)

@ -11,7 +11,7 @@
<option value="0">&nbsp;&nbsp;&nbsp;&nbsp;Main Backlog</option>
</select>
<div id="hide_closed_backlogs_container">
<input type="checkbox" id="hide_closed_backlogs" <%= checked="checked" if @hide_closed_backlogs %>/> Hide closed backlogs
<input type="checkbox" id="hide_closed_backlogs"/> Hide closed backlogs
</div>
</div>

Loading…
Cancel
Save