Added pagination to task archiv.

This commit is contained in:
Benjamin Meichsner 2009-03-23 11:23:41 +01:00
parent f018db5b15
commit 759217763e
3 changed files with 4 additions and 2 deletions

View file

@ -103,7 +103,7 @@ class TasksController < ApplicationController
# Shows all tasks, which are already done
def archive
@tasks = Task.done
@tasks = Task.done.paginate :page => params[:page], :per_page => 30
end
# shows workgroup (normal group) to edit weekly_tasks_template

View file

@ -21,7 +21,7 @@ class Task < ActiveRecord::Base
belongs_to :workgroup
named_scope :non_group, :conditions => { :workgroup_id => nil, :done => false }
named_scope :done, :conditions => {:done => true}, :order => "due_date ASC"
named_scope :done, :conditions => {:done => true}, :order => "due_date DESC"
named_scope :upcoming, lambda { |*args| {:conditions => ["done = 0 AND due_date = ?", (args.first || 7.days.from_now)]} }
# form will send user in string. responsibilities will added later

View file

@ -1,6 +1,8 @@
- title "Aufgabenarchiv"
= render :partial => "nav"
= will_paginate @orders
%br/
%table{:style => "width: 76%"}
%tr
%th Fälligkeitsdatum