From 6e7311400c567b9d7c1d404133b4705600f5cbe7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 29 Aug 2013 10:58:38 +0200 Subject: [PATCH 1/1] Tweaking last post in a topic/forum column - time since instead of datetime - showing last active user --- edumed/settings.d/30-apps.py | 1 + edumed/static/css/forum.css | 4 ++-- edumed/static/css/forum.scss | 4 ++-- forum/templates/pybb/forum_last_update_info.html | 5 +++++ forum/templates/pybb/topic_last_message_info.html | 6 ++++++ 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 forum/templates/pybb/forum_last_update_info.html create mode 100644 forum/templates/pybb/topic_last_message_info.html diff --git a/edumed/settings.d/30-apps.py b/edumed/settings.d/30-apps.py index 670f532..6a8d656 100644 --- a/edumed/settings.d/30-apps.py +++ b/edumed/settings.d/30-apps.py @@ -29,4 +29,5 @@ INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.admindocs', 'django.contrib.flatpages', + 'django.contrib.humanize' ) diff --git a/edumed/static/css/forum.css b/edumed/static/css/forum.css index 194398d..2bc8c17 100644 --- a/edumed/static/css/forum.css +++ b/edumed/static/css/forum.css @@ -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: 16%; + width: 10%; 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; } diff --git a/edumed/static/css/forum.scss b/edumed/static/css/forum.scss index 7aa7b36..f937e4a 100755 --- a/edumed/static/css/forum.scss +++ b/edumed/static/css/forum.scss @@ -51,12 +51,12 @@ ul.breadcrumb { } .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 { - width: 20%; + width: 32%; 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 index 0000000..c3256a9 --- /dev/null +++ b/forum/templates/pybb/forum_last_update_info.html @@ -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 index 0000000..ff49ffa --- /dev/null +++ b/forum/templates/pybb/topic_last_message_info.html @@ -0,0 +1,6 @@ +{% load humanize %} +{% if topic.updated %} + {{ topic.last_post.user }} + {{ topic.updated|naturaltime }} + +{% endif %} \ No newline at end of file -- 2.20.1