2019-01-21 20:52:53 +00:00
|
|
|
- can_create_subgroups = can?(current_user, :create_subgroup, @group)
|
2020-04-28 09:09:34 +00:00
|
|
|
- can_create_projects = can?(current_user, :create_projects, @group)
|
2019-08-17 05:56:48 +00:00
|
|
|
- emails_disabled = @group.emails_disabled?
|
2017-01-24 15:32:34 +00:00
|
|
|
|
2019-01-21 20:52:53 +00:00
|
|
|
.group-home-panel
|
|
|
|
.row.mb-3
|
|
|
|
.home-panel-title-row.col-md-12.col-lg-6.d-flex
|
2020-07-07 15:08:49 +00:00
|
|
|
.avatar-container.rect-avatar.s64.home-panel-avatar.gl-mr-3.float-none
|
2019-01-21 20:52:53 +00:00
|
|
|
= group_icon(@group, class: 'avatar avatar-tile s64', width: 64, height: 64)
|
|
|
|
.d-flex.flex-column.flex-wrap.align-items-baseline
|
|
|
|
.d-inline-flex.align-items-baseline
|
2020-06-30 06:08:49 +00:00
|
|
|
%h1.home-panel-title.gl-mt-3.gl-mb-2
|
2019-01-21 20:52:53 +00:00
|
|
|
= @group.name
|
2020-05-27 00:08:11 +00:00
|
|
|
%span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) }
|
2019-01-21 20:52:53 +00:00
|
|
|
= visibility_level_icon(@group.visibility_level, fw: false, options: {class: 'icon'})
|
|
|
|
.home-panel-metadata.d-flex.align-items-center.text-secondary
|
|
|
|
%span
|
2019-03-07 19:32:21 +00:00
|
|
|
= _("Group ID: %{group_id}") % { group_id: @group.id }
|
2019-01-21 20:52:53 +00:00
|
|
|
- if current_user
|
2020-05-28 12:08:10 +00:00
|
|
|
%span.access-request-links.gl-ml-3
|
2019-01-21 20:52:53 +00:00
|
|
|
= render 'shared/members/access_request_links', source: @group
|
2017-01-24 15:32:34 +00:00
|
|
|
|
2019-01-21 20:52:53 +00:00
|
|
|
.home-panel-buttons.col-md-12.col-lg-6.d-inline-flex.flex-wrap.justify-content-lg-end
|
|
|
|
- if current_user
|
|
|
|
.group-buttons
|
2019-08-17 05:56:48 +00:00
|
|
|
= render 'shared/notifications/new_button', notification_setting: @notification_setting, btn_class: 'btn', emails_disabled: emails_disabled
|
2020-04-28 09:09:34 +00:00
|
|
|
- new_project_label = _("New project")
|
|
|
|
- new_subgroup_label = _("New subgroup")
|
|
|
|
- if can_create_projects and can_create_subgroups
|
2020-06-26 06:09:03 +00:00
|
|
|
.btn-group.new-project-subgroup.droplab-dropdown.home-panel-action-button.gl-mt-3.js-new-project-subgroup.qa-new-project-or-subgroup-dropdown{ data: { project_path: new_project_path(namespace_id: @group.id), subgroup_path: new_group_path(parent_id: @group.id) } }
|
2020-04-28 09:09:34 +00:00
|
|
|
%input.btn.btn-success.dropdown-primary.js-new-group-child.qa-new-in-group-button{ type: "button", value: new_project_label, data: { action: "new-project" } }
|
|
|
|
%button.btn.btn-success.dropdown-toggle.js-dropdown-toggle.qa-new-project-or-subgroup-dropdown-toggle{ type: "button", data: { "dropdown-trigger" => "#new-project-or-subgroup-dropdown", 'display' => 'static' } }
|
|
|
|
= sprite_icon("chevron-down", css_class: "icon dropdown-btn-icon")
|
|
|
|
%ul#new-project-or-subgroup-dropdown.dropdown-menu.dropdown-menu-right{ data: { dropdown: true } }
|
|
|
|
%li.droplab-item-selected.qa-new-project-option{ 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 a project in this group.")
|
|
|
|
%li.divider.droplap-item-ignore
|
|
|
|
%li.qa-new-subgroup-option{ role: "button", data: { value: "new-subgroup", text: new_subgroup_label } }
|
2019-01-21 20:52:53 +00:00
|
|
|
.menu-item
|
|
|
|
.icon-container
|
|
|
|
= icon("check", class: "list-item-checkmark")
|
|
|
|
.description
|
2020-04-28 09:09:34 +00:00
|
|
|
%strong= new_subgroup_label
|
|
|
|
%span= s_("GroupsTree|Create a subgroup in this group.")
|
|
|
|
- elsif can_create_projects
|
2020-06-26 06:09:03 +00:00
|
|
|
= link_to new_project_label, new_project_path(namespace_id: @group.id), class: "btn btn-success gl-mt-3"
|
2020-04-28 09:09:34 +00:00
|
|
|
- elsif can_create_subgroups
|
2020-06-26 06:09:03 +00:00
|
|
|
= link_to new_subgroup_label, new_group_path(parent_id: @group.id), class: "btn btn-success gl-mt-3"
|
2019-01-21 20:52:53 +00:00
|
|
|
|
|
|
|
- if @group.description.present?
|
|
|
|
.group-home-desc.mt-1
|
|
|
|
.home-panel-description
|
|
|
|
.home-panel-description-markdown.read-more-container
|
|
|
|
= markdown_field(@group, :description)
|
|
|
|
%button.btn.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" }
|
|
|
|
= _("Read more")
|