From bdd3cd5afc3f682087711db8b9d166c46bb5cbd8 Mon Sep 17 00:00:00 2001 From: Andreas N Date: Sat, 27 Dec 2014 02:26:51 +0100 Subject: [PATCH] Added button for report/delete actions --- app/views/shared/_answerbox_buttons.html.haml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/views/shared/_answerbox_buttons.html.haml b/app/views/shared/_answerbox_buttons.html.haml index 924036ae..2c22b690 100644 --- a/app/views/shared/_answerbox_buttons.html.haml +++ b/app/views/shared/_answerbox_buttons.html.haml @@ -16,6 +16,17 @@ %button.btn.btn-primary.btn-sm{type: :button, name: 'ab-comments', data: { a_id: a.id, state: :hidden }} %i.fa.fa-comments %span{id: "ab-comment-count-#{a.id}"}= a.comment_count -- if privileged? a.user - %button.btn.btn-danger.btn-sm{name: 'ab-destroy', data: { a_id: a.id }} - %i.fa.fa-trash-o \ No newline at end of file +- if user_signed_in? + .btn-group + %button.btn.btn-default.btn-sm.dropdown-toggle{data: { toggle: :dropdown }, aria: { expanded: :false }} + %span.caret + %ul.dropdown-menu{role: :menu} + - if privileged? a.user + %a{href: '#', name: 'ab-destroy', data: { a_id: a.id }} + %li.text-danger + %i.fa.fa-trash-o + Delete + %a{href: '#', name: 'ab-report', data: { a_id: a.id }} + %li + %i.fa.fa-exclamation-triangle + Report \ No newline at end of file