jobs: {},
pipeline_instances: {}
}
+ @total_activity = {}
@spans = [['This week', Time.now.beginning_of_week, Time.now],
['Last week',
Time.now.beginning_of_week.advance(weeks:-1),
@user_activity[record.modified_by_user_uuid] ||= {}
@user_activity[record.modified_by_user_uuid][span + ' ' + type.to_s] ||= 0
@user_activity[record.modified_by_user_uuid][span + ' ' + type.to_s] += 1
+ @total_activity[span + ' ' + type.to_s] ||= 0
+ @total_activity[span + ' ' + type.to_s] += 1
end
end
end
@users = @users.sort_by do |a|
[-@user_activity[a.uuid].values.inject(:+), a.full_name]
end
+ # Prepend a "Total" pseudo-user to the sorted list
+ @user_activity[nil] = @total_activity
+ @users = [OpenStruct.new(uuid: nil)] + @users
end
def show_pane_list
table#users-activity-table th {
overflow-x: hidden;
}
+table#users-activity-table .cell-for-span-This-month,
+table#users-activity-table .cell-for-span-Last-month {
+ background: #eee;
+}
<% end %>
-<table class="table table-bordered table-condensed table-fixedlayout" id="users-activity-table">
+<table class="table table-condensed arv-index" id="users-activity-table">
<colgroup>
<col width="28%" />
</colgroup>
<tr>
<th rowspan="2">User</th>
<% @spans.each do |span, start_at, end_at| %>
- <th colspan="3">
+ <th colspan="3" class="cell-for-span-<%= span.gsub ' ','-' %>">
<%= span %>
<br />
<%= start_at.strftime('%b %-d') %>
</tr>
<tr>
<% @spans.each do |span, _| %>
- <th>Logins</th>
- <th>Jobs</th>
- <th>Pipelines</th>
+ <th class="cell-for-span-<%= span.gsub ' ','-' %>">Logins</th>
+ <th class="cell-for-span-<%= span.gsub ' ','-' %>">Jobs</th>
+ <th class="cell-for-span-<%= span.gsub ' ','-' %>">Pipelines</th>
<% end %>
</tr>
<tr>
<td>
<small>
+ <% if user.uuid %>
<%= link_to_if_arvados_object user, friendly_name: true %>
+ <% else %>
+ <b>Total</b>
+ <% end %>
</small>
</td>
<% @spans.each do |span, _| %>
<% ['logins', 'jobs', 'pipeline_instances'].each do |type| %>
- <td>
+ <td class="cell-for-span-<%= span.gsub ' ','-' %>">
<small>
<%= @user_activity[user.uuid][span + " " + type].to_s %>
</small>