summaryrefslogtreecommitdiff
path: root/app/views/projects/pipeline_schedules
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-06-23 03:57:13 +0900
committerShinya Maeda <shinya@gitlab.com>2017-07-05 18:37:50 +0900
commit507fedf3c39dbe6d2efff789d98b7b29ff9428a3 (patch)
tree46fb2d429c551c6f69dd0dcc32ca2d0d6d6cfb6e /app/views/projects/pipeline_schedules
parent06f01073696199da980a2101bc3eb77922131a8a (diff)
downloadgitlab-ce-507fedf3c39dbe6d2efff789d98b7b29ff9428a3.tar.gz
Controller logic. Delete before modification. Halfway.
Diffstat (limited to 'app/views/projects/pipeline_schedules')
-rw-r--r--app/views/projects/pipeline_schedules/_form.html.haml32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/views/projects/pipeline_schedules/_form.html.haml b/app/views/projects/pipeline_schedules/_form.html.haml
index 0e600c59ef6..3857a59a043 100644
--- a/app/views/projects/pipeline_schedules/_form.html.haml
+++ b/app/views/projects/pipeline_schedules/_form.html.haml
@@ -22,6 +22,38 @@
= f.label :ref, _('Target Branch'), class: 'label-light'
= dropdown_tag(_("Select target branch"), options: { toggle_class: 'btn js-target-branch-dropdown', dropdown_class: 'git-revision-dropdown', title: _("Select target branch"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: @project.repository.branch_names, default_branch: @project.default_branch } } )
= f.text_field :ref, value: @schedule.ref, id: 'schedule_ref', class: 'hidden', name: 'schedule[ref]', required: true
+ -# TODO: Test code
+ = @schedule.variables.inspect
+ - if @schedule.variables.present?
+ - @schedule.variables.each_with_index do |variable, i|
+ .form-group
+ .col-md-9
+ %label.label-light Key
+ %input.form-control{:name => "schedule[variables_attributes][#{i}][key]", :type => "text", :value => variable.key}/
+ %p.gl-field-error.hide This field is required.
+ %label.label-light Value
+ %input.form-control{:name => "schedule[variables_attributes][#{i}][value]", :type => "text", :value => variable.value}/
+ %p.gl-field-error.hide This field is required.
+ - if @schedule.variables.count == 1
+ - (1..1).each do |i|
+ .form-group
+ .col-md-9
+ %label.label-light Key
+ %input.form-control{:name => "schedule[variables_attributes][#{i}][key]", :type => "text"}/
+ %p.gl-field-error.hide This field is required.
+ %label.label-light Value
+ %input.form-control{:name => "schedule[variables_attributes][#{i}][value]", :type => "text"}/
+ %p.gl-field-error.hide This field is required.
+ - else
+ - (0..0).each do |i|
+ .form-group
+ .col-md-9
+ %label.label-light Key
+ %input.form-control{:name => "schedule[variables_attributes][#{i}][key]", :type => "text"}/
+ %p.gl-field-error.hide This field is required.
+ %label.label-light Value
+ %input.form-control{:name => "schedule[variables_attributes][#{i}][value]", :type => "text"}/
+ %p.gl-field-error.hide This field is required.
.form-group
.col-md-9
%label.label-light