[ARVADOS] updated: 7db862a48062c6086ea8a6787149afa7d66b1919
git at public.curoverse.com
git at public.curoverse.com
Sun Mar 16 16:58:02 EDT 2014
Summary of changes:
apps/workbench/app/controllers/users_controller.rb | 6 ++++++
apps/workbench/app/views/users/activity.html.erb | 20 ++++++++++++++------
2 files changed, 20 insertions(+), 6 deletions(-)
via 7db862a48062c6086ea8a6787149afa7d66b1919 (commit)
from cf7e30873ef4b92cc8ec099b2bb344391a070e93 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 7db862a48062c6086ea8a6787149afa7d66b1919
Author: Tom Clegg <tom at curoverse.com>
Date: Sun Mar 16 16:58:06 2014 -0400
Tweak table styles and add Total row
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index b9f43ba..c87bd25 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -19,6 +19,7 @@ class UsersController < ApplicationController
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),
@@ -49,12 +50,17 @@ class UsersController < ApplicationController
@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|
[- at 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
diff --git a/apps/workbench/app/views/users/activity.html.erb b/apps/workbench/app/views/users/activity.html.erb
index 4517b7d..eaf296a 100644
--- a/apps/workbench/app/views/users/activity.html.erb
+++ b/apps/workbench/app/views/users/activity.html.erb
@@ -2,8 +2,12 @@
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>
@@ -18,7 +22,7 @@ table#users-activity-table th {
<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') %>
@@ -29,9 +33,9 @@ table#users-activity-table th {
</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>
@@ -39,13 +43,17 @@ table#users-activity-table th {
<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>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list