BigW Consortium Gitlab

_service_settings.html.haml 1.46 KB
Newer Older
1
= form_errors(@service)
2

3
- if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true)
4
  = render "projects/services/#{@service.to_param}/help", subject: subject
5
- elsif @service.help.present?
6 7 8 9
  .well
    = preserve do
      = markdown @service.help

10
.service-settings
11
  .form-group
12
    = form.label :active, "Active", class: "control-label"
13
    .col-sm-10
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
      = form.check_box :active

  - if @service.supported_events.present?
    .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]

          %p.light
            = service_event_description(event)

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