From 0a5c96472a0f95fde290fda9b38de5947a34df32 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 20 Sep 2020 03:08:08 +0000 Subject: [PATCH] Show an icon for a bookmarked project in the projects list (#33908). Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@20051 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/projects_helper.rb | 6 +++++- app/helpers/projects_queries_helper.rb | 4 +++- app/views/projects/index.html.erb | 1 + public/images/tag_blue.png | Bin 0 -> 586 bytes public/stylesheets/application.css | 9 ++++++++- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 public/images/tag_blue.png diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 785f84291..73f9aa678 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -73,8 +73,12 @@ module ProjectsHelper # Renders the projects index def render_project_hierarchy(projects) + bookmarked_project_ids = User.current.bookmarked_project_ids render_project_nested_lists(projects) do |project| - s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'icon icon-user my-project' : nil}") + classes = project.css_classes.split + classes += %w(icon icon-user my-project) if User.current.member_of?(project) + classes += %w(icon icon-bookmarked-project) if bookmarked_project_ids.include?(project.id) + s = link_to_project(project, {}, :class => classes.uniq.join(' ')) if project.description.present? s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description') end diff --git a/app/helpers/projects_queries_helper.rb b/app/helpers/projects_queries_helper.rb index 24daa016c..07aed0929 100644 --- a/app/helpers/projects_queries_helper.rb +++ b/app/helpers/projects_queries_helper.rb @@ -23,7 +23,9 @@ module ProjectsQueriesHelper if item.is_a?(Project) case column.name when :name - link_to_project(item) + (content_tag('span', '', :class => 'icon icon-user my-project', :title => l(:label_my_projects)) if User.current.member_of?(item)) + link_to_project(item) + + (tag.span(class: 'icon icon-user my-project', title: l(:label_my_projects)) if User.current.member_of?(item)) + + (tag.span(class: 'icon icon-bookmarked-project', title: l(:label_my_bookmarks)) if User.current.bookmarked_project_ids.include?(item.id)) when :short_description item.description? ? content_tag('div', textilizable(item, :short_description), :class => "wiki") : '' when :homepage diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index 051bc0561..adf6b868f 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -21,6 +21,7 @@ <% if User.current.logged? %>

<%= l(:label_my_projects) %> +<%= l(:label_my_bookmarks) %>

<% end %> diff --git a/public/images/tag_blue.png b/public/images/tag_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..9757fc6ed6597438eb8e5a70a1ab2402cdebd5d1 GIT binary patch literal 586 zcmV-Q0=4~#P)6YY{78#rvt}vj%qrc zN=UU@y$E6COaj9&r1NAlaUpajQlL~SorN%pOwHs*2laYgHBA$?ZOd~4Rw@5yFm2?1ZIg`0V-$-;GT1Fi5dB7wUSNi^%`^Ge62m>OBeX610Nsukl}DhDG-mxT?nhyYH!4he7Ri8 zrq0Ti&UXUvqX&F@JcJAe14@BNBqAY_QZAPjF(Y3r7P9H_kB#@LgFAf>xz>Qp&n=|a z>ro1XLZK^nmO`PRh#C2OK0ktd7l6-A;O5?fz1gNnCX)yR0ul, #tracker_project_ids>ul, #custom_field_project_ids>ul {max-height:250px; overflow-y:auto;} @@ -1566,6 +1572,7 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container { .icon-collapsed { background-image: url(../images/arrow_right.png); } .icon-bookmark { background-image: url(../images/tag_blue_delete.png); } .icon-bookmark-off { background-image: url(../images/tag_blue_add.png); } +.icon-bookmarked-project { background-image: url(../images/tag_blue.png); } .icon-sorted-asc { background-image: url(../images/arrow_down.png); } .icon-sorted-desc { background-image: url(../images/arrow_up.png); } .icon-toggle-plus { background-image: url(../images/bullet_toggle_plus.png) } -- 2.39.5