2020-11-28 21:09:37 +00:00
- expanded = integration_expanded?('kroki_')
%section.settings.as-kroki.no-animate#js-kroki-settings{ class: ('expanded' if expanded) }
.settings-header
2022-07-06 18:08:29 +00:00
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
2020-11-28 21:09:37 +00:00
= _('Kroki')
2022-06-13 18:09:22 +00:00
= render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do
2020-11-28 21:09:37 +00:00
= expanded ? _('Collapse') : _('Expand')
%p
2021-07-20 15:10:07 +00:00
= _('Users can render diagrams in AsciiDoc, Markdown, reStructuredText, and Textile documents using Kroki.')
= link_to _('Learn more.'), help_page_path('administration/integration/kroki.md'), target: '_blank', rel: 'noopener noreferrer'
2020-11-28 21:09:37 +00:00
.settings-content
2022-04-14 21:09:21 +00:00
= gitlab_ui_form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-kroki-settings'), html: { class: 'fieldset-form', id: 'kroki-settings' } do |f|
2022-06-14 12:08:53 +00:00
= form_errors(@application_setting, pajamas_alert: true) if expanded
2020-11-28 21:09:37 +00:00
%fieldset
.form-group
2022-04-14 21:09:21 +00:00
= f.gitlab_ui_checkbox_component :kroki_enabled,
_('Enable Kroki')
2020-11-28 21:09:37 +00:00
.form-group
= f.label :kroki_url, 'Kroki URL', class: 'label-bold'
2021-01-31 18:09:51 +00:00
= f.text_field :kroki_url, class: 'form-control gl-form-input', placeholder: 'http://your-kroki-instance:8000'
2020-11-28 21:09:37 +00:00
.form-text.text-muted
2021-07-20 15:10:07 +00:00
- install_link_url = 'https://docs.kroki.io/kroki/setup/install/'
- install_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: install_link_url }
= html_escape(_('Use the public cloud instance URL (%{kroki_public_url}) or %{install_link_start}install Kroki%{install_link_end} on your own infrastructure and use your own instance URL.')) % { kroki_public_url: '<code>https://kroki.io</code>'.html_safe, install_link_start: install_link_start, install_link_end: '</a>'.html_safe }
2021-02-17 03:08:59 +00:00
.form-group
= f.label :kroki_formats, 'Additional diagram formats', class: 'label-bold'
.form-text.text-muted
2021-07-20 15:10:07 +00:00
- container_link_url = 'https://docs.kroki.io/kroki/setup/install/#images'
- container_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: container_link_url }
= html_escape(_('To use the additional formats, you must start the required %{container_link_start}companion containers%{container_link_end}.')) % { container_link_start: container_link_start, container_link_end: '</a>'.html_safe }
2022-04-14 21:09:21 +00:00
- kroki_available_formats.each do |format|
= f.gitlab_ui_checkbox_component format[:name], format[:label]
2020-11-28 21:09:37 +00:00
2021-03-09 15:08:59 +00:00
= f.submit _('Save changes'), class: "btn gl-button btn-confirm"