Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-02-07 10:24:57 +0300
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-02-16 11:19:28 +0300
commit8ddbc43576c1cebd652d6f3541574f0176794510 (patch)
tree3dfe430f289db8a461220d26f19689013471d363 /app/views
parentb4244efaf1ab955e5900e87c3ec4e9465ba38bff (diff)
Improve DRYness of views
Diffstat (limited to 'app/views')
-rw-r--r--app/views/groups/_create_chat_team.html.haml18
-rw-r--r--app/views/groups/edit.html.haml20
-rw-r--r--app/views/groups/new.html.haml17
3 files changed, 20 insertions, 35 deletions
diff --git a/app/views/groups/_create_chat_team.html.haml b/app/views/groups/_create_chat_team.html.haml
new file mode 100644
index 00000000000..b2b5a2090f9
--- /dev/null
+++ b/app/views/groups/_create_chat_team.html.haml
@@ -0,0 +1,18 @@
+.form-group
+ = f.label :name, class: 'control-label' do
+ %span.mattermost-icon
+ = custom_icon('icon_mattermost')
+ Mattermost
+ .col-sm-10
+ .checkbox
+ = f.label :name do
+ = f.check_box :create_chat_team, checked: true
+ Link the group to a new Mattermost team
+
+.form-group
+ = f.label :chat_team, class: 'control-label' do
+ Chat Team name
+ .col-sm-10
+ = f.text_field :chat_team, placeholder: @group.name, class: 'form-control mattermost-team-name'
+ Leave blank to match your group name
+
diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml
index 38d498f0343..c904b25fe94 100644
--- a/app/views/groups/edit.html.haml
+++ b/app/views/groups/edit.html.haml
@@ -22,25 +22,7 @@
= render 'shared/visibility_level', f: f, visibility_level: @group.visibility_level, can_change_visibility_level: can_change_group_visibility_level?(@group), form_model: @group
- .form-group
- = f.label :name, class: 'control-label' do
- %span.mattermost-icon
- = custom_icon('icon_mattermost')
- Mattermost
- .col-sm-10
- .checkbox
- = f.label :name do
- = f.check_box :name, checked: true
- Link the group to a new or existing Mattermost team
-
-
- - enabled = Gitlab.config.mattermost.enabled
- - if enabled
- .form-group
- .col-sm-offset-2.col-sm-10
- = f.text_field :name, placeholder: "FILL WITH TEAM NAME", class: 'form-control mattermost-team-name'
- %span.mattermost-info
- Team URL: INSERT TEAM URL
+ = render 'create_chat_team', f: f if Gitlab.config.mattermost.enabled
.form-group
.col-sm-offset-2.col-sm-10
diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml
index 723071c7633..000c7af2326 100644
--- a/app/views/groups/new.html.haml
+++ b/app/views/groups/new.html.haml
@@ -16,22 +16,7 @@
= render 'shared/visibility_level', f: f, visibility_level: default_group_visibility, can_change_visibility_level: true, form_model: @group
- .form-group
- = f.label :create_chat_team, class: 'control-label' do
- %span.mattermost-icon
- = custom_icon('icon_mattermost')
- Mattermost
- .col-sm-10
- .checkbox
- = f.label :chat_team do
- = f.check_box :chat_team
- Link the group to a new or existing Mattermost team
-
-- enabled = Gitlab.config.mattermost.enabled
-- if enabled
- .form-group
- .col-sm-offset-2.col-sm-10
- = f.text_field :name, placeholder: 'Mattermost team name', class: 'form-control mattermost-team-name'
+ = render 'create_chat_team', f: f if Gitlab.config.mattermost.enabled
.form-group
.col-sm-offset-2.col-sm-10