2019-01-21 15:52:53 -05:00
|
|
|
- can_create_subgroups = can?(current_user, :create_subgroup, @group)
|
2020-04-28 05:09:34 -04:00
|
|
|
- can_create_projects = can?(current_user, :create_projects, @group)
|
2019-08-17 01:56:48 -04:00
|
|
|
- emails_disabled = @group.emails_disabled?
|
2017-01-24 10:32:34 -05:00
|
|
|
|
2019-01-21 15:52:53 -05:00
|
|
|
.group-home-panel
|
|
|
|
.row.mb-3
|
|
|
|
.home-panel-title-row.col-md-12.col-lg-6.d-flex
|
2020-07-07 11:08:49 -04:00
|
|
|
.avatar-container.rect-avatar.s64.home-panel-avatar.gl-mr-3.float-none
|
2019-01-21 15:52:53 -05: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 02:08:49 -04:00
|
|
|
%h1.home-panel-title.gl-mt-3.gl-mb-2
|
2019-01-21 15:52:53 -05:00
|
|
|
= @group.name
|
2020-05-26 20:08:11 -04:00
|
|
|
%span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) }
|
2020-07-22 20:09:43 -04:00
|
|
|
= visibility_level_icon(@group.visibility_level, options: {class: 'icon'})
|
2019-01-21 15:52:53 -05:00
|
|
|
.home-panel-metadata.d-flex.align-items-center.text-secondary
|
|
|
|
%span
|
2019-03-07 14:32:21 -05:00
|
|
|
= _("Group ID: %{group_id}") % { group_id: @group.id }
|
2019-01-21 15:52:53 -05:00
|
|
|
- if current_user
|
2020-05-28 08:08:10 -04:00
|
|
|
%span.access-request-links.gl-ml-3
|
2019-01-21 15:52:53 -05:00
|
|
|
= render 'shared/members/access_request_links', source: @group
|
2017-01-24 10:32:34 -05:00
|
|
|
|
2019-01-21 15:52:53 -05: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 01:56:48 -04:00
|
|
|
= render 'shared/notifications/new_button', notification_setting: @notification_setting, btn_class: 'btn', emails_disabled: emails_disabled
|
2020-04-28 05:09:34 -04:00
|
|
|
- new_project_label = _("New project")
|
|
|
|
- new_subgroup_label = _("New subgroup")
|
|
|
|
- if can_create_projects and can_create_subgroups
|
2020-06-26 02:09:03 -04: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 05:09:34 -04: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
|
2020-10-26 14:08:27 -04:00
|
|
|
= sprite_icon("check", css_class: "list-item-checkmark")
|
2020-04-28 05:09:34 -04:00
|
|
|
.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 15:52:53 -05:00
|
|
|
.menu-item
|
|
|
|
.icon-container
|
2020-10-26 14:08:27 -04:00
|
|
|
= sprite_icon("check", css_class: "list-item-checkmark")
|
2019-01-21 15:52:53 -05:00
|
|
|
.description
|
2020-04-28 05:09:34 -04:00
|
|
|
%strong= new_subgroup_label
|
|
|
|
%span= s_("GroupsTree|Create a subgroup in this group.")
|
|
|
|
- elsif can_create_projects
|
2020-06-26 02:09:03 -04:00
|
|
|
= link_to new_project_label, new_project_path(namespace_id: @group.id), class: "btn btn-success gl-mt-3"
|
2020-04-28 05:09:34 -04:00
|
|
|
- elsif can_create_subgroups
|
2020-06-26 02:09:03 -04:00
|
|
|
= link_to new_subgroup_label, new_group_path(parent_id: @group.id), class: "btn btn-success gl-mt-3"
|
2019-01-21 15:52:53 -05: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")
|