Commit db66af4b authored by Sam Beckham's avatar Sam Beckham Committed by Clement Ho

Resolve "Admin area > Styling of service template page"

parent 71ae1bb2
...@@ -7,5 +7,4 @@ ...@@ -7,5 +7,4 @@
= render 'shared/service_settings', form: form, subject: @service = render 'shared/service_settings', form: form, subject: @service
.footer-block.row-content-block .footer-block.row-content-block
.form-actions = form.submit 'Save', class: 'btn btn-save'
= form.submit 'Save', class: 'btn btn-save'
- enabled = Gitlab.config.mattermost.enabled - enabled = Gitlab.config.mattermost.enabled
.card .info-well
%p .well-segment
This service allows users to perform common operations on this %p
project by entering slash commands in Mattermost. This service allows users to perform common operations on this
= link_to help_page_path('user/project/integrations/mattermost_slash_commands.md'), target: '_blank' do project by entering slash commands in Mattermost.
View documentation = link_to help_page_path('user/project/integrations/mattermost_slash_commands.md'), target: '_blank' do
= icon('external-link') View documentation
%p.inline = icon('external-link')
See list of available commands in Mattermost after setting up this service, %p.inline
by entering See list of available commands in Mattermost after setting up this service,
%kbd.inline /<trigger> help by entering
- unless enabled || @service.template? %kbd.inline /<trigger> help
= render 'projects/services/mattermost_slash_commands/detailed_help', subject: @service - unless enabled || @service.template?
= render 'projects/services/mattermost_slash_commands/detailed_help', subject: @service
- if enabled && !@service.template? - if enabled && !@service.template?
= render 'projects/services/mattermost_slash_commands/installation_info', subject: @service = render 'projects/services/mattermost_slash_commands/installation_info', subject: @service
- pretty_name = defined?(@project) ? @project.full_name : 'namespace / path' - pretty_name = defined?(@project) ? @project.full_name : 'namespace / path'
- run_actions_text = "Perform common operations on GitLab project: #{pretty_name}" - run_actions_text = "Perform common operations on GitLab project: #{pretty_name}"
.card .info-well
%p .well-segment
This service allows users to perform common operations on this %p
project by entering slash commands in Slack. This service allows users to perform common operations on this
= link_to help_page_path('user/project/integrations/slack_slash_commands.md'), target: '_blank' do project by entering slash commands in Slack.
View documentation = link_to help_page_path('user/project/integrations/slack_slash_commands.md'), target: '_blank' do
= icon('external-link') View documentation
%p.inline = icon('external-link')
See list of available commands in Slack after setting up this service, %p.inline
by entering See list of available commands in Slack after setting up this service,
%kbd.inline /<command> help by entering
- unless @service.template? %kbd.inline /<command> help
%p To setup this service: - unless @service.template?
%ul.list-unstyled.indent-list %p To setup this service:
%li %ul.list-unstyled.indent-list
1. %li
= link_to 'https://my.slack.com/services/new/slash-commands', target: '_blank', rel: 'noreferrer noopener nofollow' do 1.
Add a slash command = link_to 'https://my.slack.com/services/new/slash-commands', target: '_blank', rel: 'noreferrer noopener nofollow' do
= icon('external-link') Add a slash command
in your Slack team with these options: = icon('external-link')
in your Slack team with these options:
%hr %hr
.help-form .help-form
.form-group .form-group
= label_tag nil, 'Command', class: 'col-sm-2 col-12 col-form-label' = label_tag nil, 'Command', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.text-block .col-sm-10.col-12.text-block
%p Fill in the word that works best for your team. %p Fill in the word that works best for your team.
%p %p
Suggestions: Suggestions:
%code= 'gitlab' %code= 'gitlab'
%code= @project.path # Path contains no spaces, but dashes %code= @project.path # Path contains no spaces, but dashes
%code= @project.full_path %code= @project.full_path
.form-group .form-group
= label_tag :url, 'URL', class: 'col-sm-2 col-12 col-form-label' = label_tag :url, 'URL', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.input-group .col-sm-10.col-12.input-group
= text_field_tag :url, service_trigger_url(subject), class: 'form-control form-control-sm', readonly: 'readonly' = text_field_tag :url, service_trigger_url(subject), class: 'form-control form-control-sm', readonly: 'readonly'
.input-group-append .input-group-append
= clipboard_button(target: '#url', class: 'input-group-text') = clipboard_button(target: '#url', class: 'input-group-text')
.form-group .form-group
= label_tag nil, 'Method', class: 'col-sm-2 col-12 col-form-label' = label_tag nil, 'Method', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.text-block POST .col-sm-10.col-12.text-block POST
.form-group .form-group
= label_tag :customize_name, 'Customize name', class: 'col-sm-2 col-12 col-form-label' = label_tag :customize_name, 'Customize name', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.input-group .col-sm-10.col-12.input-group
= text_field_tag :customize_name, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly' = text_field_tag :customize_name, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly'
.input-group-append .input-group-append
= clipboard_button(target: '#customize_name', class: 'input-group-text') = clipboard_button(target: '#customize_name', class: 'input-group-text')
.form-group .form-group
= label_tag nil, 'Customize icon', class: 'col-sm-2 col-12 col-form-label' = label_tag nil, 'Customize icon', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.text-block .col-sm-10.col-12.text-block
= image_tag(asset_url('slash-command-logo.png'), width: 36, height: 36) = image_tag(asset_url('slash-command-logo.png'), width: 36, height: 36)
= link_to('Download image', asset_url('gitlab_logo.png'), class: 'btn btn-sm', target: '_blank', rel: 'noopener noreferrer') = link_to('Download image', asset_url('gitlab_logo.png'), class: 'btn btn-sm', target: '_blank', rel: 'noopener noreferrer')
.form-group .form-group
= label_tag nil, 'Autocomplete', class: 'col-sm-2 col-12 col-form-label' = label_tag nil, 'Autocomplete', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.text-block Show this command in the autocomplete list .col-sm-10.col-12.text-block Show this command in the autocomplete list
.form-group .form-group
= label_tag :autocomplete_description, 'Autocomplete description', class: 'col-sm-2 col-12 col-form-label' = label_tag :autocomplete_description, 'Autocomplete description', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.input-group .col-sm-10.col-12.input-group
= text_field_tag :autocomplete_description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly' = text_field_tag :autocomplete_description, run_actions_text, class: 'form-control form-control-sm', readonly: 'readonly'
.input-group-append .input-group-append
= clipboard_button(target: '#autocomplete_description', class: 'input-group-text') = clipboard_button(target: '#autocomplete_description', class: 'input-group-text')
.form-group .form-group
= label_tag :autocomplete_usage_hint, 'Autocomplete usage hint', class: 'col-sm-2 col-12 col-form-label' = label_tag :autocomplete_usage_hint, 'Autocomplete usage hint', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.input-group .col-sm-10.col-12.input-group
= text_field_tag :autocomplete_usage_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly' = text_field_tag :autocomplete_usage_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly'
.input-group-append .input-group-append
= clipboard_button(target: '#autocomplete_usage_hint', class: 'input-group-text') = clipboard_button(target: '#autocomplete_usage_hint', class: 'input-group-text')
.form-group .form-group
= label_tag :descriptive_label, 'Descriptive label', class: 'col-sm-2 col-12 col-form-label' = label_tag :descriptive_label, 'Descriptive label', class: 'col-sm-2 col-12 col-form-label'
.col-sm-10.col-12.input-group .col-sm-10.col-12.input-group
= text_field_tag :descriptive_label, 'Perform common operations on GitLab project', class: 'form-control form-control-sm', readonly: 'readonly' = text_field_tag :descriptive_label, 'Perform common operations on GitLab project', class: 'form-control form-control-sm', readonly: 'readonly'
.input-group-append .input-group-append
= clipboard_button(target: '#descriptive_label', class: 'input-group-text') = clipboard_button(target: '#descriptive_label', class: 'input-group-text')
%hr %hr
%ul.list-unstyled.indent-list %ul.list-unstyled.indent-list
%li %li
2. Paste the 2. Paste the
%strong Token %strong Token
into the field below into the field below
%li %li
3. Select the 3. Select the
%strong Active %strong Active
checkbox, press checkbox, press
%strong Save changes %strong Save changes
and start using GitLab inside Slack! and start using GitLab inside Slack!
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
- help = field[:help] - help = field[:help]
- disabled = disable_fields_service?(@service) - disabled = disable_fields_service?(@service)
.form-group .form-group.row
- if type == "password" && value.present? - if type == "password" && value.present?
= form.label name, "Enter new #{title.downcase}", class: "col-form-label" = form.label name, "Enter new #{title.downcase}", class: "col-form-label col-sm-2"
- else - else
= form.label name, title, class: "col-form-label" = form.label name, title, class: "col-form-label col-sm-2"
.col-sm-10 .col-sm-10
- if type == 'text' - if type == 'text'
= form.text_field name, class: "form-control", placeholder: placeholder, required: required, disabled: disabled = form.text_field name, class: "form-control", placeholder: placeholder, required: required, disabled: disabled
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
- if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true) - if lookup_context.template_exists?('help', "projects/services/#{@service.to_param}", true)
= render "projects/services/#{@service.to_param}/help", subject: subject = render "projects/services/#{@service.to_param}/help", subject: subject
- elsif @service.help.present? - elsif @service.help.present?
.card .info-well
= markdown @service.help .well-segment
= markdown @service.help
.service-settings .service-settings
- if @service.show_active_box? - if @service.show_active_box?
...@@ -15,25 +16,24 @@ ...@@ -15,25 +16,24 @@
- if @service.configurable_events.present? - if @service.configurable_events.present?
.form-group.row .form-group.row
= form.label :url, "Trigger", class: 'col-form-label col-sm-2' .col-sm-2.text-right Trigger
.col-sm-10 .col-sm-10
- @service.configurable_events.each do |event| - @service.configurable_events.each do |event|
%div .form-group
= form.check_box service_event_field_name(event), class: 'float-left' .form-check
.prepend-left-20 = form.check_box service_event_field_name(event), class: 'form-check-input'
= form.label service_event_field_name(event), class: 'list-label' do = form.label service_event_field_name(event), class: 'form-check-label' do
%strong %strong
= event.humanize = event.humanize
- field = @service.event_field(event) - field = @service.event_field(event)
- if field - if field
%p
= form.text_field field[:name], class: "form-control", placeholder: field[:placeholder] = form.text_field field[:name], class: "form-control", placeholder: field[:placeholder]
%p.light %p.text-muted
= @service.class.event_description(event) = @service.class.event_description(event)
- @service.global_fields.each do |field| - @service.global_fields.each do |field|
- type = field[:type] - type = field[:type]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment