From: Aleksander Ɓukasz Date: Thu, 29 Aug 2013 08:58:38 +0000 (+0200) Subject: Tweaking last post in a topic/forum column X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/6e7311400c567b9d7c1d404133b4705600f5cbe7?ds=inline;hp=a1fc069a60de613d426995fb6bbbfc563e00d951 Tweaking last post in a topic/forum column - time since instead of datetime - showing last active user --- 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