File tree 1 file changed +15
-9
lines changed
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 7
7
</ tr >
8
8
</ thead >
9
9
< tbody >
10
- <% events . each do |event | %>
11
- <% next if event [ :action ] . blank? or event [ :timestamp ] . blank ? %>
10
+ <% valid_events = events . reject { |event | event [ :action ] . blank? || event [ :timestamp ] . blank? } %>
11
+ <% if valid_events . empty ? %>
12
12
< tr >
13
- < td class ="ensure-wrapped "> <%= sanitize event [ :action ] %> </ td >
14
- <% time = Time . zone . at ( event [ :timestamp ] . to_i ) %>
15
- < td data-sort ="<%= time . getutc . iso8601 ( 5 ) %> ">
16
- < relative-time datetime ="<%= time . getutc . iso8601 %> " title ="<%= time . to_formatted_s ( :standard ) %> ">
17
- <%= time . to_formatted_s ( :long_ordinal ) %>
18
- </ relative-time >
19
- </ td >
13
+ < td colspan ="2 "> No user activity</ td >
20
14
</ tr >
15
+ <% else %>
16
+ <% valid_events . each do |event | %>
17
+ < tr >
18
+ < td class ="ensure-wrapped "> <%= sanitize event [ :action ] %> </ td >
19
+ <% time = Time . zone . at ( event [ :timestamp ] . to_i ) %>
20
+ < td data-sort ="<%= time . getutc . iso8601 ( 5 ) %> ">
21
+ < relative-time datetime ="<%= time . getutc . iso8601 %> " title ="<%= time . to_formatted_s ( :standard ) %> ">
22
+ <%= time . to_formatted_s ( :long_ordinal ) %>
23
+ </ relative-time >
24
+ </ td >
25
+ </ tr >
26
+ <% end %>
21
27
<% end %>
22
28
</ tbody >
23
29
</ table >
You can’t perform that action at this time.
0 commit comments