diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-07-06 17:52:00 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-07-19 20:57:59 -0300 |
commit | 8bd520d70e035cd67d19b7962911ae9c31d1ff3d (patch) | |
tree | dd3e8bf4925f36758825879857a54b7d5e94a638 /app/views/projects | |
parent | b9ed9d658ad447a64d58b2040849a7cc0e698287 (diff) | |
download | gitlab-ce-8bd520d70e035cd67d19b7962911ae9c31d1ff3d.tar.gz |
Allow slack service to send messages on different channels
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/services/_form.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/services/slack/_service_settings.html.haml | 34 |
2 files changed, 39 insertions, 1 deletions
diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index 166dc4a01fc..abad7954db5 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -7,7 +7,11 @@ %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| - = render 'shared/service_settings', form: form + - if @service.is_a?(SlackService) + = render 'projects/services/slack/service_settings', form: form + - else + = render 'shared/service_settings', form: form + = form.submit 'Save changes', class: 'btn btn-save' - if @service.valid? && @service.activated? diff --git a/app/views/projects/services/slack/_service_settings.html.haml b/app/views/projects/services/slack/_service_settings.html.haml new file mode 100644 index 00000000000..12f4c2e45b9 --- /dev/null +++ b/app/views/projects/services/slack/_service_settings.html.haml @@ -0,0 +1,34 @@ += 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 |