From e6761e30e514206ef2fb56faa6ce335e3d241b51 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 13 Sep 2014 10:53:13 +0000 Subject: [PATCH] Moves project sidebar content to a partial (#17380). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Patch by Jérôme BATAILLE. git-svn-id: http://svn.redmine.org/redmine/trunk@13393 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/projects/_sidebar.html.erb | 12 ++++++++++++ app/views/projects/show.html.erb | 12 +----------- 2 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 app/views/projects/_sidebar.html.erb diff --git a/app/views/projects/_sidebar.html.erb b/app/views/projects/_sidebar.html.erb new file mode 100644 index 000000000..0f5c24186 --- /dev/null +++ b/app/views/projects/_sidebar.html.erb @@ -0,0 +1,12 @@ +<% if @total_hours.present? %> +

<%= l(:label_spent_time) %>

+

<%= l_hours(@total_hours) %>

+

+ <% if User.current.allowed_to?(:log_time, @project) %> + <%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> | + <% end %> + <%= link_to(l(:label_details), project_time_entries_path(@project)) %> | + <%= link_to(l(:label_report), report_project_time_entries_path(@project)) %> +

+<% end %> +<%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 8452a02d2..716df016f 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -77,17 +77,7 @@ <% content_for :sidebar do %> - <% if @total_hours.present? %> -

<%= l(:label_spent_time) %>

-

<%= l_hours(@total_hours) %>

-

- <% if User.current.allowed_to?(:log_time, @project) %> - <%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> | - <% end %> - <%= link_to(l(:label_details), project_time_entries_path(@project)) %> | - <%= link_to(l(:label_report), report_project_time_entries_path(@project)) %>

- <% end %> - <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %> + <%= render :partial => 'projects/sidebar' %> <% end %> <% content_for :header_tags do %> -- 2.39.5