From 168445f7c87a43026a5d06c3a7f672d50ef00240 Mon Sep 17 00:00:00 2001 From: jsa Date: Wed, 15 Jan 2014 00:24:55 -0500 Subject: [PATCH] i18n: extract strings from underscore templates JIRA: FOR-400 --- .../views/discussion_thread_list_view.coffee | 10 +- .../discussion/_underscore_templates.html | 139 ++++++++++++------ 2 files changed, 106 insertions(+), 43 deletions(-) diff --git a/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee b/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee index f5b4e0c2c1..2dd18717d5 100644 --- a/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee +++ b/common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee @@ -174,6 +174,14 @@ if Backbone? content.addClass("resolved") if thread.get('read') content.addClass("read") + if thread.get('unread_comments_count') > 0 + content.find('.comments-count').addClass("unread").attr( + "data-tooltip", + interpolate( + ngettext('%(unread_count)s new comment', '%(unread_count)s new comments', {'unread_count': thread.get('unread_comments_count')}), + [thread.get('unread_comments_count')] + ) + ) @highlight(content) @@ -473,4 +481,4 @@ if Backbone? error: () => $('input.email-setting').attr('checked','checked') - + diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index 24bb016acf..6d4b0c3b02 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -1,4 +1,5 @@ <%! from django.utils.translation import ugettext as _ %> +<%! from django.template.defaultfilters import escapejs %> <%! from django_comment_client.permissions import has_permission %> @@ -105,7 +112,7 @@
+ data-placeholder="${_('Add a comment...') | h}">
${_("Submit")}
@@ -117,11 +124,13 @@ @@ -150,12 +159,26 @@ @@ -163,62 +186,94 @@