diff options
author | kushalpandya <kushal@gitlab.com> | 2017-10-05 17:23:57 +0300 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-10-05 17:23:57 +0300 |
commit | da5073cc15935a953870d5932468c94f79d31a0b (patch) | |
tree | 46cea77354b9f5135588073ed69fc97a27212280 /app/views/groups/show.html.haml | |
parent | 29fee00225347daff7f87ea166c82db141472ea3 (diff) |
Render droplab button only if Subgroups feature is supported
Diffstat (limited to 'app/views/groups/show.html.haml')
-rw-r--r-- | app/views/groups/show.html.haml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 73c1cb9ce87..75f7473d1ef 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -15,20 +15,19 @@ - if can? current_user, :create_projects, @group - new_project_label = _("New project") - new_subgroup_label = _("New subgroup") - .btn-group.new-project-subgroup.droplab-dropdown.js-new-project-subgroup{ data: { project_path: new_project_path(namespace_id: @group.id), subgroup_path: new_group_path(parent_id: @group.id) } } - %input.btn.btn-success.dropdown-primary.js-new-group-child{ type: "button", value: new_project_label, data: { action: "new-project" } } - - if can_create_subgroups + - if can_create_subgroups + .btn-group.new-project-subgroup.droplab-dropdown.js-new-project-subgroup{ data: { project_path: new_project_path(namespace_id: @group.id), subgroup_path: new_group_path(parent_id: @group.id) } } + %input.btn.btn-success.dropdown-primary.js-new-group-child{ type: "button", value: new_project_label, data: { action: "new-project" } } %button.btn.btn-success.dropdown-toggle.js-dropdown-toggle{ type: "button", data: { "dropdown-trigger" => "#new-project-or-subgroup-dropdown" } } = icon("caret-down", class: "dropdown-btn-icon") - %ul#new-project-or-subgroup-dropdown.dropdown-menu.dropdown-menu-align-right{ data: { dropdown: true } } - %li.droplab-item-selected{ role: "button", data: { value: "new-project", text: new_project_label } } - .menu-item - .icon-container - = icon("check", class: "list-item-checkmark") - .description - %strong= new_project_label - %span= s_("GroupsTree|Create project under this group.") - - if can_create_subgroups + %ul#new-project-or-subgroup-dropdown.dropdown-menu.dropdown-menu-align-right{ data: { dropdown: true } } + %li.droplab-item-selected{ role: "button", data: { value: "new-project", text: new_project_label } } + .menu-item + .icon-container + = icon("check", class: "list-item-checkmark") + .description + %strong= new_project_label + %span= s_("GroupsTree|Create project under this group.") %li.divider.droplap-item-ignore %li{ role: "button", data: { value: "new-subgroup", text: new_subgroup_label } } .menu-item @@ -37,6 +36,8 @@ .description %strong= new_subgroup_label %span= s_("GroupsTree|Create a subgroup under this group.") + - else + = link_to new_project_label, new_project_path(namespace_id: @group.id), class: "btn btn-success" - if params[:filter].blank? && @children.empty? = render "shared/groups/empty_state" |