summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-19 23:53:19 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-19 23:56:21 +0100
commit34295036e2a9ecf18ca5440a5dd6dbb0c7f05643 (patch)
treea529cbc332882305520c7650cbe860301e12abb8 /app/views
parent921f411a41d92ff6b3fdea2560adbd861d97be57 (diff)
downloadgitlab-ce-34295036e2a9ecf18ca5440a5dd6dbb0c7f05643.tar.gz
Improve sources
- Add proper error handling, - Use flash[:alert] and flash[:notice], - Use `resource` instead of `resources`,
Diffstat (limited to 'app/views')
-rw-r--r--app/views/projects/mattermosts/_no_teams.html.haml (renamed from app/views/projects/mattermost/_no_teams.html.haml)0
-rw-r--r--app/views/projects/mattermosts/_team_selection.html.haml (renamed from app/views/projects/mattermost/_team_selection.html.haml)10
-rw-r--r--app/views/projects/mattermosts/new.html.haml (renamed from app/views/projects/mattermost/new.html.haml)0
-rw-r--r--app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml27
4 files changed, 17 insertions, 20 deletions
diff --git a/app/views/projects/mattermost/_no_teams.html.haml b/app/views/projects/mattermosts/_no_teams.html.haml
index 605c7f61dee..605c7f61dee 100644
--- a/app/views/projects/mattermost/_no_teams.html.haml
+++ b/app/views/projects/mattermosts/_no_teams.html.haml
diff --git a/app/views/projects/mattermost/_team_selection.html.haml b/app/views/projects/mattermosts/_team_selection.html.haml
index e0ab63dbc5d..376592e66c9 100644
--- a/app/views/projects/mattermost/_team_selection.html.haml
+++ b/app/views/projects/mattermosts/_team_selection.html.haml
@@ -1,14 +1,14 @@
%p
This service will be installed on the Mattermost instance at
- %strong= Gitlab.config.mattermost.host
+ %strong= link_to Gitlab.config.mattermost.host, Gitlab.config.mattermost.host
%hr
-= form_for(:create, method: :post, url: configure_namespace_project_mattermost_index_path(@project.namespace, @project)) do |f|
+= form_for(:mattermost, method: :post, url: namespace_project_mattermost_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)
- = f.select(:team_id, options, {}, { class: 'form-control', selected: "#{options.first[1] if options.count.one?}", disabled: options.count.one? })
+ - selected_id = @teams.keys.first if @teams.one?
+ = f.select(:team_id, mattermost_teams_options(@teams), {}, { class: 'form-control', selected: "#{selected_id}", disabled: @teams.one? })
.help-block
- - if options.count.one?
+ - if @teams.one?
This is the only team where you are an administrator.
- else
The list shows teams where you are administrator
diff --git a/app/views/projects/mattermost/new.html.haml b/app/views/projects/mattermosts/new.html.haml
index 96b1d2aee61..96b1d2aee61 100644
--- a/app/views/projects/mattermost/new.html.haml
+++ b/app/views/projects/mattermosts/new.html.haml
diff --git a/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml b/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml
index abc68e955e7..e6fcb09e054 100644
--- a/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml
+++ b/app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml
@@ -5,18 +5,15 @@
.row
%strong.col-sm-3.text-right Mattermost
= link_to pretty_url(Gitlab.config.mattermost.host), Gitlab.config.mattermost.host, class: 'col-sm-9', target: '__blank'
- .row
- %strong.col-sm-3.text-right Installation
- .col-sm-9
- - if @service.activated?
- To edit or uninstall this service, press
- %strong Edit in Mattermost
- - else
- To install this service, press
- %strong Add to Mattermost
- and follow the instructions
- .row
- .col-sm-9.col-sm-offset-3
- = link_to new_namespace_project_mattermost_path(@project.namespace, @project), class: 'btn btn-lg' do
- = custom_icon('mattermost_logo', size: 15)
- = @service.activated? ? 'Edit in Mattermost' : 'Add to Mattermost'
+ - unless @service.activated?
+ .row
+ %strong.col-sm-3.text-right Installation
+ .col-sm-9
+ To install this service, press
+ %strong Add to Mattermost
+ and follow the instructions
+ .row
+ .col-sm-9.col-sm-offset-3
+ = link_to new_namespace_project_mattermost_path(@project.namespace, @project), class: 'btn btn-lg' do
+ = custom_icon('mattermost_logo', size: 15)
+ = 'Add to Mattermost'