Commit 5ccac9ff by Ibrahim Awwal

Keep raw title and body separate from displayed title and body so that <mark>…

Keep raw title and body separate from displayed title and body so that <mark> tags don't show up in the edit view.
parent 73592167
...@@ -223,7 +223,6 @@ def user_profile(request, course_id, user_id): ...@@ -223,7 +223,6 @@ def user_profile(request, course_id, user_id):
except (cc.utils.CommentClientError, cc.utils.CommentClientUnknownError) as err: except (cc.utils.CommentClientError, cc.utils.CommentClientUnknownError) as err:
raise Http404 raise Http404
def followed_threads(request, course_id, user_id): def followed_threads(request, course_id, user_id):
course = get_course_with_access(request.user, course_id, 'load') course = get_course_with_access(request.user, course_id, 'load')
try: try:
......
...@@ -127,7 +127,7 @@ if Backbone? ...@@ -127,7 +127,7 @@ if Backbone?
toJSON: -> toJSON: ->
json_attributes = _.clone(@attributes) json_attributes = _.clone(@attributes)
_.extend(json_attributes, { title: @display_title(), body: @display_body() }) _.extend(json_attributes, { display_title: @display_title(), display_body: @display_body() })
created_at_date: -> created_at_date: ->
new Date(@get("created_at")) new Date(@get("created_at"))
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div><a href="javascript:void(0)" class="dogear action-follow" data-tooltip="follow"></a></div> <div><a href="javascript:void(0)" class="dogear action-follow" data-tooltip="follow"></a></div>
<header> <header>
<a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote" data-tooltip="vote"><span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- votes["up_count"] %>'}</span></a> <a href="#" class="vote-btn discussion-vote discussion-vote-up" data-role="discussion-vote" data-tooltip="vote"><span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- votes["up_count"] %>'}</span></a>
<h1>${'<%- title %>'}</h1> <h1>${'<%- display_title %>'}</h1>
<p class="posted-details"> <p class="posted-details">
${"<% if (obj.username) { %>"} ${"<% if (obj.username) { %>"}
<a href="${'<%- user_url %>'}" class="username">${'<%- username %>'}</a> <a href="${'<%- user_url %>'}" class="username">${'<%- username %>'}</a>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</p> </p>
</header> </header>
<div class="post-body">${'<%- body %>'}</div> <div class="post-body">${'<%- display_body %>'}</div>
${'<% if (obj.courseware_url) { %>'} ${'<% if (obj.courseware_url) { %>'}
<div class="post-context"> <div class="post-context">
(this post is about <a href="${'<%- courseware_url%>'}">${'<%- courseware_title %>'}</a>) (this post is about <a href="${'<%- courseware_url%>'}">${'<%- courseware_title %>'}</a>)
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
<script type="text/template" id="thread-list-item-template"> <script type="text/template" id="thread-list-item-template">
<a href="${'<%- slug %>'}" data-id="${'<%- id %>'}"> <a href="${'<%- slug %>'}" data-id="${'<%- id %>'}">
<span class="title">${"<%- title %>"}</span> <span class="title">${"<%- display_title %>"}</span>
${"<% if (unread_comments_count > 0) { %>"} ${"<% if (unread_comments_count > 0) { %>"}
<span class="comments-count unread" data-tooltip="${"<%- unread_comments_count %>"} new comment${"<%- unread_comments_count > 1 ? 's' : '' %>"}">${"<%- comments_count %>"}</span> <span class="comments-count unread" data-tooltip="${"<%- unread_comments_count %>"} new comment${"<%- unread_comments_count > 1 ? 's' : '' %>"}">${"<%- comments_count %>"}</span>
${"<% } else { %>"} ${"<% } else { %>"}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment