From 4b52f900f2f0afc039aca119bebf8ce829597fdd Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 6 Aug 2021 10:38:00 +0200 Subject: [PATCH] Use expression substitution for rails admin links --- app/views/answerbox/_actions.haml | 2 +- app/views/answerbox/_header.haml | 2 +- app/views/user/_actions.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/answerbox/_actions.haml b/app/views/answerbox/_actions.haml index b191d68a..d0d506e3 100644 --- a/app/views/answerbox/_actions.haml +++ b/app/views/answerbox/_actions.haml @@ -39,6 +39,6 @@ %i.fa.fa-exclamation-triangle = t 'views.actions.report' - if current_user.has_role? :administrator - %a.dropdown-item{ href: rails_admin_path + "/answer/#{a.id}", target: '_blank' } + %a.dropdown-item{ href: "#{rails_admin_path}/answer/#{a.id}", target: '_blank' } %i.fa.fa-gears View in Kontrollzentrum diff --git a/app/views/answerbox/_header.haml b/app/views/answerbox/_header.haml index 1b739114..41aae19a 100644 --- a/app/views/answerbox/_header.haml +++ b/app/views/answerbox/_header.haml @@ -19,7 +19,7 @@ %i.fa.fa-exclamation-triangle = t 'views.actions.report' - if current_user.has_role? :administrator - %a.dropdown-item{ href: rails_admin_path + "/question/#{a.question.id}", target: '_blank' } + %a.dropdown-item{ href: "#{rails_admin_path}/question/#{a.question.id}", target: '_blank' } %i.fa.fa-gears View in Kontrollzentrum %h6.text-muted.media-heading.answerbox__question-user diff --git a/app/views/user/_actions.haml b/app/views/user/_actions.haml index 62885b2e..d08e07af 100644 --- a/app/views/user/_actions.haml +++ b/app/views/user/_actions.haml @@ -29,6 +29,6 @@ %i.fa.fa-ban = t 'views.actions.ban' - if current_user.has_role? :administrator - %a.dropdown-item{ href: rails_admin_path + "/user/#{user.id}", target: '_blank' } + %a.dropdown-item{ href: "#{rails_admin_path}/user/#{user.id}", target: '_blank' } %i.fa.fa-cogs "View in Kontrollzentrum"