[ARVADOS] updated: 4127b85f2c1af611bb70d5ab469adac126d0a7a4
git at public.curoverse.com
git at public.curoverse.com
Mon Mar 10 11:39:32 EDT 2014
Summary of changes:
apps/workbench/app/controllers/users_controller.rb | 13 ++++++-------
apps/workbench/app/views/users/activity.html.erb | 8 +++++++-
2 files changed, 13 insertions(+), 8 deletions(-)
via 4127b85f2c1af611bb70d5ab469adac126d0a7a4 (commit)
from 2d9d106c40b83e9a72d431bdb198ed5b8b13550a (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 4127b85f2c1af611bb70d5ab469adac126d0a7a4
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Mar 10 11:14:49 2014 -0400
Fix up start/end dates and display them in a more friendly way.
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 927637f..6168cd5 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -19,14 +19,13 @@ class UsersController < ApplicationController
pipeline_instances: {}
}
@spans = [['This week', Time.now.beginning_of_week, Time.now],
- ['Last week', 1.week.ago.beginning_of_week, nil],
+ ['Last week',
+ Time.now.beginning_of_week.advance(weeks:-1),
+ Time.now.beginning_of_week],
['This month', Time.now.beginning_of_month, Time.now],
- ['Last month', 1.month.ago.beginning_of_month, nil]].
- collect do |span|
- span[2] ||= span[1].advance(months: 1) if span[0].match /month/
- span[2] ||= span[1].advance(weeks: 1) if span[0].match /week/
- span
- end
+ ['Last month',
+ 1.month.ago.beginning_of_month,
+ Time.now.beginning_of_month]]
@spans.each do |span, threshold_start, threshold_end|
@activity[:logins][span] = Log.
filter([[:event_type, '=', 'login'],
diff --git a/apps/workbench/app/views/users/activity.html.erb b/apps/workbench/app/views/users/activity.html.erb
index 619081f..4517b7d 100644
--- a/apps/workbench/app/views/users/activity.html.erb
+++ b/apps/workbench/app/views/users/activity.html.erb
@@ -18,7 +18,13 @@ table#users-activity-table th {
<tr>
<th rowspan="2">User</th>
<% @spans.each do |span, start_at, end_at| %>
- <th colspan="3" title="<%= start_at.to_s.sub(/ .*/, '') %> to <%= (end_at-1.second).to_s.sub(/ .*/, '') %>"><%= span %></th>
+ <th colspan="3">
+ <%= span %>
+ <br />
+ <%= start_at.strftime('%b %-d') %>
+ -
+ <%= (end_at-1.second).strftime('%b %-d') %>
+ </th>
<% end %>
</tr>
<tr>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list