allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [03/31] git commit: [#7657] ticket:649 Display dates better
Date Mon, 22 Sep 2014 10:27:44 GMT
[#7657] ticket:649 Display dates better


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/dc8c4fd0
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/dc8c4fd0
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/dc8c4fd0

Branch: refs/heads/je/42cc_7657b
Commit: dc8c4fd0868cf6cf565b3d9b2c6692101b5cd11e
Parents: 675ece9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Sep 12 11:50:23 2014 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Mon Sep 22 11:05:36 2014 +0300

----------------------------------------------------------------------
 Allura/allura/model/auth.py                          | 7 +++++--
 Allura/allura/templates/site_admin_user_details.html | 6 +++---
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/dc8c4fd0/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 7660e05..6698c5d 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -734,8 +734,11 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
 
     def registration_date(self):
         p = plugin.AuthenticationProvider.get(request)
-        return p.user_registration_date(self)
-
+        d = p.user_registration_date(self)
+        # provider's user_registration_date returns aware datetime (in UTC)
+        # but we're using naive UTC time everywhere
+        d = datetime.utcfromtimestamp(calendar.timegm(d.utctimetuple()))
+        return d
 
 class OldProjectRole(MappedClass):
 

http://git-wip-us.apache.org/repos/asf/allura/blob/dc8c4fd0/Allura/allura/templates/site_admin_user_details.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_user_details.html b/Allura/allura/templates/site_admin_user_details.html
index 9aba434..f2cc97d 100644
--- a/Allura/allura/templates/site_admin_user_details.html
+++ b/Allura/allura/templates/site_admin_user_details.html
@@ -31,7 +31,7 @@
         <ul>
           <li>Username: {{ user.username }}</li>
           <li>Full name: {{ user.get_pref('display_name') }}</li>
-          <li>Registered: {{ user.registration_date() }}</li>
+          <li>Registered: {{ user.registration_date() }} ({{ h.ago(user.registration_date())
}})</li>
         </ul>
       </fieldset>
     </div>
@@ -43,13 +43,13 @@
         <legend>Session</legend>
         <h3>Last login</h3>
         <ul>
-          <li>Date: {{ user.last_access.login_date }}</li>
+          <li>Date: {{ user.last_access.login_date }} ({{ h.ago(user.last_access.login_date)
}})</li>
           <li>IP: {{ user.last_access.login_ip }}</li>
           <li>UA: {{ user.last_access.login_ua }}</li>
         </ul>
         <h3>Last page access</h3>
         <ul>
-          <li>Date: {{ user.last_access.session_date }}</li>
+          <li>Date: {{ user.last_access.session_date }} ({{ h.ago(user.last_access.session_date)
}})</li>
           <li>IP: {{ user.last_access.session_ip }}</li>
           <li>UA: {{ user.last_access.session_ua }}</li>
         </ul>


Mime
View raw message