From a4ffda7b3714076ffd920efeeef86dd8c0e5710c Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sat, 21 Apr 2018 12:00:22 +0000 Subject: Use button as additional option for contextmenu (#26655). Patch by Felix Gliesche. git-svn-id: http://svn.redmine.org/redmine/trunk@17298 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 4 ++++ app/helpers/issues_helper.rb | 10 ++++++---- app/views/issues/_list.html.erb | 6 ++++-- app/views/my/blocks/_timelog.html.erb | 3 +++ app/views/timelog/_list.html.erb | 1 + app/views/versions/index.html.erb | 1 + app/views/versions/show.html.erb | 1 + 7 files changed, 20 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 00992a5bb..be0813480 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1223,6 +1223,10 @@ module ApplicationHelper content_tag(:a, name, {:href => '#', :onclick => "#{function}; return false;"}.merge(html_options)) end + def link_to_context_menu + link_to l(:button_actions), '#', title: l(:button_actions), class: 'icon-only icon-actions js-contextmenu' + end + # Helper to render JSON in views def raw_json(arg) arg.to_json.to_s.gsub('/', '\/').html_safe diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 972e6b9cb..1c2fd1b5d 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -99,7 +99,8 @@ module IssuesHelper content_tag('td', link_to_issue(child, :project => (issue.project_id != child.project_id)), :class => 'subject', :style => 'width: 50%') + content_tag('td', h(child.status), :class => 'status') + content_tag('td', link_to_user(child.assigned_to), :class => 'assigned_to') + - content_tag('td', child.disabled_core_fields.include?('done_ratio') ? '' : progress_bar(child.done_ratio), :class=> 'done_ratio'), + content_tag('td', child.disabled_core_fields.include?('done_ratio') ? '' : progress_bar(child.done_ratio), :class=> 'done_ratio') + + content_tag('td', link_to_context_menu, :class => 'buttons'), :class => css) end s << '' @@ -114,14 +115,15 @@ module IssuesHelper relations.each do |relation| other_issue = relation.other_issue(issue) css = "issue hascontextmenu #{other_issue.css_classes}" - link = manage_relations ? link_to(l(:label_relation_delete), + buttons = manage_relations ? link_to(l(:label_relation_delete), relation_path(relation), :remote => true, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :title => l(:label_relation_delete), :class => 'icon-only icon-link-break' - ) : nil + ) :"".html_safe + buttons << link_to_context_menu s << content_tag('tr', content_tag('td', check_box_tag("ids[]", other_issue.id, false, :id => nil), :class => 'checkbox') + @@ -130,7 +132,7 @@ module IssuesHelper content_tag('td', other_issue.start_date, :class => 'start_date') + content_tag('td', other_issue.due_date, :class => 'due_date') + content_tag('td', other_issue.disabled_core_fields.include?('done_ratio') ? '' : progress_bar(other_issue.done_ratio), :class=> 'done_ratio') + - content_tag('td', link, :class => 'buttons'), + content_tag('td', buttons, :class => 'buttons'), :id => "relation-#{relation.id}", :class => css) end diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 8024a6948..d704a58bb 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -14,6 +14,7 @@ <% query.inline_columns.each do |column| %> <%= column_header(query, column, query_options) %> <% end %> + @@ -21,7 +22,7 @@ <% if group_name %> <% reset_cycle %> - +   <%= group_name %> <%= group_count %> <%= group_totals %> <%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", @@ -34,11 +35,12 @@ <% query.inline_columns.each do |column| %> <%= content_tag('td', column_content(column, issue), :class => column.css_classes) %> <% end %> + <%= link_to_context_menu %> <% query.block_columns.each do |column| if (text = column_content(column, issue)) && text.present? -%> - + <% if query.block_columns.count > 1 %> <%= column.caption %> <% end %> diff --git a/app/views/my/blocks/_timelog.html.erb b/app/views/my/blocks/_timelog.html.erb index f96ee6c2e..7354c757d 100644 --- a/app/views/my/blocks/_timelog.html.erb +++ b/app/views/my/blocks/_timelog.html.erb @@ -35,6 +35,7 @@ <%= l(:label_project) %> <%= l(:field_comments) %> <%= l(:field_hours) %> + <% entries_by_day.keys.sort.reverse_each do |day| %> @@ -42,6 +43,7 @@ <%= day == User.current.today ? l(:label_today).titleize : format_date(day) %> <%= html_hours(format_hours(entries_by_day[day].sum(&:hours))) %> + <% entries_by_day[day].each do |entry| -%> @@ -52,6 +54,7 @@ <%= entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %> <%= entry.comments %> <%= html_hours(format_hours(entry.hours)) %> + <%= link_to_context_menu %> <% end -%> <% end -%> diff --git a/app/views/timelog/_list.html.erb b/app/views/timelog/_list.html.erb index 6f126b0f7..019ddbb53 100644 --- a/app/views/timelog/_list.html.erb +++ b/app/views/timelog/_list.html.erb @@ -47,6 +47,7 @@ :title => l(:button_delete), :class => 'icon-only icon-del' %> <% end -%> + <%= link_to_context_menu %> <% @query.block_columns.each do |column| diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 2914a6dbc..eeb9f3f06 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -30,6 +30,7 @@ <%= check_box_tag 'ids[]', issue.id, false, :id => nil %> <%= link_to_issue(issue, :project => (@project != issue.project)) %> + <%= link_to_context_menu %> <% end -%> diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index a62b0a1d0..677cc1410 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -44,6 +44,7 @@ <%= check_box_tag 'ids[]', issue.id, false, :id => nil %> <%= link_to_issue(issue, :project => (@project != issue.project)) %> + <%= link_to_context_menu %> <% end %> -- cgit v1.2.3