From c894551ffcf327ffbd2a68a281eda9207fe8d466 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 24 Jul 2022 21:44:46 +0200 Subject: [PATCH] Add Rails Admin link to question partials --- app/views/question/_question.haml | 4 ++++ app/views/shared/_question.haml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/views/question/_question.haml b/app/views/question/_question.haml index 924570d9..3452c2d7 100644 --- a/app/views/question/_question.haml +++ b/app/views/question/_question.haml @@ -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 diff --git a/app/views/shared/_question.haml b/app/views/shared/_question.haml index 9ead4027..48ed386b 100644 --- a/app/views/shared/_question.haml +++ b/app/views/shared/_question.haml @@ -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