Skip to content

Commit

Permalink
Link to contact form in warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chvp committed Oct 11, 2021
1 parent ee1dfbb commit 4373d6d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config/locales/views/courses/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ en:
contact_html: "<a href=\"%{contact_url}\">Contact us</a> 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."
Expand Down
1 change: 1 addition & 0 deletions config/locales/views/courses/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ nl:
contact_html: "<a href=\"%{contact_url}\">Contacteer ons</a> 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.'
Expand Down

0 comments on commit 4373d6d

Please sign in to comment.