From e75284dba049bc3752aebe7eeb8406e200949395 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 27 Dec 2014 16:14:57 +0100 Subject: [PATCH] added some view logic --- app/views/moderation/_discussion.html.haml | 2 +- app/views/moderation/_moderationbox.html.haml | 16 ++++++++++++---- app/views/moderation/index.html.haml | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/views/moderation/_discussion.html.haml b/app/views/moderation/_discussion.html.haml index 235acfd3..acbf993d 100644 --- a/app/views/moderation/_discussion.html.haml +++ b/app/views/moderation/_discussion.html.haml @@ -1,6 +1,6 @@ There are no comments yet %ul.comments - - a.comments.all.each do |comment| + - report.moderation_comments.all.each do |comment| %li{data: { comment_id: comment.id }} .media.comments--media .pull-left diff --git a/app/views/moderation/_moderationbox.html.haml b/app/views/moderation/_moderationbox.html.haml index bca8835d..49e15755 100644 --- a/app/views/moderation/_moderationbox.html.haml +++ b/app/views/moderation/_moderationbox.html.haml @@ -1,9 +1,17 @@ .panel.panel-default.moderationbox .panel-heading - %img.img-rounded.answerbox--img-small - username reported some minutes ago + %img.img-rounded.answerbox--img{src: gravatar_url(report.user)} + = user_screen_name report.user + reported a + = report.type.sub('Reports::', '') + = time_ago_in_words(report.created_at) + ago .panel-body - %p really, really bad content + %p + - if report.type == 'Reports::User' + = user_screen_name report.target + - else + = report.target.content .row .col-md-6.col-sm-4.col-xs-6.text-left %button.btn.btn-primary @@ -20,4 +28,4 @@ %i.fa.fa-comments %span 0 .panel-footer - = render 'moderation/discussion' \ No newline at end of file + = render 'moderation/discussion', report: report \ No newline at end of file diff --git a/app/views/moderation/index.html.haml b/app/views/moderation/index.html.haml index cf2973e5..b4930b5e 100644 --- a/app/views/moderation/index.html.haml +++ b/app/views/moderation/index.html.haml @@ -2,4 +2,5 @@ .row = render 'moderation/moderation_tabs' .col-md-9.col-sm-9.col-xs-12 - = render 'moderation/moderationbox' \ No newline at end of file + - Report.all.reverse_order.each do |r| + = render 'moderation/moderationbox', report: r \ No newline at end of file