2022-06-21 17:19:12 +05:30
= gitlab_ui_form_for [@project, @schedule], as: :schedule, html: { id: "new-pipeline-schedule-form", class: "js-pipeline-schedule-form pipeline-schedule-form" } do |f|
2017-08-17 22:00:37 +05:30
= form_errors(@schedule)
2018-11-08 19:23:39 +05:30
.form-group.row
2017-08-17 22:00:37 +05:30
.col-md-9
2018-11-18 11:00:15 +05:30
= f.label :description, _('Description'), class: 'label-bold'
2021-04-29 21:17:54 +05:30
= f.text_field :description, class: 'form-control gl-form-input', required: true, autofocus: true, placeholder: s_('PipelineSchedules|Provide a short description for this pipeline')
2018-11-08 19:23:39 +05:30
.form-group.row
2017-08-17 22:00:37 +05:30
.col-md-9
2018-11-18 11:00:15 +05:30
= f.label :cron, _('Interval Pattern'), class: 'label-bold'
2021-09-04 01:27:46 +05:30
#interval-pattern-input{ data: { initial_interval: @schedule.cron, daily_limit: @schedule.daily_limit } }
2018-11-08 19:23:39 +05:30
.form-group.row
2017-08-17 22:00:37 +05:30
.col-md-9
2018-11-18 11:00:15 +05:30
= f.label :cron_timezone, _('Cron Timezone'), class: 'label-bold'
2021-04-29 21:17:54 +05:30
= dropdown_tag(_("Select a timezone"), options: { toggle_class: 'gl-button btn btn-default js-timezone-dropdown w-100', dropdown_class: 'w-100', title: _("Select a timezone"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: timezone_data } } )
2017-08-17 22:00:37 +05:30
= f.text_field :cron_timezone, value: @schedule.cron_timezone, id: 'schedule_cron_timezone', class: 'hidden', name: 'schedule[cron_timezone]', required: true
2018-11-08 19:23:39 +05:30
.form-group.row
2017-08-17 22:00:37 +05:30
.col-md-9
2022-06-21 17:19:12 +05:30
= f.label :ref, _('Target branch or tag'), class: 'label-bold'
2022-05-07 20:08:51 +05:30
%div{ data: { testid: 'schedule-target-ref' } }
.js-target-ref-dropdown{ data: { project_id: @project.id, default_branch: @project.default_branch } }
2017-08-17 22:00:37 +05:30
= f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true
2018-11-08 19:23:39 +05:30
.form-group.row.js-ci-variable-list-section
2017-08-17 22:00:37 +05:30
.col-md-9
2018-11-18 11:00:15 +05:30
%label.label-bold
2017-09-10 17:25:29 +05:30
#{ s_('PipelineSchedules|Variables') }
2018-03-17 18:26:18 +05:30
%ul.ci-variable-list
- @schedule.variables.each do |variable|
2022-05-07 20:08:51 +05:30
= render 'ci/variables/variable_row', form_field: 'schedule', variable: variable
= render 'ci/variables/variable_row', form_field: 'schedule'
2018-03-17 18:26:18 +05:30
- if @schedule.variables.size > 0
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-confirm-secondary.gl-mt-3.js-secret-value-reveal-button{ type: 'button', data: { secret_reveal_status: "#{@schedule.variables.size == 0}" } }
2018-03-17 18:26:18 +05:30
- if @schedule.variables.size == 0
= n_('Hide value', 'Hide values', @schedule.variables.size)
- else
= n_('Reveal value', 'Reveal values', @schedule.variables.size)
2018-11-08 19:23:39 +05:30
.form-group.row
2017-09-10 17:25:29 +05:30
.col-md-9
2019-03-02 22:35:43 +05:30
= f.label :active, s_('PipelineSchedules|Activated'), class: 'label-bold'
2017-08-17 22:00:37 +05:30
%div
2022-06-21 17:19:12 +05:30
= f.gitlab_ui_checkbox_component :active, _('Active'), checkbox_options: { value: @schedule.active, required: false }
2017-08-17 22:00:37 +05:30
.footer-block.row-content-block
2021-04-29 21:17:54 +05:30
= f.submit _('Save pipeline schedule'), class: 'btn gl-button btn-confirm'
2021-03-11 19:13:27 +05:30
= link_to _('Cancel'), pipeline_schedules_path(@project), class: 'btn gl-button btn-default btn-cancel'