Project

General

Profile

Patch #24313 » 03_use_regular_icons_in_activity_tab.patch

Marius BĂLTEANU, 2016-11-10 01:09

View differences:

app/views/activities/index.html.erb
6 6
<h3><%= format_activity_day(day) %></h3>
7 7
<dl>
8 8
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
9
  <dt class="<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
9
  <dt class="icon icon-<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
10 10
  <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
11 11
  <span class="time"><%= format_time(e.event_datetime, false) %></span>
12 12
  <%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %>
public/stylesheets/application.css
424 424

  
425 425
div#activity dl, #search-results { margin-left: 2em; }
426 426
div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
427
div#activity dt, #search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; }
427
#search-results dt { margin-bottom: 0px; padding-left: 20px; line-height: 18px; background-position: 0 50%; background-repeat: no-repeat; }
428 428
div#activity dt.me .time { border-bottom: 1px solid #999; }
429 429
div#activity dt .time { color: #777; font-size: 80%; }
430 430
div#activity dd .description, #search-results dd .description { font-style: italic; }
......
440 440
div#search-results-counts ul { margin-top: 0.5em; }
441 441
div#search-results-counts  li { list-style-type:none; float: left; margin-left: 1em; }
442 442

  
443
dt.issue { background-image: url(../images/ticket.png); }
444
dt.issue-edit { background-image: url(../images/ticket_edit.png); }
445
dt.issue-closed { background-image: url(../images/ticket_checked.png); }
446
dt.issue-note { background-image: url(../images/ticket_note.png); }
447
dt.changeset { background-image: url(../images/changeset.png); }
448
dt.news { background-image: url(../images/news.png); }
449
dt.message { background-image: url(../images/message.png); }
450
dt.reply { background-image: url(../images/comments.png); }
451
dt.wiki-page { background-image: url(../images/wiki_edit.png); }
452
dt.attachment { background-image: url(../images/attachment.png); }
453
dt.document { background-image: url(../images/document.png); }
454
dt.project { background-image: url(../images/projects.png); }
455
dt.time-entry { background-image: url(../images/time.png); }
456

  
457 443
#search-results dt.issue.closed { background-image: url(../images/ticket_checked.png); }
458 444

  
459 445
div#roadmap .related-issues { margin-bottom: 1em; }
......
1158 1144
.open .icon-folder { background-image: url(../images/folder_open.png); }
1159 1145
.icon-package { background-image: url(../images/package.png); }
1160 1146
.icon-user { background-image: url(../images/user.png); }
1161
.icon-projects { background-image: url(../images/projects.png); }
1147
.icon-project, .icon-projects { background-image: url(../images/projects.png); }
1162 1148
.icon-help { background-image: url(../images/help.png); }
1163 1149
.icon-attachment  { background-image: url(../images/attachment.png); }
1164 1150
.icon-history  { background-image: url(../images/history.png); }
1165
.icon-time  { background-image: url(../images/time.png); }
1151
.icon-time-entry, .icon-time  { background-image: url(../images/time.png); }
1166 1152
.icon-time-add  { background-image: url(../images/time_add.png); }
1167 1153
.icon-stats  { background-image: url(../images/stats.png); }
1168 1154
.icon-warning  { background-image: url(../images/warning.png); }
......
1205 1191
.icon-custom-fields { background-image: url(../images/textfield.png); }
1206 1192
.icon-plugins { background-image: url(../images/plugin.png); }
1207 1193
.icon-news { background: url(../images/news.png); }
1194
.icon-issue-closed { background-image: url(../images/ticket_checked.png); }
1195
.icon-issue-note { background-image: url(../images/ticket_note.png); }
1196
.icon-changeset { background-image: url(../images/changeset.png); }
1197
.icon-message { background-image: url(../images/message.png); }
1198
.icon-reply { background-image: url(../images/comments.png); }
1199
.icon-wiki-page { background-image: url(../images/wiki_edit.png); }
1200
.icon-document { background-image: url(../images/document.png); }
1201
.icon-project { background-image: url(../images/projects.png); }
1208 1202

  
1209 1203
.icon-file { background-image: url(../images/files/default.png); }
1210 1204
.icon-file.text-plain { background-image: url(../images/files/text.png); }
test/functional/activities_controller_test.rb
34 34
    assert_response :success
35 35

  
36 36
    assert_select 'h3', :text => /#{2.days.ago.to_date.day}/
37
    assert_select 'dl dt.issue-edit a', :text => /(#{IssueStatus.find(2).name})/
37
    assert_select 'dl dt.icon-issue-edit a', :text => /(#{IssueStatus.find(2).name})/
38 38
  end
39 39

  
40 40
  def test_project_index_with_invalid_project_id_should_respond_404
......
47 47
    assert_response :success
48 48

  
49 49
    assert_select 'h3', :text => /#{3.days.ago.to_date.day}/
50
    assert_select 'dl dt.issue a', :text => /Cannot print recipes/
50
    assert_select 'dl dt.icon-issue a', :text => /Cannot print recipes/
51 51
  end
52 52

  
53 53
  def test_global_index
......
59 59
    d5 = User.find(1).time_to_date(i5.created_on)
60 60

  
61 61
    assert_select 'h3', :text => /#{d5.day}/
62
    assert_select 'dl dt.issue a', :text => /Subproject issue/
62
    assert_select 'dl dt.icon-issue a', :text => /Subproject issue/
63 63
  end
64 64

  
65 65
  def test_user_index
......
73 73
    d1 = User.find(1).time_to_date(i1.created_on)
74 74

  
75 75
    assert_select 'h3', :text => /#{d1.day}/
76
    assert_select 'dl dt.issue a', :text => /Cannot print recipes/
76
    assert_select 'dl dt.icon-issue a', :text => /Cannot print recipes/
77 77
  end
78 78

  
79 79
  def test_user_index_with_invalid_user_id_should_respond_404
......
120 120
    with_settings :default_language => 'en' do
121 121
      get :index, :format => 'atom', :show_issues => '1'
122 122
      assert_response :success
123
  
123

  
124 124
      assert_select 'title', :text => /Issues/
125 125
    end
126 126
  end
(3-3/9)