2016-04-04 21:25:38 -04:00
|
|
|
= form_errors(@service)
|
2015-04-29 10:52:27 -04:00
|
|
|
|
|
|
|
- if @service.help.present?
|
|
|
|
.well
|
|
|
|
= preserve do
|
|
|
|
= markdown @service.help
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
= form.label :active, "Active", class: "control-label"
|
|
|
|
.col-sm-10
|
|
|
|
= form.check_box :active
|
|
|
|
|
2016-07-13 15:49:47 -04:00
|
|
|
.form-group
|
|
|
|
= form.label :url, "Trigger", class: 'control-label'
|
|
|
|
|
|
|
|
.col-sm-10
|
|
|
|
- @service.supported_events.each do |event|
|
|
|
|
%div
|
|
|
|
= form.check_box service_event_field_name(event), class: 'pull-left'
|
|
|
|
.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]
|
2015-12-07 07:23:23 -05:00
|
|
|
|
2016-07-13 15:49:47 -04:00
|
|
|
%p.light
|
|
|
|
= service_event_description(event)
|
2015-04-29 10:52:27 -04:00
|
|
|
|
2016-07-13 15:49:47 -04:00
|
|
|
- @service.global_fields.each do |field|
|
2015-04-29 10:52:27 -04:00
|
|
|
- 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
|