debian-mirror-gitlab/app/views/shared/_service_settings.html.haml

67 lines
2.2 KiB
Text
Raw Normal View History

2016-06-02 11:05:42 +05:30
= form_errors(@service)
2015-09-11 14:41:01 +05:30
2017-08-17 22:00:37 +05:30
- if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true)
= render "projects/services/#{@service.to_param}/help", subject: subject
- elsif @service.help.present?
2018-11-08 19:23:39 +05:30
.info-well
.well-segment
= markdown @service.help
2017-08-17 22:00:37 +05:30
.service-settings
2017-09-10 17:25:29 +05:30
- if @service.show_active_box?
2018-11-08 19:23:39 +05:30
.form-group.row
= form.label :active, "Active", class: "col-form-label col-sm-2"
2017-09-10 17:25:29 +05:30
.col-sm-10
2019-12-26 22:10:19 +05:30
= form.check_box :active, disabled: disable_fields_service?(@service), data: { qa_selector: 'active_checkbox' }
2017-08-17 22:00:37 +05:30
2018-03-27 19:54:05 +05:30
- if @service.configurable_events.present?
2018-11-08 19:23:39 +05:30
.form-group.row
2020-01-01 13:55:28 +05:30
%label.col-form-label.col-sm-2= _('Trigger')
2017-08-17 22:00:37 +05:30
.col-sm-10
2018-03-27 19:54:05 +05:30
- @service.configurable_events.each do |event|
2018-11-08 19:23:39 +05:30
.form-group
.form-check
= form.check_box service_event_field_name(event), class: 'form-check-input'
= form.label service_event_field_name(event), class: 'form-check-label' do
2017-08-17 22:00:37 +05:30
%strong
= event.humanize
2018-11-08 19:23:39 +05:30
- field = @service.event_field(event)
2017-08-17 22:00:37 +05:30
2018-11-08 19:23:39 +05:30
- if field
2017-08-17 22:00:37 +05:30
= form.text_field field[:name], class: "form-control", placeholder: field[:placeholder]
2018-11-08 19:23:39 +05:30
%p.text-muted
= @service.class.event_description(event)
2017-08-17 22:00:37 +05:30
2020-01-01 13:55:28 +05:30
- if @service.configurable_event_actions.present?
.form-group.row
%label.col-form-label.col-sm-2= _('Event Actions')
.col-sm-10
- @service.configurable_event_actions.each do |action|
.form-group
.form-check
= form.check_box service_event_action_field_name(action), class: 'form-check-input'
= form.label service_event_action_field_name(action), class: 'form-check-label' do
%strong
= event_action_description(action)
%p.text-muted
= event_action_description(action)
2017-08-17 22:00:37 +05:30
- @service.global_fields.each do |field|
- type = field[:type]
- if type == 'fieldset'
- fields = field[:fields]
- legend = field[:legend]
%fieldset
%legend= legend
- fields.each do |subfield|
= render 'shared/field', form: form, field: subfield
- else
= render 'shared/field', form: form, field: field