allow flagging for abuse and spoilers
This commit is contained in:
@@ -10,7 +10,7 @@ class Comment(models.Model):
|
||||
'id', 'body', 'anonymous', 'anonymous_to_peers', 'course_id',
|
||||
'endorsed', 'parent_id', 'thread_id', 'username', 'votes', 'user_id',
|
||||
'closed', 'created_at', 'updated_at', 'depth', 'at_position_list',
|
||||
'type', 'commentable_id',
|
||||
'type', 'commentable_id', 'abuse_flaggers', 'spoiler_flaggers'
|
||||
]
|
||||
|
||||
updatable_fields = [
|
||||
|
||||
@@ -10,7 +10,7 @@ class Thread(models.Model):
|
||||
'closed', 'tags', 'votes', 'commentable_id', 'username', 'user_id',
|
||||
'created_at', 'updated_at', 'comments_count', 'unread_comments_count',
|
||||
'at_position_list', 'children', 'type', 'highlighted_title',
|
||||
'highlighted_body', 'endorsed', 'read'
|
||||
'highlighted_body', 'endorsed', 'read', 'abuse_flaggers', 'spoiler_flaggers'
|
||||
]
|
||||
|
||||
updatable_fields = [
|
||||
|
||||
@@ -78,7 +78,8 @@ if Backbone?
|
||||
if @getContent(id)
|
||||
@getContent(id).updateInfo(info)
|
||||
$.extend @contentInfos, infos
|
||||
|
||||
|
||||
|
||||
class @Thread extends @Content
|
||||
urlMappers:
|
||||
'retrieve' : -> DiscussionUtil.urlFor('retrieve_single_thread', @discussion.id, @id)
|
||||
@@ -119,7 +120,13 @@ if Backbone?
|
||||
else
|
||||
@get("body")
|
||||
|
||||
display_title: ->
|
||||
display_tigetCommentsCount: ->
|
||||
count = 0
|
||||
@get('comments').each (comment) ->
|
||||
count += comment.getCommentsCount() + 1
|
||||
count
|
||||
|
||||
class @Comments extends Backbtle: ->
|
||||
if @has("highlighted_title")
|
||||
String(@get("highlighted_title")).replace(/<highlight>/g, '<mark>').replace(/<\/highlight>/g, '</mark>')
|
||||
else
|
||||
@@ -134,6 +141,7 @@ if Backbone?
|
||||
|
||||
created_at_time: ->
|
||||
new Date(@get("created_at")).getTime()
|
||||
|
||||
|
||||
class @Comment extends @Content
|
||||
urlMappers:
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
<div class="discussion-post">
|
||||
<div><a href="javascript:void(0)" class="dogear action-follow" data-tooltip="follow"></a></div>
|
||||
<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>
|
||||
<a href="#" class="abuse-btn discussion-vote discussion-vote-up" data-role="discussion-flag" data-tooltip="flag as abusive">
|
||||
<span class="plus-icon">+</span> <span class='votes-count-number'>${'<%- abuse_flaggers.length%>'}</span></a>
|
||||
<h1>${'<%- title %>'}</h1>
|
||||
<p class="posted-details">
|
||||
${"<% if (obj.username) { %>"}
|
||||
|
||||
Reference in New Issue
Block a user