Feature #33908 » 0001-Add-bookmarked-project.patch
app/helpers/projects_helper.rb | ||
---|---|---|
73 | 73 | |
74 | 74 |
# Renders the projects index |
75 | 75 |
def render_project_hierarchy(projects) |
76 |
bookmarked_project_ids = User.current.bookmarked_project_ids |
|
76 | 77 |
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 |
s = link_to_project(project, {}, :class => "#{project.css_classes}#{User.current.member_of?(project) ? ' icon icon-user my-project' : nil}#{bookmarked_project_ids.include?(project.id) ? ' icon icon-bookmarked-project' : nil}")
|
|
78 | 79 |
if project.description.present? |
79 | 80 |
s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description') |
80 | 81 |
end |
app/helpers/projects_queries_helper.rb | ||
---|---|---|
23 | 23 |
if item.is_a?(Project) |
24 | 24 |
case column.name |
25 | 25 |
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)) |
|
27 | 29 |
when :short_description |
28 | 30 |
item.description? ? content_tag('div', textilizable(item, :short_description), :class => "wiki") : '' |
29 | 31 |
when :homepage |
app/views/projects/index.html.erb | ||
---|---|---|
21 | 21 |
<% if User.current.logged? %> |
22 | 22 |
<p style="text-align:right;"> |
23 | 23 |
<span class="icon icon-user my-project"><%= l(:label_my_projects) %></span> |
24 |
<span class="icon icon-bookmarked-project"><%= l(:label_my_bookmarks) %></span> |
|
24 | 25 |
</p> |
25 | 26 |
<% end %> |
26 | 27 |
public/stylesheets/application.css | ||
---|---|---|
694 | 694 |
#projects-index ul.projects div.description { |
695 | 695 |
padding-top: 0.5em; |
696 | 696 |
} |
697 |
#projects-index a.icon-user {padding-left:0; padding-right:20px; background-position:98% 50%;} |
|
697 |
#projects-index a.icon-user, a.icon-bookmarked-project {padding-left:0; padding-right:20px; background-position:98% 50%;} |
|
698 |
#projects-index a.icon-user.icon-bookmarked-project { |
|
699 |
background-image: url(../images/tag_blue.png), url(../images/user.png); |
|
700 |
background-position: bottom 0px right 0px, bottom 0px right 20px; |
|
701 |
padding-right: 40px; |
|
702 |
} |
|
698 | 703 | |
699 | 704 |
#notified-projects>ul, #tracker_project_ids>ul, #custom_field_project_ids>ul {max-height:250px; overflow-y:auto;} |
700 | 705 | |
... | ... | |
1561 | 1566 |
.icon-collapsed { background-image: url(../images/arrow_right.png); } |
1562 | 1567 |
.icon-bookmark { background-image: url(../images/tag_blue_delete.png); } |
1563 | 1568 |
.icon-bookmark-off { background-image: url(../images/tag_blue_add.png); } |
1569 |
.icon-bookmarked-project { background-image: url(../images/tag_blue.png); } |
|
1564 | 1570 |
.icon-sorted-asc { background-image: url(../images/arrow_down.png); } |
1565 | 1571 |
.icon-sorted-desc { background-image: url(../images/arrow_up.png); } |
1566 | 1572 |
.icon-toggle-plus { background-image: url(../images/bullet_toggle_plus.png) } |