From a391952f7862bee36a50d452c3f09d1a2f67aa4f Mon Sep 17 00:00:00 2001 From: Jan Schulz-Hofen Date: Fri, 19 Feb 2016 14:42:52 +0700 Subject: [PATCH] Adds Settings icon to contextual area for project views which have a tab in project settings --- app/views/boards/index.html.erb | 6 ++++++ app/views/boards/show.html.erb | 4 ++++ app/views/issues/index.html.erb | 6 +++++- app/views/projects/show.html.erb | 4 ++++ app/views/repositories/_navigation.html.erb | 4 ++++ app/views/timelog/index.html.erb | 3 +++ app/views/timelog/new.html.erb | 6 ++++++ app/views/timelog/report.html.erb | 3 +++ app/views/versions/index.html.erb | 3 +++ app/views/wiki/index.html.erb | 3 +++ app/views/wiki/show.html.erb | 3 +++ public/stylesheets/application.css | 1 + 12 files changed, 45 insertions(+), 1 deletion(-) diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb index 2907413..d88912d 100644 --- a/app/views/boards/index.html.erb +++ b/app/views/boards/index.html.erb @@ -1,3 +1,9 @@ +
+ <%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %> +
+

<%= l(:label_board_plural) %>

diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index a973431..407fa99 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -6,6 +6,10 @@ :class => 'icon icon-add', :onclick => 'showAndScrollTo("add-message", "message_subject"); return false;' if User.current.allowed_to?(:add_messages, @board.project) %> <%= watcher_link(@board, User.current) %> +<%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'boards'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_boards, @project) %> +

<%= @query.new_record? ? l(:label_issue_plural) : @query.name %>

@@ -76,7 +80,7 @@ <% end %>

<%=l(:label_overview)%>

diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb index 082f555..6e18526 100644 --- a/app/views/repositories/_navigation.html.erb +++ b/app/views/repositories/_navigation.html.erb @@ -6,6 +6,10 @@ {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param}, :class => 'icon icon-stats' if @repository.supports_all_revisions? %> +<%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'repositories'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_repository, @project) %> + <%= form_tag({:action => controller.action_name, :id => @project, :repository_id => @repository.identifier_param, diff --git a/app/views/timelog/index.html.erb b/app/views/timelog/index.html.erb index a875e53..0ef9640 100644 --- a/app/views/timelog/index.html.erb +++ b/app/views/timelog/index.html.erb @@ -2,6 +2,9 @@ <%= link_to l(:button_log_time), _new_time_entry_path(@project, @issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> +<%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %> <%= render_timelog_breadcrumb %> diff --git a/app/views/timelog/new.html.erb b/app/views/timelog/new.html.erb index 84bf7da..72ae45f 100644 --- a/app/views/timelog/new.html.erb +++ b/app/views/timelog/new.html.erb @@ -1,3 +1,9 @@ +
+ <%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %> +
+

<%= l(:label_spent_time) %>

<%= labelled_form_for @time_entry, :url => time_entries_path do |f| %> diff --git a/app/views/timelog/report.html.erb b/app/views/timelog/report.html.erb index 176f128..2d7b0f5 100644 --- a/app/views/timelog/report.html.erb +++ b/app/views/timelog/report.html.erb @@ -2,6 +2,9 @@ <%= link_to l(:button_log_time), _new_time_entry_path(@project, @issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %> +<%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %> <%= render_timelog_breadcrumb %> diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 6a3f6f9..a35f0eb 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -1,6 +1,9 @@
<%= link_to(l(:label_version_new), new_project_version_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_versions, @project) %> + <%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'versions'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_versions, @project) %>

<%=l(:label_roadmap)%>

diff --git a/app/views/wiki/index.html.erb b/app/views/wiki/index.html.erb index 333cc85..04cfff2 100644 --- a/app/views/wiki/index.html.erb +++ b/app/views/wiki/index.html.erb @@ -1,5 +1,8 @@
<%= watcher_link(@wiki, User.current) %> +<%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_wiki, @project) %>

<%= l(:label_index_by_title) %>

diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erb index a9db7a0..c837e1f 100644 --- a/app/views/wiki/show.html.erb +++ b/app/views/wiki/show.html.erb @@ -12,6 +12,9 @@ <% end %> <% end %> <%= link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') %> +<%= link_to_if_authorized l(:label_settings), + {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'wiki'}, + :class => 'icon icon-settings' if User.current.allowed_to?(:manage_wiki, @project) %> <%= wiki_page_breadcrumb(@page) %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index f7963dd..1f3be96 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1151,6 +1151,7 @@ a.close-icon:hover {background-image:url('../images/close_hl.png');} .icon-ok { background-image: url(../images/true.png); } .icon-not-ok { background-image: url(../images/false.png); } .icon-link-break { background-image: url(../images/link_break.png); } +.icon-settings { background-image: url(../images/changeset.png); } .icon-file { background-image: url(../images/files/default.png); } .icon-file.text-plain { background-image: url(../images/files/text.png); } -- 2.4.9 (Apple Git-60)