mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-29 13:21:48 +01:00
added link to the reported object
This commit is contained in:
parent
6864faee03
commit
7bfa5132dd
2 changed files with 18 additions and 2 deletions
|
@ -1,2 +1,18 @@
|
||||||
module ModerationHelper
|
module ModerationHelper
|
||||||
|
# @param report [Report]
|
||||||
|
def content_url(report)
|
||||||
|
target = report.target
|
||||||
|
case report.type
|
||||||
|
when 'Reports::Answer'
|
||||||
|
show_user_answer_path target.user.screen_name, target.id
|
||||||
|
when 'Reports::Comment'
|
||||||
|
show_user_answer_path target.answer.user.screen_name, target.answer.id
|
||||||
|
when 'Reports::Question'
|
||||||
|
show_user_question_path 'user', target.id
|
||||||
|
when 'Reports::User'
|
||||||
|
show_user_profile_path target.screen_name
|
||||||
|
else
|
||||||
|
'#'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
= report.target.content
|
= report.target.content
|
||||||
.row
|
.row
|
||||||
.col-md-6.col-sm-4.col-xs-6.text-left
|
.col-md-6.col-sm-4.col-xs-6.text-left
|
||||||
%button.btn.btn-primary
|
%a.btn.btn-primary{href: content_url(report)}
|
||||||
View reported
|
View reported
|
||||||
contenttype
|
= report.type.sub('Reports::', '')
|
||||||
.col-md-6.col-sm-8.col-xs-6.text-right
|
.col-md-6.col-sm-8.col-xs-6.text-right
|
||||||
%button.btn.btn-success.btn-sm
|
%button.btn.btn-success.btn-sm
|
||||||
%i.fa.fa-thumbs-up
|
%i.fa.fa-thumbs-up
|
||||||
|
|
Loading…
Reference in a new issue