0001-Add-bookmarked-project.patch

Mizuki ISHIKAWA, 2020-09-14 04:04

Download (5.47 KB)

View differences:

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
      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(' '))
78 82
      if project.description.present?
79 83
        s << content_tag('div', textilizable(project.short_description, :project => project), :class => 'wiki description')
80 84
      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
695 695
#projects-index ul.projects div.description {
696 696
  padding-top: 0.5em;
697 697
}
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
}
699 705

  
700 706
#notified-projects>ul, #tracker_project_ids>ul, #custom_field_project_ids>ul {max-height:250px; overflow-y:auto;}
701 707

  
......
1566 1572
.icon-collapsed { background-image: url(../images/arrow_right.png); }
1567 1573
.icon-bookmark { background-image: url(../images/tag_blue_delete.png); }
1568 1574
.icon-bookmark-off { background-image: url(../images/tag_blue_add.png); }
1575
.icon-bookmarked-project { background-image: url(../images/tag_blue.png); }
1569 1576
.icon-sorted-asc { background-image: url(../images/arrow_down.png); }
1570 1577
.icon-sorted-desc { background-image: url(../images/arrow_up.png); }
1571 1578
.icon-toggle-plus { background-image: url(../images/bullet_toggle_plus.png) }
1572
-