Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/3140'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Mar 17, 2021
2 parents 8e5deaf + a08fe1c commit 978ba72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
39 changes: 20 additions & 19 deletions app/views/traces/_trace.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@
<% end %>
</td>
<td>
<span class="mr-2">
<%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
</span>
<ul class="list-inline mb-0">
<li class="list-inline-item">
<%= link_to trace.name, :controller => "traces", :action => "show", :display_name => trace.user.display_name, :id => trace.id %>
</li>

<% if trace.inserted? %>
<span class="mr-2">
<%= t ".count_points", :count => trace.size %>
</span>
<% end %>
<% badge_class = case trace.visibility
when "public", "identifiable" then "success"
else "danger"
end %>
<span class="badge badge-<%= badge_class %> text-white"><%= t(".#{trace.visibility}") %></span>
<% if trace.inserted? %>
<li class="list-inline-item">
<%= t ".count_points", :count => trace.size %>
</li>
<% end %>

<br />
<span class="text-muted">
<li class="list-inline-item">
<% badge_class = case trace.visibility
when "public", "identifiable" then "success"
else "danger"
end %>
<span class="badge badge-<%= badge_class %> text-white"><%= t(".#{trace.visibility}") %></span>
</li>
</ul>
<p class="text-muted mb-0">
<span title="<%= trace.timestamp %>">
<%= time_ago_in_words(trace.timestamp, :scope => :'datetime.distance_in_words_ago') %>
</span>
Expand All @@ -35,9 +37,8 @@
<%= t ".in" %>
<%= safe_join(trace.tags.collect { |tag| link_to_tag tag.tag }, ", ") %>
<% end %>
</span>
<br />
<p class="font-italic my-1">
</p>
<p class="font-italic mb-0">
<%= trace.description %>
</p>
</td>
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/traces_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def check_trace_index(traces)
assert_select "tr", :count => traces.length do |rows|
traces.zip(rows).each do |trace, row|
assert_select row, "a", Regexp.new(Regexp.escape(trace.name))
assert_select row, "span", Regexp.new(Regexp.escape("#{trace.size} points")) if trace.inserted?
assert_select row, "li", Regexp.new(Regexp.escape("#{trace.size} points")) if trace.inserted?
assert_select row, "td", Regexp.new(Regexp.escape(trace.description))
assert_select row, "td", Regexp.new(Regexp.escape("by #{trace.user.display_name}"))
end
Expand Down

0 comments on commit 978ba72

Please sign in to comment.