Basic deliverable table implemented. #1135
This commit is contained in:
@@ -3,8 +3,24 @@ class DeliverablesController < ApplicationController
|
||||
layout 'base'
|
||||
before_filter :find_project, :authorize, :get_settings
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
|
||||
def index
|
||||
@deliverables = Deliverable.find_all_by_project_id(@project.id)
|
||||
sort_init "#{Deliverable.table_name}.id", "desc"
|
||||
sort_update
|
||||
limit = per_page_option
|
||||
@deliverable_count = Deliverable.count(:conditions => { :project_id => @project.id })
|
||||
@deliverable_pages = Paginator.new self, @deliverable_count, limit, params['page']
|
||||
@deliverables = Deliverable.find(:all,
|
||||
:order => sort_clause,
|
||||
:conditions => { :project_id => @project.id },
|
||||
:limit => limit,
|
||||
:offset => @deliverable_pages.current.offset)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { render :action => 'index', :layout => !request.xhr? }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user