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