2013-07-13 05:45:48 +00:00
|
|
|
%h3.page-title
|
2013-05-22 13:58:44 +00:00
|
|
|
= @service.title
|
2013-11-20 12:05:42 +00:00
|
|
|
= boolean_to_icon @service.activated?
|
2013-05-22 13:58:44 +00:00
|
|
|
|
|
|
|
%p= @service.description
|
|
|
|
|
2013-07-13 05:45:48 +00:00
|
|
|
.back-link
|
2015-01-24 18:02:58 +00:00
|
|
|
= link_to namespace_project_services_path(@project.namespace, @project) do
|
2013-05-22 13:58:44 +00:00
|
|
|
← to services
|
|
|
|
|
|
|
|
%hr
|
|
|
|
|
2015-01-24 18:02:58 +00:00
|
|
|
= form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'form-horizontal' }) do |f|
|
2013-05-22 13:58:44 +00:00
|
|
|
- if @service.errors.any?
|
2013-12-31 14:34:14 +00:00
|
|
|
.alert.alert-danger
|
2013-05-22 13:58:44 +00:00
|
|
|
%ul
|
|
|
|
- @service.errors.full_messages.each do |msg|
|
|
|
|
%li= msg
|
|
|
|
|
2014-05-28 09:52:02 +00:00
|
|
|
- if @service.help.present?
|
|
|
|
.bs-callout
|
2014-07-29 15:41:55 +00:00
|
|
|
= preserve do
|
|
|
|
= markdown @service.help
|
2013-05-22 13:58:44 +00:00
|
|
|
|
2013-12-30 23:27:02 +00:00
|
|
|
.form-group
|
2013-05-22 13:58:44 +00:00
|
|
|
= f.label :active, "Active", class: "control-label"
|
2013-12-30 23:27:02 +00:00
|
|
|
.col-sm-10
|
2013-05-22 13:58:44 +00:00
|
|
|
= f.check_box :active
|
|
|
|
|
|
|
|
- @service.fields.each do |field|
|
|
|
|
- name = field[:name]
|
2014-10-16 16:34:19 +00:00
|
|
|
- value = @service.send(name) unless field[:type] == 'password'
|
2013-05-22 13:58:44 +00:00
|
|
|
- type = field[:type]
|
|
|
|
- placeholder = field[:placeholder]
|
2014-10-01 00:48:41 +00:00
|
|
|
- choices = field[:choices]
|
|
|
|
- default_choice = field[:default_choice]
|
2013-05-22 13:58:44 +00:00
|
|
|
|
2013-12-30 23:27:02 +00:00
|
|
|
.form-group
|
2013-05-22 13:58:44 +00:00
|
|
|
= f.label name, class: "control-label"
|
2013-12-30 23:27:02 +00:00
|
|
|
.col-sm-10
|
2013-05-22 13:58:44 +00:00
|
|
|
- if type == 'text'
|
2013-12-31 15:08:31 +00:00
|
|
|
= f.text_field name, class: "form-control", placeholder: placeholder
|
2013-12-17 10:42:13 +00:00
|
|
|
- elsif type == 'textarea'
|
2013-12-31 15:08:31 +00:00
|
|
|
= f.text_area name, rows: 5, class: "form-control", placeholder: placeholder
|
2013-05-22 13:58:44 +00:00
|
|
|
- elsif type == 'checkbox'
|
|
|
|
= f.check_box name
|
2014-10-01 00:48:41 +00:00
|
|
|
- elsif type == 'select'
|
|
|
|
= f.select name, options_for_select(choices, value ? value : default_choice), {}, { class: "form-control" }
|
2014-10-16 16:34:19 +00:00
|
|
|
- elsif type == 'password'
|
|
|
|
= f.password_field name, class: 'form-control'
|
2013-05-22 13:58:44 +00:00
|
|
|
|
|
|
|
.form-actions
|
|
|
|
= f.submit 'Save', class: 'btn btn-save'
|
|
|
|
|
2013-08-09 18:14:02 +00:00
|
|
|
- if @service.valid? && @service.activated? && @service.can_test?
|
2015-01-24 18:02:58 +00:00
|
|
|
= link_to 'Test settings', test_namespace_project_service_path(@project.namespace, @project, @service.to_param), class: 'btn'
|