2020-07-27 12:09:50 +00:00
= form_for [@project, @schedule], as: :schedule, html: { id: "new-pipeline-schedule-form", class: "js-pipeline-schedule-form pipeline-schedule-form" } do |f|
2017-05-07 22:35:56 +00:00
= form_errors(@schedule)
2018-04-12 20:11:22 +00:00
.form-group.row
2017-05-13 01:15:27 +00:00
.col-md-9
2018-07-19 22:11:31 +00:00
= f.label :description, _('Description'), class: 'label-bold'
2017-06-11 23:33:28 +00:00
= f.text_field :description, class: 'form-control', required: true, autofocus: true, placeholder: s_('PipelineSchedules|Provide a short description for this pipeline')
2018-04-12 20:11:22 +00:00
.form-group.row
2017-05-13 01:15:27 +00:00
.col-md-9
2018-07-19 22:11:31 +00:00
= f.label :cron, _('Interval Pattern'), class: 'label-bold'
2017-05-07 22:35:56 +00:00
#interval-pattern-input{ data: { initial_interval: @schedule.cron } }
2018-04-12 20:11:22 +00:00
.form-group.row
2017-05-13 01:15:27 +00:00
.col-md-9
2018-07-19 22:11:31 +00:00
= f.label :cron_timezone, _('Cron Timezone'), class: 'label-bold'
2019-04-12 11:03:43 +00:00
= dropdown_tag(_("Select a timezone"), options: { toggle_class: 'btn js-timezone-dropdown w-100', dropdown_class: 'w-100', title: _("Select a timezone"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: timezone_data } } )
2017-05-07 22:35:56 +00:00
= f.text_field :cron_timezone, value: @schedule.cron_timezone, id: 'schedule_cron_timezone', class: 'hidden', name: 'schedule[cron_timezone]', required: true
2018-04-12 20:11:22 +00:00
.form-group.row
2017-05-13 01:15:27 +00:00
.col-md-9
2018-07-19 22:11:31 +00:00
= f.label :ref, _('Target Branch'), class: 'label-bold'
2019-04-12 11:03:43 +00:00
= dropdown_tag(_("Select target branch"), options: { toggle_class: 'btn js-target-branch-dropdown w-100', dropdown_class: 'git-revision-dropdown w-100', title: _("Select target branch"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: @project.repository.branch_names, default_branch: @project.default_branch } } )
2017-05-07 22:35:56 +00:00
= f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true
2018-04-12 20:11:22 +00:00
.form-group.row.js-ci-variable-list-section
2017-06-19 15:59:10 +00:00
.col-md-9
2018-07-19 22:11:31 +00:00
%label.label-bold
2017-07-05 00:13:33 +00:00
#{ s_('PipelineSchedules|Variables') }
2018-01-26 06:25:26 +00:00
%ul.ci-variable-list
- @schedule.variables.each do |variable|
= render 'ci/variables/variable_row', form_field: 'schedule', variable: variable, only_key_value: true
= render 'ci/variables/variable_row', form_field: 'schedule', only_key_value: true
- if @schedule.variables.size > 0
2020-07-27 21:09:16 +00:00
%button.btn.btn-info.btn-inverted.gl-mt-3.js-secret-value-reveal-button{ type: 'button', data: { secret_reveal_status: "#{@schedule.variables.size == 0}" } }
2018-01-26 06:25:26 +00:00
- if @schedule.variables.size == 0
= n_('Hide value', 'Hide values', @schedule.variables.size)
- else
= n_('Reveal value', 'Reveal values', @schedule.variables.size)
2018-04-12 20:11:22 +00:00
.form-group.row
2017-05-13 01:15:27 +00:00
.col-md-9
2019-01-16 12:09:29 +00:00
= f.label :active, s_('PipelineSchedules|Activated'), class: 'label-bold'
2017-05-07 22:35:56 +00:00
%div
= f.check_box :active, required: false, value: @schedule.active?
2020-05-26 21:07:45 +00:00
= f.label :active, _('Active'), class: 'gl-font-weight-normal'
2017-05-07 22:35:56 +00:00
.footer-block.row-content-block
2021-03-17 12:09:19 +00:00
= f.submit _('Save pipeline schedule'), class: 'btn gl-button btn-confirm'
2021-01-29 15:09:40 +00:00
= link_to _('Cancel'), pipeline_schedules_path(@project), class: 'btn gl-button btn-default btn-cancel'