summaryrefslogtreecommitdiff
path: root/app/views/projects/triggers/_form.html.haml
blob: 70d654fa9a0ad0fbb8b4c8bdad21e7b4b85288d4 (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
= form_for [@project.namespace.becomes(Namespace), @project, @trigger], html: { class: 'gl-show-field-errors' } do |f|
  = form_errors(@trigger)

  - if @trigger.token
    .form-group
      %label.label-light Token
      %p.form-control-static= @trigger.token
  .form-group
    = f.label :key, "Description", class: "label-light"
    = f.text_field :description, class: "form-control", required: true, title: 'Trigger description is required.', placeholder: "Trigger description"
    - if @trigger.persisted?
      %hr
      = f.fields_for :trigger_schedule do |schedule_fields|
        = schedule_fields.hidden_field :id
        .form-group
          .checkbox
            = schedule_fields.label :active do
              = schedule_fields.check_box :active
              %strong Schedule trigger (experimental)
            .help-block
              If checked, this trigger will be executed periodically according to cron and timezone.
              = link_to icon('question-circle'), help_page_path('ci/triggers/README', anchor: 'using-scheduled-triggers')
        .form-group
          = schedule_fields.label :cron, "Cron", class: "label-light"
          = schedule_fields.text_field :cron, class: "form-control", title: 'Cron specification is required.', placeholder: "0 1 * * *"
        .form-group
          = schedule_fields.label :cron, "Timezone", class: "label-light"
          = schedule_fields.text_field :cron_timezone, class: "form-control", title: 'Timezone is required.', placeholder: "UTC"
        .form-group
          = schedule_fields.label :ref, "Branch or tag", class: "label-light"
          = schedule_fields.text_field :ref, class: "form-control", title: 'Branch or tag is required.', placeholder: "master"
          .help-block Existing branch name, tag
  = f.submit btn_text, class: "btn btn-save"