38 lines
2.7 KiB
Text
38 lines
2.7 KiB
Text
- expanded = integration_expanded?('kroki_')
|
|
%section.settings.as-kroki.no-animate#js-kroki-settings{ class: ('expanded' if expanded) }
|
|
.settings-header
|
|
%h4
|
|
= _('Kroki')
|
|
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }
|
|
= expanded ? _('Collapse') : _('Expand')
|
|
%p
|
|
= _('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'
|
|
.settings-content
|
|
= form_for @application_setting, url: general_admin_application_settings_path(anchor: 'js-kroki-settings'), html: { class: 'fieldset-form', id: 'kroki-settings' } do |f|
|
|
= form_errors(@application_setting) if expanded
|
|
|
|
%fieldset
|
|
.form-group
|
|
.form-check
|
|
= f.check_box :kroki_enabled, class: 'form-check-input'
|
|
= f.label :kroki_enabled, _('Enable Kroki'), class: 'form-check-label'
|
|
.form-group
|
|
= f.label :kroki_url, 'Kroki URL', class: 'label-bold'
|
|
= f.text_field :kroki_url, class: 'form-control gl-form-input', placeholder: 'http://your-kroki-instance:8000'
|
|
.form-text.text-muted
|
|
- 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 }
|
|
.form-group
|
|
= f.label :kroki_formats, 'Additional diagram formats', class: 'label-bold'
|
|
.form-text.text-muted
|
|
- 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 }
|
|
- kroki_available_formats.each do |format|
|
|
.form-check
|
|
= f.check_box format[:name], class: 'form-check-input'
|
|
= f.label format[:name], format[:label], class: 'form-check-label'
|
|
|
|
= f.submit _('Save changes'), class: "btn gl-button btn-confirm"
|