Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
fc127ddf
Commit
fc127ddf
authored
Dec 02, 2012
by
Kevin Chugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert flagging to one flag
parent
dc5b26be
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
27 deletions
+25
-27
.redcar/lucene/segments.gen
+0
-0
.redcar/lucene_last_updated
+1
-1
.redcar/redcar.lock
+1
-1
.redcar/storage/cursor_saver.yaml
+14
-2
.redcar/tags
+0
-0
api/flags.rb
+2
-21
lib/helpers.rb
+7
-0
models/comment_thread.rb
+0
-1
models/content.rb
+0
-1
No files found.
.redcar/lucene/segments.gen
View file @
fc127ddf
No preview for this file type
.redcar/lucene_last_updated
View file @
fc127ddf
1354
120149
1354
462766
.redcar/redcar.lock
View file @
fc127ddf
4727: Locked by 4727 at Wed Nov 28 11:21:00
-0500 2012
20566: Locked by 20566 at Sun Dec 02 07:30:57
-0500 2012
.redcar/storage/cursor_saver.yaml
View file @
fc127ddf
---
cursor_positions
:
-
:path
:
.gitignore
:cursor_offset
:
0
:timestamp
:
2012-09-21 19:42:27 -04:00
:cursor_offset
:
71
:timestamp
:
2012-12-02 00:17:35 -05:00
-
:path
:
api/votes.rb
:cursor_offset
:
277
:timestamp
:
2012-11-20 19:17:31 -05:00
-
:path
:
api/commentables.rb
:cursor_offset
:
208
:timestamp
:
2012-11-20 19:17:31 -05:00
-
:path
:
api/comment_threads.rb
:cursor_offset
:
195
:timestamp
:
2012-11-20 19:17:31 -05:00
-
:path
:
models/comment_thread.rb
:cursor_offset
:
6463
:timestamp
:
2012-12-02 08:32:40 -05:00
files_to_retain
:
0
.redcar/tags
View file @
fc127ddf
This diff is collapsed.
Click to expand it.
api/flags.rb
View file @
fc127ddf
...
...
@@ -2,8 +2,8 @@ put "#{APIPREFIX}/comments/:comment_id/abuse_flags" do |comment_id|
flag_as_abuse
comment
end
put
"
#{
APIPREFIX
}
/threads/:thread_id/abuse_flags"
do
|
thread_id
|
flag_as_abuse
thread
put
"
#{
APIPREFIX
}
/threads/:thread_id/abuse_
un
flags"
do
|
thread_id
|
un_
flag_as_abuse
thread
end
...
...
@@ -14,22 +14,3 @@ end
delete
"
#{
APIPREFIX
}
/comments/:thread_id/abuse_flags"
do
|
thread_id
|
undo_flag_as_abuse
thread
end
put
"
#{
APIPREFIX
}
/comments/:comment_id/spoiler_flags"
do
|
comment_id
|
flag_as_spoiler
comment
end
put
"
#{
APIPREFIX
}
/comments/:thread_id/spoiler_flags"
do
|
thread_id
|
flag_as_spoiler
thread
end
delete
"
#{
APIPREFIX
}
/comments/:comment_id/spoiler_flags"
do
|
comment_id
|
undo_flag_as_spoiler
comment
end
delete
"
#{
APIPREFIX
}
/comments/:thread_id/spoiler_flags"
do
|
thread_id
|
undo_flag_as_spoiler
thread
end
lib/helpers.rb
View file @
fc127ddf
...
...
@@ -43,6 +43,13 @@ helpers do
obj
.
save
obj
.
reload
.
to_hash
.
to_json
end
def
un_flag_as_abuse
(
obj
)
raise
ArgumentError
,
"User id is required"
unless
user
obj
.
abuse_flaggers
.
delete
user
.
id
obj
.
save
obj
.
reload
.
to_hash
.
to_json
end
def
undo_vote_for
(
obj
)
raise
ArgumentError
,
"must provide user id"
unless
user
...
...
models/comment_thread.rb
View file @
fc127ddf
...
...
@@ -159,7 +159,6 @@ class CommentThread < Content
"username"
=>
author
.
username
,
"votes"
=>
votes
.
slice
(
*
%w[count up_count down_count point]
),
"abuse_flaggers"
=>
abuse_flaggers
,
"spoiler_flaggers"
=>
spoiler_flaggers
,
"tags"
=>
tags_array
,
"type"
=>
"thread"
,
"endorsed"
=>
endorsed?
)
...
...
models/content.rb
View file @
fc127ddf
...
...
@@ -4,7 +4,6 @@ class Content
field
:visible
,
type:
Boolean
,
default:
true
field
:abuse_flaggers
,
type:
Array
,
default:
[]
field
:spoiler_flaggers
,
type:
Array
,
default:
[]
def
author_with_anonymity
(
attr
=
nil
,
attr_when_anonymous
=
nil
)
if
not
attr
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment