From ac56c0c99ccd14c7229145fc22d6e9eb13ee0af0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 25 Jun 2012 17:49:35 +0000 Subject: Ability to close projects (read-only) (#3640). A new permission (Close/reopen project) is available to give non-admin users the ability to close their projects. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9883 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/admin/projects.html.erb | 6 +++--- app/views/projects/index.html.erb | 8 ++++++++ app/views/projects/show.html.erb | 13 +++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index 6525f8ea5..1d8bcc002 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -27,12 +27,12 @@ <% project_tree(@projects) do |project, level| %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> - <%= link_to_project(project, {:action => 'settings'}, :title => project.short_description) %> + <%= link_to_project(project, {:action => (project.active? ? 'settings' : 'show')}, :title => project.short_description) %> <%= checked_image project.is_public? %> <%= format_date(project.created_on) %> - <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %> - <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %> + <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') unless project.archived? %> + <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %> <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %> <%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del') %> diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 42b400ff7..3d527917a 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -25,4 +25,12 @@ <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <% end %> +<% content_for :sidebar do %> + <%= form_tag({}, :method => :get) do %> +

<%= l(:label_project_plural) %>

+ +

<%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>

+ <% end %> +<% end %> + <% html_title(l(:label_project_plural)) -%> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 4963ebbe4..7bd37fc7b 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -2,14 +2,27 @@ <% if User.current.allowed_to?(:add_subprojects, @project) %> <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %> <% end %> + <% if User.current.allowed_to?(:close_project, @project) %> + <% if @project.active? %> + <%= link_to l(:button_close), close_project_path(@project), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock' %> + <% else %> + <%= link_to l(:button_reopen), reopen_project_path(@project), :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-unlock' %> + <% end %> + <% end %>

<%=l(:label_overview)%>

+<% unless @project.active? %> +

<%= l(:text_project_closed) %>

+<% end %> +
+ <% if @project.description.present? %>
<%= textilizable @project.description %>
+ <% end %>