remove debug placeholders, finalize render of comments, flagging working on posts, replies, and comments

This commit is contained in:
Kevin Chugh
2012-12-06 16:26:08 -05:00
parent deb3888a84
commit 14b0cc019f
3 changed files with 14 additions and 8 deletions

View File

@@ -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({

View File

@@ -1,10 +1,14 @@
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()

View File

@@ -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>