gitlab-org--gitlab-foss/app/views/shared/_service_settings.html.haml

51 lines
1.6 KiB
Text
Raw Normal View History

= form_errors(@service)
- if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true)
2016-11-19 15:56:25 -05:00
= render "projects/services/#{@service.to_param}/help", subject: subject
- elsif @service.help.present?
.card
2017-04-28 10:57:17 -04:00
= markdown @service.help
2016-11-21 17:11:21 -05:00
.service-settings
- if @service.show_active_box?
.form-group.row
= form.label :active, "Active", class: "col-form-label col-sm-2"
.col-sm-10
= form.check_box :active, disabled: disable_fields_service?(@service)
2016-11-21 17:11:21 -05:00
- if @service.configurable_events.present?
.form-group.row
= form.label :url, "Trigger", class: 'col-form-label col-sm-2'
2016-11-21 17:11:21 -05:00
.col-sm-10
- @service.configurable_events.each do |event|
2016-11-21 17:11:21 -05:00
%div
2018-04-09 13:36:21 -04:00
= form.check_box service_event_field_name(event), class: 'float-left'
2016-11-21 17:11:21 -05:00
.prepend-left-20
= form.label service_event_field_name(event), class: 'list-label' do
%strong
= event.humanize
- field = @service.event_field(event)
- if field
%p
= form.text_field field[:name], class: "form-control", placeholder: field[:placeholder]
%p.light
2018-03-16 15:09:35 -04:00
= @service.class.event_description(event)
2016-11-21 17:11:21 -05:00
- @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