summaryrefslogtreecommitdiff
path: root/app/views/projects/services/mattermost_slash_commands/_detailed_help.html.haml
blob: 3a323d94cc2e70daa3ae90b168d577cdd9f4c145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- run_actions_text = "Perform common operations on GitLab project: #{@project.name_with_namespace}"

%p To setup this service:
%ul.list-unstyled.indent-list
  %li
    1.
    = link_to 'https://docs.mattermost.com/developer/slash-commands.html#enabling-custom-commands', target: '_blank', rel: 'noreferrer noopener nofollow' do
      Enable custom slash commands
      = icon('external-link')
    on your Mattermost installation
  %li
    2.
    = link_to 'https://docs.mattermost.com/developer/slash-commands.html#set-up-a-custom-command', target: '_blank', rel: 'noreferrer noopener nofollow' do
      Add a slash command
      = icon('external-link')
    in your Mattermost team with these options:
%hr

.help-form
  .form-group
    = label_tag :display_name, 'Display name', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :display_name, "GitLab / #{@project.name_with_namespace}", class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#display_name')

  .form-group
    = label_tag :description, 'Description', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :description, run_actions_text, class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#description')

  .form-group
    = label_tag nil, 'Command trigger word', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.text-block
      %p Fill in the word that works best for your team.
      %p
        Suggestions:
        %code= 'gitlab'
        %code= @project.path # Path contains no spaces, but dashes
        %code= @project.path_with_namespace

  .form-group
    = label_tag :request_url, 'Request URL', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :request_url, service_trigger_url(subject), class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#request_url')

  .form-group
    = label_tag nil, 'Request method', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.text-block POST

  .form-group
    = label_tag :response_username, 'Response username', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :response_username, 'GitLab', class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#response_username')

  .form-group
    = label_tag :response_icon, 'Response icon', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :response_icon, asset_url('gitlab_logo.png'), class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#response_icon')

  .form-group
    = label_tag nil, 'Autocomplete', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.text-block Yes

  .form-group
    = label_tag :autocomplete_hint, 'Autocomplete hint', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :autocomplete_hint, '[help]', class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#autocomplete_hint')

  .form-group
    = label_tag :autocomplete_description, 'Autocomplete description', class: 'col-sm-2 col-xs-12 control-label'
    .col-sm-10.col-xs-12.input-group
      = text_field_tag :autocomplete_description, run_actions_text, class: 'form-control input-sm', readonly: 'readonly'
      .input-group-btn
        = clipboard_button(clipboard_target: '#autocomplete_description')

%hr

%ul.list-unstyled.indent-list
  %li
    3. Paste the
    %strong Token
    into the field below
  %li
    4. Select the
    %strong Active
    checkbox, press
    %strong Save changes
    and start using GitLab inside Mattermost!