Feature #44630 » 0001-Show-the-day-of-the-week-next-to-each-date-heading-o.patch
| app/assets/stylesheets/application.css | ||
|---|---|---|
| 1064 | 1064 |
padding: 5px; |
| 1065 | 1065 |
background-color: var(--oc-gray-1); |
| 1066 | 1066 |
} |
| 1067 |
div#activity h3 .day-of-week { font-size: 0.875rem; font-weight: normal; color: var(--color-text-muted); }
|
|
| 1067 | 1068 |
div#activity dt {
|
| 1068 | 1069 |
padding-block-start: 10px; |
| 1069 | 1070 |
border-block-start: 1px solid var(--oc-gray-2); |
| app/views/activities/_activities.html.erb | ||
|---|---|---|
| 1 | 1 |
<div id="activity"> |
| 2 | 2 |
<% events_by_day.keys.sort.reverse_each do |day| %> |
| 3 |
<h3><%= format_activity_day(day) %></h3> |
|
| 3 |
<h3> |
|
| 4 |
<%= format_activity_day(day) %> |
|
| 5 |
<% unless day == User.current.today %><span class="day-of-week">(<%= abbr_day_name(day.cwday) %>)</span><% end %> |
|
| 6 |
</h3> |
|
| 4 | 7 |
<dl> |
| 5 | 8 |
<% sort_activity_events(events_by_day[day]).each do |e, in_group| -%> |
| 6 | 9 |
<dt class="<%= e.event_type %> icon icon-<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> |
| test/functional/activities_controller_test.rb | ||
|---|---|---|
| 61 | 61 |
assert_select '#sidebar input#with_subprojects', :count => 0 |
| 62 | 62 |
end |
| 63 |
def test_index_should_show_day_of_week_except_for_today |
|
| 64 |
Journal.find(1).update_column(:created_on, Time.current) |
|
| 65 |
Journal.find(2).update_column(:created_on, 1.day.ago) |
|
| 66 |
with_locale 'en' do |
|
| 67 |
get(:index, :params => {:id => 1, :with_subprojects => 0})
|
|
| 68 |
end |
|
| 69 |
assert_response :success |
|
| 70 | ||
| 71 |
assert_select 'h3', :text => 'Today' do |
|
| 72 |
assert_select 'span.day-of-week', 0 |
|
| 73 |
end |
|
| 74 |
assert_select 'h3 span.day-of-week', :text => "(#{1.day.ago.to_date.strftime('%a')})"
|
|
| 75 |
end |
|
| 76 | ||
| 63 | 77 |
def test_project_index_with_invalid_project_id_should_respond_404 |
| 64 | 78 |
get(:index, :params => {:id => 299})
|
| 65 | 79 |
assert_response :not_found |
- « Previous
- 1
- 2
- 3
- Next »