Tweaking last post in a topic/forum column
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 29 Aug 2013 08:58:38 +0000 (10:58 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 29 Aug 2013 09:04:02 +0000 (11:04 +0200)
- time since instead of datetime
- showing last active user

edumed/settings.d/30-apps.py
edumed/static/css/forum.css
edumed/static/css/forum.scss
forum/templates/pybb/forum_last_update_info.html [new file with mode: 0644]
forum/templates/pybb/topic_last_message_info.html [new file with mode: 0644]

index 670f532..6a8d656 100644 (file)
@@ -29,4 +29,5 @@ INSTALLED_APPS = (
     'django.contrib.admin',
     'django.contrib.admindocs',
     'django.contrib.flatpages',
     'django.contrib.admin',
     'django.contrib.admindocs',
     'django.contrib.flatpages',
+    'django.contrib.humanize'
 )
 )
index 194398d..2bc8c17 100644 (file)
@@ -31,10 +31,10 @@ ul.breadcrumb {
     width: 40%;
     text-align: left; }
   .forum-body .forum-topic-count, .forum-body .forum-post-count, .forum-body .topic-post-count, .forum-body .topic-view-count {
     width: 40%;
     text-align: left; }
   .forum-body .forum-topic-count, .forum-body .forum-post-count, .forum-body .topic-post-count, .forum-body .topic-view-count {
-    width: 16%;
+    width: 10%;
     text-align: center; }
   .forum-body .forum-last-post, .forum-body .topic-last-post {
     text-align: center; }
   .forum-body .forum-last-post, .forum-body .topic-last-post {
-    width: 20%;
+    width: 32%;
     text-align: center; }
   .forum-body .first-unread-post-link, .forum-body .first-unread-post-link:hover {
     text-decoration: none; }
     text-align: center; }
   .forum-body .first-unread-post-link, .forum-body .first-unread-post-link:hover {
     text-decoration: none; }
index 7aa7b36..f937e4a 100755 (executable)
@@ -51,12 +51,12 @@ ul.breadcrumb {
     }
 
     .forum-topic-count, .forum-post-count, .topic-post-count, .topic-view-count {
     }
 
     .forum-topic-count, .forum-post-count, .topic-post-count, .topic-view-count {
-        width: 16%;
+        width: 10%;
         text-align: center;
     }
 
     .forum-last-post, .topic-last-post {
         text-align: center;
     }
 
     .forum-last-post, .topic-last-post {
-        width: 20%;
+        width: 32%;
         text-align: center;
     }
 
         text-align: center;
     }
 
diff --git a/forum/templates/pybb/forum_last_update_info.html b/forum/templates/pybb/forum_last_update_info.html
new file mode 100644 (file)
index 0000000..c3256a9
--- /dev/null
@@ -0,0 +1,5 @@
+{% load humanize %}
+{% if forum.updated %}
+    {{ forum.last_post.user }}
+    {{ forum.updated|naturaltime }}
+{% endif %}
\ No newline at end of file
diff --git a/forum/templates/pybb/topic_last_message_info.html b/forum/templates/pybb/topic_last_message_info.html
new file mode 100644 (file)
index 0000000..ff49ffa
--- /dev/null
@@ -0,0 +1,6 @@
+{% load humanize %}
+{% if topic.updated %}
+    {{ topic.last_post.user }}
+    {{ topic.updated|naturaltime }}
+    
+{% endif %}
\ No newline at end of file