first steps towards review view

This commit is contained in:
sfischme 2011-09-16 15:07:58 -04:00
parent 01bcc7a48c
commit 5f0bcebca9
5 changed files with 17 additions and 2 deletions

View file

@ -33,6 +33,10 @@ class ProjectsController < ApplicationController
end end
end end
def review
puts "MUAUAUAUAUAUAUAUA"
end
def done def done
@source_view = params['_source_view'] || 'project_list' @source_view = params['_source_view'] || 'project_list'
@page_title = t('projects.list_completed_projects') @page_title = t('projects.list_completed_projects')

View file

@ -69,7 +69,7 @@ module ProjectsHelper
def needsreview_class(item) def needsreview_class(item)
### FIXME: need to check to do this with active projects only ### FIXME: need to check to do this with active projects only
if item.last_reviewed < current_user.time - (prefs.review_period).days if item.needs_review?(current_user)
return "needsreview" return "needsreview"
else else
return "needsnoreview" return "needsnoreview"

View file

@ -107,6 +107,11 @@ class Project < ActiveRecord::Base
end end
end end
def needs_review?(current_user)
return (last_reviewed < current_user.time ) # - current_user.prefs.review_period.days)
end
def name=(value) def name=(value)
self[:name] = value.gsub(/\s{2,}/, " ").strip self[:name] = value.gsub(/\s{2,}/, " ").strip
end end

View file

@ -18,6 +18,6 @@
</div> </div>
<div id="list-<%= state %>-projects" class="project-list"> <div id="list-<%= state %>-projects" class="project-list">
<%= render :partial => 'project_listing', :collection => project_state_group %> <%= render :partial => 'projects/project_listing', :collection => project_state_group %>
</div> </div>
</div> </div>

View file

@ -17,6 +17,11 @@ ActionController::Routing::Routes.draw do |map|
projects.resources :todos, :name_prefix => "project_" projects.resources :todos, :name_prefix => "project_"
end end
map.with_options :controller => :projects do |projects|
# projects.home '', :action => "index"
projects.review 'review', :action => :review
end
map.resources :notes map.resources :notes
map.resources :todos, map.resources :todos,
@ -24,6 +29,7 @@ ActionController::Routing::Routes.draw do |map|
:collection => {:check_deferred => :post, :filter_to_context => :post, :filter_to_project => :post, :done => :get, :all_done => :get :collection => {:check_deferred => :post, :filter_to_context => :post, :filter_to_project => :post, :done => :get, :all_done => :get
} }
map.with_options :controller => :todos do |todos| map.with_options :controller => :todos do |todos|
todos.home '', :action => "index" todos.home '', :action => "index"
todos.tickler 'tickler.:format', :action => "list_deferred" todos.tickler 'tickler.:format', :action => "list_deferred"