summaryrefslogtreecommitdiff
path: root/app/views/shared/_service_settings.html.haml
blob: 3da4b77b5ebca9e9f7e49c36d7bbb1383dbfd77b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
= form_errors(@service)

- if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true)
  = render "projects/services/#{@service.to_param}/help", subject: @service
- elsif @service.help.present?
  .info-well
    .well-segment
      = markdown @service.help

.service-settings
  .js-vue-integration-settings{ data: { show_active: @service.show_active_box?.to_s, activated: (@service.active || @service.new_record?).to_s, disabled: disable_fields_service?(@service).to_s } }

  - if @service.configurable_events.present?
    .form-group.row
      %label.col-form-label.col-sm-2= _('Trigger')

      .col-sm-10
        - @service.configurable_events.each do |event|
          .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
                %strong
                  = event.humanize

            - field = @service.event_field(event)

            - if field
              = form.text_field field[:name], class: "form-control", placeholder: field[:placeholder]

            %p.text-muted
              = @service.class.event_description(event)

  - 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)

  - @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