Add Rails Admin link to question partials

This commit is contained in:
Andreas Nedbal 2022-07-24 21:44:46 +02:00
parent 66cd8bfb2a
commit c894551ffc
2 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,10 @@
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id } }
%i.fa.fa-exclamation-triangle
= t 'views.actions.report'
- if current_user.has_role? :administrator
%a.dropdown-item{ href: rails_admin_path_for_resource(question) }
%i.fa.fa-gears
= t("voc.view_in_rails_admin")
%h6.text-muted.media-heading.answerbox__question-user
- identifier = question.author_is_anonymous ? question.author_identifier : nil
- if hidden

View File

@ -21,6 +21,10 @@
%a.dropdown-item{ href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: q.id } }
%i.fa.fa-exclamation-triangle
= t 'views.actions.report'
- if current_user.has_role? :administrator
%a.dropdown-item{ href: rails_admin_path_for_resource(q) }
%i.fa.fa-gears
= t("voc.view_in_rails_admin")
%h6.media-heading.text-muted.answerbox__question-user
= raw t('views.answerbox.asked', user: user_screen_name(q.user), time: time_tooltip(q))
- if q.answer_count > 1