Commit 14b0cc01 by Kevin Chugh

remove debug placeholders, finalize render of comments, flagging working on…

remove debug placeholders, finalize render of comments, flagging working on posts, replies, and comments
parent deb3888a
......@@ -72,7 +72,6 @@ def inline_discussion(request, course_id, discussion_id):
"""
Renders JSON for DiscussionModules
"""
course = get_course_with_access(request.user, course_id, 'load')
try:
......@@ -179,6 +178,8 @@ def single_thread(request, course_id, discussion_id, thread_id):
# TODO: Remove completely or switch back to server side rendering
# html = render_to_string('discussion/_ajax_single_thread.html', context)
content = utils.safe_content(thread.to_dict())
log.debug("*************************")
log.debug(content)
if courseware_context:
content.update(courseware_context)
return utils.JsonResponse({
......
if Backbone?
class @ResponseCommentShowView extends DiscussionContentView
events:
"click .discussion-flag-abuse": "toggleFlagAbuse"
events:
"click .discussion-flag-abuse": "toggleFlagAbuse"
tagName: "li"
initialize: ->
super()
@model.on "change", @updateModelDetails
render: ->
@template = _.template($("#response-comment-show-template").html())
......@@ -14,6 +18,7 @@ if Backbone?
@initLocal()
@delegateEvents()
@renderAttrs()
@renderFlagged()
@markAsStaff()
@$el.find(".timeago").timeago()
@convertMath()
......@@ -45,6 +50,9 @@ if Backbone?
@$("[data-role=thread-flag]").removeClass("notflagged")
else
@$("[data-role=thread-flag]").removeClass("flagged")
@$("[data-role=thread-flag]").addClass("notflagged")
@$("[data-role=thread-flag]").addClass("notflagged")
updateModelDetails: =>
@renderFlagged()
......@@ -44,7 +44,6 @@
</header>
<div class="post-body">${'<%- body %>'}</div>
POST
<div class="discussion-flag-abuse notflagged" data-role="thread-flag" data-tooltip="flag">
<i class="icon"></i><span class="flag-label">Report Misuse</span></div>
......@@ -111,7 +110,6 @@
<p class="posted-details" title="${'<%- created_at %>'}">${'<%- created_at %>'}</p>
</header>
<div class="response-local"><div class="response-body">${"<%- body %>"}</div>
RESPONSE
<div class="discussion-flag-abuse notflagged" data-role="thread-flag" data-tooltip="flag">
<i class="icon"></i><span class="flag-label">Report Misuse</span></div>
</div>
......@@ -137,9 +135,8 @@
<script type="text/template" id="response-comment-show-template">
<div id="comment_${'<%- id %>'}">
<div class="response-body">${'<%- body %>'}</div>
COMMENT
<div class="discussion-flag-abuse notflagged" data-role="thread-flag" data-tooltip="flag">
<i class="icon"></i><span class="flag-label">Report Misuse</span></div>
<i class="icon"></i><span class="flag-label"></span></div>
<p class="posted-details">&ndash;posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by
${"<% if (obj.username) { %>"}
<a href="${'<%- user_url %>'}" class="profile-link">${'<%- username %>'}</a>
......
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