diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-06-19 10:59:10 -0500 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-07-05 18:36:19 +0900 |
commit | 5576214d0fbbc8b7f208367e3eedd6347b21151b (patch) | |
tree | 3526e353bfa743033c343faacdbdfebc511d3772 /app/views/projects | |
parent | d7cd3c3635bc6200cd9c8668a025826818f19a80 (diff) | |
download | gitlab-ce-5576214d0fbbc8b7f208367e3eedd6347b21151b.tar.gz |
Schedule pipelines with variables
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/32568
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/pipeline_schedules/_form.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/pipeline_schedules/_variable_row.html.haml | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/app/views/projects/pipeline_schedules/_form.html.haml b/app/views/projects/pipeline_schedules/_form.html.haml index fc7fa5c1876..4f65532e279 100644 --- a/app/views/projects/pipeline_schedules/_form.html.haml +++ b/app/views/projects/pipeline_schedules/_form.html.haml @@ -24,6 +24,15 @@ = f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true .form-group .col-md-9 + %label.label-light + #{ _('Variables') } + %ul.js-pipeline-variable-list.pipeline-variable-list + - if @schedule.variables.present? + - @schedule.variables.each_with_index do |variable, i| + = render 'variable_row', id: variable.id, key: variable.key, value: variable.value + = render 'variable_row' + .form-group + .col-md-9 = f.label :active, s_('PipelineSchedules|Activated'), class: 'label-light' %div = f.check_box :active, required: false, value: @schedule.active? diff --git a/app/views/projects/pipeline_schedules/_variable_row.html.haml b/app/views/projects/pipeline_schedules/_variable_row.html.haml new file mode 100644 index 00000000000..85813b2ffd4 --- /dev/null +++ b/app/views/projects/pipeline_schedules/_variable_row.html.haml @@ -0,0 +1,16 @@ +- id = local_assigns.fetch(:id, nil) +- key = local_assigns.fetch(:key, "") +- value = local_assigns.fetch(:value, "") +%li.js-row.pipeline-variable-row{ data: { is_persisted: "#{!id.nil?}" } } + %input{ type: "hidden", name: "schedule[variables_attributes][][id]", value: id } + %input.js-destroy-input{ type: "hidden", name: "schedule[variables_attributes][][_destroy]" } + %input.js-user-input.pipeline-variable-key-input.form-control{ type: "text", + name: "schedule[variables_attributes][][key]", + value: key, + placeholder: _('Input variable key') } + %textarea.js-user-input.pipeline-variable-value-input.form-control{ rows: 1, + name: "schedule[variables_attributes][][value]", + placeholder: _('Input variable value') } + = value + %button.js-row-remove-button.pipeline-variable-row-remove-button{ 'aria-label': _('Remove variable row') } + %i.fa.fa-minus-circle{ 'aria-hidden': "true" } |