2015-09-25 12:07:36 +05:30
|
|
|
%h3.page-title
|
|
|
|
= @service.title
|
|
|
|
= boolean_to_icon @service.activated?
|
|
|
|
|
|
|
|
%p= @service.description
|
|
|
|
|
|
|
|
|
|
|
|
%hr
|
|
|
|
|
2015-10-24 18:46:33 +05:30
|
|
|
= form_for(@service, as: :service, url: namespace_project_ci_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'form-horizontal' }) do |f|
|
2015-09-25 12:07:36 +05:30
|
|
|
- if @service.errors.any?
|
|
|
|
.alert.alert-danger
|
|
|
|
%ul
|
|
|
|
- @service.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
|
|
|
|
|
|
|
- if @service.help.present?
|
|
|
|
.bs-callout
|
|
|
|
= @service.help
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label :active, "Active", class: "control-label"
|
|
|
|
.col-sm-10
|
|
|
|
= f.check_box :active
|
|
|
|
|
|
|
|
- @service.fields.each do |field|
|
|
|
|
- name = field[:name]
|
|
|
|
- label = field[:label] || name
|
|
|
|
- value = @service.send(name)
|
|
|
|
- type = field[:type]
|
|
|
|
- placeholder = field[:placeholder]
|
|
|
|
- choices = field[:choices]
|
|
|
|
- default_choice = field[:default_choice]
|
|
|
|
- help = field[:help]
|
|
|
|
|
|
|
|
.form-group
|
|
|
|
= f.label label, class: "control-label"
|
|
|
|
.col-sm-10
|
|
|
|
- if type == 'text'
|
|
|
|
= f.text_field name, class: "form-control", placeholder: placeholder
|
|
|
|
- elsif type == 'textarea'
|
|
|
|
= f.text_area name, rows: 5, class: "form-control", placeholder: placeholder
|
|
|
|
- elsif type == 'checkbox'
|
|
|
|
= f.check_box name
|
|
|
|
- elsif type == 'select'
|
|
|
|
= f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
|
|
|
|
- if help
|
|
|
|
.light #{help}
|
|
|
|
|
|
|
|
.form-actions
|
|
|
|
= f.submit 'Save', class: 'btn btn-save'
|
|
|
|
|
|
|
|
- if @service.valid? && @service.activated? && @service.can_test?
|
2015-10-24 18:46:33 +05:30
|
|
|
= link_to 'Test settings', test_namespace_project_ci_service_path(@project.namespace, @project, @service.to_param), class: 'btn'
|