diff options
Diffstat (limited to 'app/views/shared/integrations/slack_slash_commands/_help.html.haml')
-rw-r--r-- | app/views/shared/integrations/slack_slash_commands/_help.html.haml | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/app/views/shared/integrations/slack_slash_commands/_help.html.haml b/app/views/shared/integrations/slack_slash_commands/_help.html.haml new file mode 100644 index 00000000000..fee0ca15808 --- /dev/null +++ b/app/views/shared/integrations/slack_slash_commands/_help.html.haml @@ -0,0 +1,93 @@ +- pretty_name = @project&.full_name ? html_escape(@project&.full_name) : '<' + _('project name') + '>' +- run_actions_text = html_escape_once(s_("ProjectService|Perform common operations on GitLab project: %{project_name}") % { project_name: pretty_name }) + +.info-well + .well-segment + %p + = s_("SlackService|Perform common operations in this project by entering slash commands in Slack.") + = link_to help_page_path('user/project/integrations/slack_slash_commands.md'), target: '_blank' do + = _("Learn more.") + = sprite_icon('external-link') + %p.inline + = s_("SlackService|After setup, get a list of available Slack slash commands by entering") + %kbd.inline /<command> help + - if integration.project_level? + %p= _("To set up this integration:") + %ul.list-unstyled.indent-list + %li + - slash_command_link_url = 'https://my.slack.com/services/new/slash-commands' + - slash_command_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: slash_command_link_url } + - slash_command_link_end = ' %{external_link_icon}</a>'.html_safe % { external_link_icon: sprite_icon('external-link') } + = html_escape(s_('SlackService|1. %{slash_command_link_start}Add a slash command%{slash_command_link_end} in your Slack team using this information:')) % { slash_command_link_start: slash_command_link_start, slash_command_link_end: slash_command_link_end } + + %hr + + .help-form + .form-group + = label_tag nil, _('Command'), class: 'col-12 col-form-label label-bold' + .col-12 + %p= s_('SlackService|Fill in the word that works best for your team.') + %p + = _("Suggestions:") + %code= 'gitlab' + %code= 'project' + - if @project + %code= @project.path # Path contains no spaces, but dashes + %code= @project.full_path + + .form-group + = label_tag :url, 'URL', class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :url, service_trigger_url(integration), class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#url', class: 'input-group-text') + + .form-group + = label_tag nil, _('Method'), class: 'col-12 col-form-label label-bold' + .col-12 POST + + .form-group + = label_tag :customize_name, _('Customize name'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :customize_name, 'GitLab', class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#customize_name', class: 'input-group-text') + + .form-group + = label_tag nil, _('Customize icon'), class: 'col-12 col-form-label label-bold' + .col-12 + = image_tag(asset_url('slash-command-logo.png', skip_pipeline: true), width: 36, height: 36, class: 'mr-3') + = link_to(_('Download image'), asset_url('gitlab_logo.png'), class: 'gl-button btn btn-default btn-sm', target: '_blank', rel: 'noopener noreferrer') + + .form-group + = label_tag nil, _('Autocomplete'), class: 'col-12 col-form-label label-bold' + .col-12 Show this command in the autocomplete list + + .form-group + = label_tag :autocomplete_description, _('Autocomplete description'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :autocomplete_description, run_actions_text.html_safe, class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#autocomplete_description', class: 'input-group-text') + + .form-group + = label_tag :autocomplete_usage_hint, _('Autocomplete usage hint'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :autocomplete_usage_hint, '[help]', class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#autocomplete_usage_hint', class: 'input-group-text') + + .form-group + = label_tag :descriptive_label, _('Descriptive label'), class: 'col-12 col-form-label label-bold' + .col-12.input-group + = text_field_tag :descriptive_label, _('Perform common operations on GitLab project'), class: 'form-control form-control-sm', readonly: 'readonly' + .input-group-append + = clipboard_button(target: '#descriptive_label', class: 'input-group-text') + + %hr + + %ul.list-unstyled.indent-list + %li + = html_escape(s_("SlackService|2. Paste the token from Slack in the %{strong_open}Token%{strong_close} field below.")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } + %li + = html_escape(s_("SlackService|3. Select the %{strong_open}Active%{strong_close} checkbox, select %{strong_open}Save changes%{strong_close}, and start using slash commands in Slack!")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } |