Skip to content

Commit 0a5c964

Browse files
committed
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
1 parent 681dc5c commit 0a5c964

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

app/helpers/projects_helper.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,12 @@ def render_project_action_links
7373

7474
# Renders the projects index
7575
def render_project_hierarchy(projects)
76+
bookmarked_project_ids = User.current.bookmarked_project_ids
7677
render_project_nested_lists(projects) do |project|
77-
s = link_to_project(project, {}, :class => "#{project.css_classes} #{User.current.member_of?(project) ? 'icon icon-user my-project' : nil}")
78+
classes = project.css_classes.split
79+
classes += %w(icon icon-user my-project) if User.current.member_of?(project)
80+
classes += %w(icon icon-bookmarked-project) if bookmarked_project_ids.include?(project.id)
81+
s = link_to_project(project, {}, :class => classes.uniq.join(' '))
7882
if project.description.present?
7983
s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description')
8084
end

app/helpers/projects_queries_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def column_value(column, item, value)
2323
if item.is_a?(Project)
2424
case column.name
2525
when :name
26-
link_to_project(item) + (content_tag('span', '', :class => 'icon icon-user my-project', :title => l(:label_my_projects)) if User.current.member_of?(item))
26+
link_to_project(item) +
27+
(tag.span(class: 'icon icon-user my-project', title: l(:label_my_projects)) if User.current.member_of?(item)) +
28+
(tag.span(class: 'icon icon-bookmarked-project', title: l(:label_my_bookmarks)) if User.current.bookmarked_project_ids.include?(item.id))
2729
when :short_description
2830
item.description? ? content_tag('div', textilizable(item, :short_description), :class => "wiki") : ''
2931
when :homepage

app/views/projects/index.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<% if User.current.logged? %>
2222
<p style="text-align:right;">
2323
<span class="icon icon-user my-project"><%= l(:label_my_projects) %></span>
24+
<span class="icon icon-bookmarked-project"><%= l(:label_my_bookmarks) %></span>
2425
</p>
2526
<% end %>
2627

public/images/tag_blue.png

586 Bytes
Loading

public/stylesheets/application.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,13 @@ ul.projects div.description li {list-style-type:initial;}
695695
#projects-index ul.projects div.description {
696696
padding-top: 0.5em;
697697
}
698-
#projects-index a.icon-user {padding-left:0; padding-right:20px; background-position:98% 50%;}
698+
#projects-index a.icon-user, a.icon-bookmarked-project {padding-left:0; padding-right:20px; background-position:98% 50%;}
699+
#projects-index a.icon-user.icon-bookmarked-project {
700+
background-image: url(../images/tag_blue.png), url(../images/user.png);
701+
background-position: bottom 0px right 0px, bottom 0px right 20px;
702+
padding-right: 40px;
703+
padding-top: 4px;
704+
}
699705

700706
#notified-projects>ul, #tracker_project_ids>ul, #custom_field_project_ids>ul {max-height:250px; overflow-y:auto;}
701707

@@ -1566,6 +1572,7 @@ td.gantt_selected_column .gantt_hdr,.gantt_selected_column_container {
15661572
.icon-collapsed { background-image: url(../images/arrow_right.png); }
15671573
.icon-bookmark { background-image: url(../images/tag_blue_delete.png); }
15681574
.icon-bookmark-off { background-image: url(../images/tag_blue_add.png); }
1575+
.icon-bookmarked-project { background-image: url(../images/tag_blue.png); }
15691576
.icon-sorted-asc { background-image: url(../images/arrow_down.png); }
15701577
.icon-sorted-desc { background-image: url(../images/arrow_up.png); }
15711578
.icon-toggle-plus { background-image: url(../images/bullet_toggle_plus.png) }

0 commit comments

Comments
 (0)