Add legal links to Help modal

This commit is contained in:
Sebastian Serth
2023-02-24 19:39:26 +01:00
parent f232ff634b
commit 5c98ec74f0
7 changed files with 41 additions and 0 deletions

View File

@ -153,3 +153,26 @@ span.caret {
padding-inline-start: 0; padding-inline-start: 0;
white-space: pre-wrap; white-space: pre-wrap;
} }
.modal-footer {
ul.horizontal {
list-style: none;
padding: 0;
display: inline;
li {
display: inline;
}
&.dash {
li:after {
// \00a0 is for  , \2013 for –
content: "\00a0\2013\00a0";
}
}
li:last-child:after {
content: "";
}
}
}

View File

@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base
MEMBER_ACTIONS = %i[destroy edit show update].freeze MEMBER_ACTIONS = %i[destroy edit show update].freeze
RENDER_HOST = CodeOcean::Config.new(:code_ocean).read[:render_host] RENDER_HOST = CodeOcean::Config.new(:code_ocean).read[:render_host]
LEGAL_SETTINGS = CodeOcean::Config.new(:code_ocean).read[:legal] || {}
before_action :deny_access_from_render_host before_action :deny_access_from_render_host
after_action :verify_authorized, except: %i[welcome] after_action :verify_authorized, except: %i[welcome]

View File

@ -4,3 +4,10 @@
- if local_assigns.has_key?(:execution_environment) - if local_assigns.has_key?(:execution_environment)
h2 = t('shared.help.execution_environment_specific_help', execution_environment: execution_environment) h2 = t('shared.help.execution_environment_specific_help', execution_environment: execution_environment)
= render_markdown(execution_environment.help) = render_markdown(execution_environment.help)
- content_for :modal_footer do
- if ApplicationController::LEGAL_SETTINGS.present?
ul.horizontal.dash.pull-start
- ApplicationController::LEGAL_SETTINGS.each do |name, link|
li
= link_to(t("shared.help.#{name.delete_suffix('_url')}"), link, target: '_blank', rel: 'noopener')

View File

@ -11,3 +11,4 @@
- else - else
= render(layout: false, locals: (local_assigns[:template_variables] || {}).merge(modal: true), template: template) = render(layout: false, locals: (local_assigns[:template_variables] || {}).merge(modal: true), template: template)
.modal-footer .modal-footer
= yield(:modal_footer)

View File

@ -1,4 +1,9 @@
default: &default default: &default
# The following legal URLs are displayed in the help modal of the application.
# legal:
# imprint_url: https://open.hpi.de/pages/imprint
# privacy_policy_url: https://open.hpi.de/pages/data-protection
# A public-facing host to be used for the render_file function of the SubmissionsController. # A public-facing host to be used for the render_file function of the SubmissionsController.
# User content will be served from this host. If not set, the default host is used (less secure!). # User content will be served from this host. If not set, the default host is used (less secure!).
# render_host: codeoceanusercontent.com # render_host: codeoceanusercontent.com

View File

@ -870,6 +870,8 @@ de:
general_help: Allgemeine Hilfe general_help: Allgemeine Hilfe
headline: Hilfe headline: Hilfe
link: Hilfe link: Hilfe
imprint: Impressum
privacy_policy: Datenschutzerklärung
index: Index index: Index
message_failure: Leider ist ein Fehler auf unserer Plattform aufgetreten. Bitte probieren Sie es später noch einmal. message_failure: Leider ist ein Fehler auf unserer Plattform aufgetreten. Bitte probieren Sie es später noch einmal.
websocket_failure: Leider ist ein Verbindungsproblem aufgetreten. <a href="https://websocketstest.com" target="_blank" rel="noopener">Bitte überprüfen Sie Websocket-Verbindungen mit diesem Tool</a> und versuchen Sie es erneut. websocket_failure: Leider ist ein Verbindungsproblem aufgetreten. <a href="https://websocketstest.com" target="_blank" rel="noopener">Bitte überprüfen Sie Websocket-Verbindungen mit diesem Tool</a> und versuchen Sie es erneut.

View File

@ -870,6 +870,8 @@ en:
general_help: General Help general_help: General Help
headline: Help headline: Help
link: Help link: Help
imprint: Imprint
privacy_policy: Privacy Policy
index: Index index: Index
message_failure: 'Sorry, something went wrong.' message_failure: 'Sorry, something went wrong.'
websocket_failure: Sorry, a connection issue occoured. <a href="https://websocketstest.com" target="_blank" rel="noopener">Please check WebSocket connections with this tool</a> and try again. websocket_failure: Sorry, a connection issue occoured. <a href="https://websocketstest.com" target="_blank" rel="noopener">Please check WebSocket connections with this tool</a> and try again.