]> source.dussan.org Git - redmine.git/commitdiff
Show an icon for a bookmarked project in the projects list (#33908).
authorGo MAEDA <maeda@farend.jp>
Sun, 20 Sep 2020 03:08:08 +0000 (03:08 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 20 Sep 2020 03:08:08 +0000 (03:08 +0000)
Patch by Mizuki ISHIKAWA.

git-svn-id: http://svn.redmine.org/redmine/trunk@20051 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/projects_helper.rb
app/helpers/projects_queries_helper.rb
app/views/projects/index.html.erb
public/images/tag_blue.png [new file with mode: 0644]
public/stylesheets/application.css

index 785f8429171355d50a4759454d955e30e41e9401..73f9aa67823f0dcd3c4688c3082d79689eee1d05 100644 (file)
@@ -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
index 24daa016c40c514fe0235e6cea451b6618c0c5cc..07aed0929a1119ef8ec22d4b348faa2e13f285c0 100644 (file)
@@ -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
index 051bc05615829bbacc9009f5c4c5fe8f654c9d81..adf6b868f01eae161f70784c3f191ed5f9b26cfc 100644 (file)
@@ -21,6 +21,7 @@
 <% if User.current.logged? %>
 <p style="text-align:right;">
 <span class="icon icon-user my-project"><%= l(:label_my_projects) %></span>
+<span class="icon icon-bookmarked-project"><%= l(:label_my_bookmarks) %></span>
 </p>
 <% end %>
 
diff --git a/public/images/tag_blue.png b/public/images/tag_blue.png
new file mode 100644 (file)
index 0000000..9757fc6
Binary files /dev/null and b/public/images/tag_blue.png differ
index a320300393e1fe10aefcb3399cc8d39345aae7dc..78857fcc3f9e721c276cf91051ecaa0cbc2cb1cd 100644 (file)
@@ -695,7 +695,13 @@ ul.projects div.description li {list-style-type:initial;}
 #projects-index ul.projects div.description {
   padding-top: 0.5em;
 }
-#projects-index a.icon-user {padding-left:0; padding-right:20px; background-position:98% 50%;}
+#projects-index a.icon-user, a.icon-bookmarked-project {padding-left:0; padding-right:20px; background-position:98% 50%;}
+#projects-index a.icon-user.icon-bookmarked-project {
+  background-image: url(../images/tag_blue.png), url(../images/user.png);
+  background-position: bottom 0px right 0px, bottom 0px right 20px;
+  padding-right: 40px;
+  padding-top: 4px;
+}
 
 #notified-projects>ul, #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) }