diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-05 15:23:01 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-05 15:23:01 +0300 |
commit | 4e88ca12060df0c6e73a1eed74d6a7f6e42d7b58 (patch) | |
tree | aa78d1c70415af2ab0a33ec6790b7217f7ecf9d0 /app/views/groups/show.html.haml | |
parent | 17dccc35ca4754405b87c87f81daec34e02ea7a1 (diff) |
Hide "New subgroup" links when subgroups are not supported
Diffstat (limited to 'app/views/groups/show.html.haml')
-rw-r--r-- | app/views/groups/show.html.haml | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index c6e5e16e239..73c1cb9ce87 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -1,5 +1,6 @@ - @no_container = true - breadcrumb_title "Details" +- can_create_subgroups = can?(current_user, :create_subgroup, @group) = content_for :meta_tags do = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity") @@ -16,8 +17,9 @@ - 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" } } - %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") + - if can_create_subgroups + %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 @@ -26,14 +28,15 @@ .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 - .icon-container - = icon("check", class: "list-item-checkmark") - .description - %strong= new_subgroup_label - %span= s_("GroupsTree|Create a subgroup under this group.") + - if can_create_subgroups + %li.divider.droplap-item-ignore + %li{ role: "button", data: { value: "new-subgroup", text: new_subgroup_label } } + .menu-item + .icon-container + = icon("check", class: "list-item-checkmark") + .description + %strong= new_subgroup_label + %span= s_("GroupsTree|Create a subgroup under this group.") - if params[:filter].blank? && @children.empty? = render "shared/groups/empty_state" |