summaryrefslogtreecommitdiff
path: root/app/views/projects/mattermost/new.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/mattermost/new.html.haml')
-rw-r--r--app/views/projects/mattermost/new.html.haml54
1 files changed, 3 insertions, 51 deletions
diff --git a/app/views/projects/mattermost/new.html.haml b/app/views/projects/mattermost/new.html.haml
index 6a5c9df543d..96b1d2aee61 100644
--- a/app/views/projects/mattermost/new.html.haml
+++ b/app/views/projects/mattermost/new.html.haml
@@ -1,56 +1,8 @@
-- twoTeams = [{"id"=>"w59qt5a817f69jkxdz6xe7y4ir", "create_at"=>1481835484179, "update_at"=>1481835484179, "delete_at"=>0, "display_name"=>"new_team", "name"=>"new-team", "email"=>"", "type"=>"O", "company_name"=>"", "allowed_domains"=>"", "invite_id"=>"mfgsqnmpiby18eepo6jd6pq3oh", "allow_open_invite"=>false}, {"id"=>"my9oujxf5jy1zqdgu9rihd66do", "create_at"=>1481826062406, "update_at"=>1481826062406, "delete_at"=>0, "display_name"=>"chatops", "name"=>"chatops", "email"=>"", "type"=>"O", "company_name"=>"", "allowed_domains"=>"", "invite_id"=>"s7c1phenmi8udkybcyytc3pxuh", "allow_open_invite"=>false}]
-- oneTeams = [{"id"=>"w59qt5a817f69jkxdz6xe7y4ir", "create_at"=>1481835484179, "update_at"=>1481835484179, "delete_at"=>0, "display_name"=>"new_team", "name"=>"new-team", "email"=>"", "type"=>"O", "company_name"=>"", "allowed_domains"=>"", "invite_id"=>"mfgsqnmpiby18eepo6jd6pq3oh", "allow_open_invite"=>false}]
-- noTeams = []
-- teams = twoTeams
-
.service-installation
.inline.pull-right
= custom_icon('mattermost_logo', size: 48)
%h3 Install Mattermost Command
- - if teams.count === 0
- %p
- To install this service, you must be administrator of a team in the Mattermost instance at
- %strong some_path.url
- %p Ask your Mattermost system administrator for permissions.
- %hr
- .clearfix
- = link_to 'Go back', 'some_url', class: 'btn btn-lg pull-right'
+ - if @teams.empty?
+ = render 'no_teams'
- else
- %p
- This service will be installed on the Mattermost instance at
- %strong some_path.url
- %hr
- = form_for(:create, method: :post, url: configure_namespace_project_mattermost_index_path(@project.namespace, @project, )) do |f|
- %h4 Team
- %p Select or create the team where the slash commands will be used in
- - options = mattermost_teams_options(teams)
- - isOneTeam = options.count === 1
- = f.select(:team_id, options, {}, {class: 'form-control', selected: "#{options.first[1] if isOneTeam}", disabled: isOneTeam})
- - if isOneTeam
- .help-block
- This is the only team where you are an administrator.
- To create a team, ask your Mattermost system administrator.
- - else
- .help-block
- The list shows teams where you are administrator
- To create a team, ask your Mattermost system administrator.
- %hr
- %h4 Command trigger word
- %p Choose the word that will trigger commands
- = f.text_field(:trigger, value: @project.path, class: 'form-control')
- .help-block
- %p Trigger word must be unique, and cannot begin with a slash or contain any spaces. Use the word that works best for your team.
- %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
- %p
- Reserved:
- = link_to 'see list of built-in slash commands', 'some_url'
- %hr
- .clearfix
- .pull-right
- = link_to 'Cancel', 'some_url', class: 'btn btn-lg'
- = f.submit 'Install', class: 'btn btn-save btn-lg'
+ = render 'team_selection'