summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-09-20 03:08:08 +0000
committerGo MAEDA <maeda@farend.jp>2020-09-20 03:08:08 +0000
commit0a5c96472a0f95fde290fda9b38de5947a34df32 (patch)
tree2f66fbf8ca3c98e075100939f7d59c7597dda074 /app
parent681dc5cdf594d1f9d73d0fc16a3cf51dc861fc31 (diff)
downloadredmine-0a5c96472a0f95fde290fda9b38de5947a34df32.tar.gz
redmine-0a5c96472a0f95fde290fda9b38de5947a34df32.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/helpers/projects_helper.rb6
-rw-r--r--app/helpers/projects_queries_helper.rb4
-rw-r--r--app/views/projects/index.html.erb1
3 files changed, 9 insertions, 2 deletions
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? %>
<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 %>