fix #1234 by checking on :review source view

This commit is contained in:
Reinier Balt 2012-01-23 12:27:49 +01:00
parent b7ee2f79f5
commit 8b13ee88ab
2 changed files with 4 additions and 3 deletions

View file

@ -34,6 +34,7 @@ class ProjectsController < ApplicationController
end
def review
@source_view = params['_source_view'] || 'review'
@page_title = t('projects.list_reviews')
@projects = current_user.projects.all
@contexts = current_user.contexts.all
@ -107,7 +108,7 @@ class ProjectsController < ApplicationController
respond_to do |format|
format.html
format.m &render_project_mobile
format.xml {
format.xml {
render :xml => @project.to_xml(:except => :user_id) { |xml|
xml.not_done { @not_done.each { |child| child.to_xml(:builder => xml, :skip_instruct => true) } }
xml.deferred { @deferred.each { |child| child.to_xml(:builder => xml, :skip_instruct => true) } }

View file

@ -1,6 +1,6 @@
<% if @saved -%>
TracksPages.page_notify('notice', '<%=t('projects.project_saved_status')%>', 5);
<% if source_view_is :project_list -%>
<% if source_view_is_one_of(:project_list, :review) -%>
update_project_list_page();
<% else # assume source_view :project
-%>
@ -79,7 +79,7 @@ function remove_and_re_add_project() {
# render it into the function.
-%>
function html_for_project_listing() {
return "<%= source_view_is(:project_list) ? escape_javascript(render(:partial => 'project_listing', :object => @project )) : "" %>";
return "<%= source_view_is_one_of(:project_list, :review) ? escape_javascript(render(:partial => 'project_listing', :object => @project, :locals=>{:suppress_drag_handle => source_view_is(:review)} )) : "" %>";
}
function html_for_sidebar() {