From b80ceecf87e2c9663ac9a88b1e4f420683d2c929 Mon Sep 17 00:00:00 2001 From: Ibrahim Awwal Date: Thu, 30 Aug 2012 00:19:42 -0700 Subject: [PATCH] Note when posts have been updated, and put the creation date in the title text. --- lms/djangoapps/django_comment_client/utils.py | 1 + lms/static/coffee/src/discussion/content.coffee | 3 +++ lms/templates/discussion/mustache/_content.mustache | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index dc4a4e21e1..89d3cd99ba 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -222,6 +222,7 @@ def extend_content(content): 'raw_tags': ','.join(content.get('tags', [])), 'permalink': permalink(content), 'roles': roles, + 'updated': content['created_at']!=content['updated_at'], } return merge_dict(content, content_info) diff --git a/lms/static/coffee/src/discussion/content.coffee b/lms/static/coffee/src/discussion/content.coffee index 73c3688c2a..9f95c201f4 100644 --- a/lms/static/coffee/src/discussion/content.coffee +++ b/lms/static/coffee/src/discussion/content.coffee @@ -374,6 +374,9 @@ if Backbone? MathJax.Hub.Queue ["Typeset", MathJax.Hub, $contentBody.attr("id")] initTimeago: -> + @$("span.timeago").each (index, element) -> + elem = $(element) + elem.html("posted on #{$.timeago.parse(elem.html()).toLocaleString()}") @$("span.timeago").timeago() renderPartial: -> diff --git a/lms/templates/discussion/mustache/_content.mustache b/lms/templates/discussion/mustache/_content.mustache index f6b375dc88..264115919b 100644 --- a/lms/templates/discussion/mustache/_content.mustache +++ b/lms/templates/discussion/mustache/_content.mustache @@ -29,7 +29,10 @@ {{/thread}}
- sometime by + {{#content.updated}} + updated + {{/content.updated}} + {{content.created_at}} by {{#content.anonymous}} anonymous {{/content.anonymous}}