From 4373d6da3877a9dc4b4412eaedd4d339e2bed9f8 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sun, 10 Oct 2021 18:55:04 +0200 Subject: [PATCH] Link to contact form in warning --- app/controllers/courses_controller.rb | 8 +++++++- config/locales/views/courses/en.yml | 1 + config/locales/views/courses/nl.yml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 7ca4e817e4..2646691ac7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -47,7 +47,13 @@ def show redirect_unless_secret_correct return if performed? end - flash[:alert] = I18n.t('courses.show.has_private_exercises') if current_user&.course_admin?(@course) && !@course.all_activities_accessible? + if current_user&.course_admin?(@course) && !@course.all_activities_accessible? + flash[:alert] = I18n.t('courses.show.has_private_exercises') + flash[:extra] = { + 'message' => I18n.t('courses.show.has_private_help'), + 'url' => contact_url + } + end @title = @course.name @series = policy_scope(@course.series).includes(:evaluation) @series_loaded = params[:secret].present? ? @course.series.count : 2 diff --git a/config/locales/views/courses/en.yml b/config/locales/views/courses/en.yml index 11c628025b..4a96d6bfaa 100644 --- a/config/locales/views/courses/en.yml +++ b/config/locales/views/courses/en.yml @@ -89,6 +89,7 @@ en: contact_html: "Contact us if you want to delete the course anyway." show: has_private_exercises: "This course uses private exercises that it hasn't been granted the rights to." + has_private_help: "Contact us if you don't know how to solve this." course: Course hidden_show_link: "Secret link" visibility-visible_for_all-info: "This course is visible for everyone: everyone can access this course from the course overview, and the contents are visible for everyone." diff --git a/config/locales/views/courses/nl.yml b/config/locales/views/courses/nl.yml index 928ffcbdf5..1425e09661 100644 --- a/config/locales/views/courses/nl.yml +++ b/config/locales/views/courses/nl.yml @@ -97,6 +97,7 @@ nl: contact_html: "Contacteer ons als je de cursus toch wilt verwijderen." show: has_private_exercises: "Deze cursus gebruikt privé oefeningen waartoe die geen rechten heeft." + has_private_help: "Contacteer ons als je niet weet hoe je dit kan oplossen." course: Cursus hidden_show_link: 'Geheime link' visibility-visible_for_all-info: 'Deze cursus is zichtbaar voor iedereen: ze wordt opgelijst in het cursusoverzicht en de inhoud is toegankelijk voor iedereen.'