diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-07-13 22:49:47 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-07-20 18:11:37 +0300 |
commit | 323d796a0e7b5f1ef5a170f9918897f6a2d4121e (patch) | |
tree | 73a2939ff4a647e00c251171f3c8094acba355e0 /app/views/projects/services | |
parent | ede048b930b2ceb89013793d878524eb20248d1f (diff) |
Refactor service settings view
Diffstat (limited to 'app/views/projects/services')
-rw-r--r-- | app/views/projects/services/_form.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/services/slack/_service_settings.html.haml | 34 |
2 files changed, 1 insertions, 38 deletions
diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index abad7954db5..752fbc21a11 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -7,10 +7,7 @@ %p= @service.description .col-lg-9 = form_for(@service, as: :service, url: namespace_project_service_path(@project.namespace, @project, @service.to_param), method: :put, html: { class: 'form-horizontal' }) do |form| - - if @service.is_a?(SlackService) - = render 'projects/services/slack/service_settings', form: form - - else - = render 'shared/service_settings', form: form + = render 'shared/service_settings', form: form = form.submit 'Save changes', class: 'btn btn-save' diff --git a/app/views/projects/services/slack/_service_settings.html.haml b/app/views/projects/services/slack/_service_settings.html.haml deleted file mode 100644 index 12f4c2e45b9..00000000000 --- a/app/views/projects/services/slack/_service_settings.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -= form_errors(@service) - -- if @service.help.present? - .well - = preserve do - = markdown @service.help - -.form-group - = form.label :active, "Active", class: "control-label" - .col-sm-10 - = form.check_box :active - -.form-group - = form.label :url, "Trigger", class: 'control-label' - - .col-sm-10 - - @service.supported_events.each do |event| - %div - = form.check_box service_event_field_name(event), class: 'pull-left' - .prepend-left-20 - = form.label service_event_field_name(event), class: 'list-label' do - %strong - = event.humanize - - %p - - field = @service.fields.select{ |field| field[:name] == "#{event}_channel"}.first - = form.text_field field[:name], class: "form-control", placeholder: field[:placeholder] - - %p.light - = service_event_description(event) - -- @service.fields.each do |field| - - if %w(webhook username notify_only_broken_builds).include?(field[:name]) - = render 'shared/field', form: form, field: field |