Fix Slash command templates

These templates were broken, as the same views didn't have a @project
defined. Now I've added checks on the service being a template or not.

Fixes #26042
This commit is contained in:
Z.J. van de Weg 2016-12-27 10:32:50 +01:00
parent 365612ce36
commit b46ad4c90b
2 changed files with 75 additions and 73 deletions

View file

@ -8,8 +8,8 @@
by entering
%code /<command_trigger_word> help
- unless enabled
- unless enabled || @service.template?
= render 'projects/services/mattermost_slash_commands/detailed_help', subject: @service
- if enabled
- if enabled && !@service.template?
= render 'projects/services/mattermost_slash_commands/installation_info', subject: @service

View file

@ -1,4 +1,5 @@
- run_actions_text = "Perform common operations on this project: #{@project.name_with_namespace}"
- pretty_name = defined?(@project) ? @project.path_with_namespace : "namespace / path"
- run_actions_text = "Perform common operations on this project: #{pretty_name}"
.well
This service allows GitLab users to perform common operations on this
@ -9,6 +10,7 @@
%code /<command> help
%br
%br
- unless @service.template?
To setup this service:
%ul.list-unstyled
%li