diff --git a/common/static/common/js/spec_helpers/discussion_spec_helper.js b/common/static/common/js/spec_helpers/discussion_spec_helper.js
index 76dd71f915..77a7b8b4d7 100644
--- a/common/static/common/js/spec_helpers/discussion_spec_helper.js
+++ b/common/static/common/js/spec_helpers/discussion_spec_helper.js
@@ -89,8 +89,36 @@
};
DiscussionSpecHelper.setUnderscoreFixtures = function() {
- var templateFixtures = readFixtures('common/templates/discussion/templates.underscore');
- appendSetFixtures(templateFixtures);
+ var templateFixture, templateName, templateNames, templateNamesNoTrailingTemplate, i, j, len;
+ templateNames = [
+ 'thread', 'thread-show', 'thread-edit', 'thread-response', 'thread-response-show',
+ 'thread-response-edit', 'response-comment-show', 'response-comment-edit', 'thread-list-item',
+ 'search-alert', 'new-post', 'thread-type', 'new-post-menu-entry', 'new-post-alert',
+ 'new-post-menu-category', 'topic', 'post-user-display', 'inline-discussion', 'pagination',
+ 'profile-thread', 'customwmd-prompt', 'nav-loading', 'new-post-visibility'
+ ];
+ templateNamesNoTrailingTemplate = [
+ 'forum-action-endorse', 'forum-action-answer', 'forum-action-follow', 'forum-action-vote',
+ 'forum-action-report', 'forum-action-pin', 'forum-action-close', 'forum-action-edit',
+ 'forum-action-delete', 'forum-actions', 'alert-popup', 'nav-load-more-link'
+ ];
+ for (i = 0, len = templateNames.length; i < len; i++) {
+ templateName = templateNames[i];
+ templateFixture = readFixtures('common/templates/discussion/' + templateName + '.underscore');
+ appendSetFixtures($('
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/common/static/common/templates/discussion/thread-edit.underscore b/common/static/common/templates/discussion/thread-edit.underscore
new file mode 100644
index 0000000000..95a825dded
--- /dev/null
+++ b/common/static/common/templates/discussion/thread-edit.underscore
@@ -0,0 +1,19 @@
+
<%- gettext('Edit your post below.') %>
++ <%= created_at %> + <% if (obj.endorsement && obj.endorsed) { %> + - + <% + var fmt = null; + if (thread.get("thread_type") == "question") { + if (endorsement.username) { + // Translators: time_ago is a placeholder for a fuzzy, relative timestamp + // like "4 hours ago" or "about a month ago" + fmt = gettext("marked as answer %(time_ago)s by %(user)s"); + } else { + // Translators: time_ago is a placeholder for a fuzzy, relative timestamp + // like "4 hours ago" or "about a month ago" + fmt = gettext("marked as answer %(time_ago)s"); + } + } else { + if (endorsement.username) { + // Translators: time_ago is a placeholder for a fuzzy, relative timestamp + // like "4 hours ago" or "about a month ago" + fmt = gettext("endorsed %(time_ago)s by %(user)s"); + } else { + // Translators: time_ago is a placeholder for a fuzzy, relative timestamp + // like "4 hours ago" or "about a month ago" + fmt = gettext("endorsed %(time_ago)s"); + } + } + var time_ago = interpolate( + '%(time)s', + {time: endorsement.time}, + true + ); + %> + <%= interpolate(fmt, {time_ago: time_ago, user: endorser_display}, true) %> + <% } %> +
++ <% + var timeAgoHtml = interpolate( + '%(created_at)s', + {created_at: created_at}, + true + ); + var postedTimeAgoMessage; + // Using a separate message to ensure proper translation for different languages + // thread_type describes the kind of post this is (e.g. "question" or "discussion"); + // time_ago is how much time has passed since the post was created (e.g. "4 hours ago") + if (thread_type === 'discussion') { + postedTimeAgoMessage = gettext('discussion posted %(time_ago)s by %(author)s'); + } else { + postedTimeAgoMessage = gettext('question posted %(time_ago)s by %(author)s'); + } + %> + <%= interpolate(_.escape(postedTimeAgoMessage), {time_ago: timeAgoHtml, author: author_display}, true) %> +
+