summaryrefslogtreecommitdiff
path: root/app/views/groups/_home_panel.html.haml
blob: 37c4ecc09f3ef6750e292fc84dde0ea51f654a5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- can_create_subgroups = can?(current_user, :create_subgroup, @group)
- can_create_projects = can?(current_user, :create_projects, @group)
- emails_disabled = @group.emails_disabled?

.group-home-panel
  .row.mb-3
    .home-panel-title-row.col-md-12.col-lg-6.d-flex
      .avatar-container.rect-avatar.s64.home-panel-avatar.gl-mr-3.float-none
        = group_icon(@group, class: 'avatar avatar-tile s64', width: 64, height: 64, itemprop: 'logo')
      .d-flex.flex-column.flex-wrap.align-items-baseline
        .d-inline-flex.align-items-baseline
          %h1.home-panel-title.gl-mt-3.gl-mb-2{ itemprop: 'name' }
            = @group.name
            %span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@group) }
              = visibility_level_icon(@group.visibility_level, options: {class: 'icon'})
        .home-panel-metadata.d-flex.align-items-center.text-secondary
          %span
            = _("Group ID: %{group_id}") % { group_id: @group.id }
          - if current_user
            %span.access-request-links.gl-ml-3
              = render 'shared/members/access_request_links', source: @group

    .home-panel-buttons.col-md-12.col-lg-6
      - if current_user
        .gl-display-flex.gl-flex-wrap.gl-lg-justify-content-end.gl-mx-n2{ data: { testid: 'group-buttons' } }
          - if Feature.enabled?(:vue_notification_dropdown, @group, default_enabled: :yaml)
            - if @notification_setting
              .js-vue-notification-dropdown{ data: { disabled: emails_disabled, dropdown_items: notification_dropdown_items(@notification_setting).to_json, notification_level: @notification_setting.level, help_page_path: help_page_path('user/profile/notifications'), group_id: @group.id, container_class: 'gl-mr-3 gl-mt-3 gl-vertical-align-top' } }
          - else
            = render 'shared/notifications/new_button', notification_setting: @notification_setting, btn_class: 'btn gl-button gl-sm-w-auto gl-w-full', dropdown_container_class: 'gl-mr-0 gl-px-2 gl-sm-w-auto gl-w-full', emails_disabled: emails_disabled
          - if can_create_subgroups
            .gl-px-2.gl-sm-w-auto.gl-w-full
              = link_to _("New subgroup"), new_group_path(parent_id: @group.id), class: "btn btn-success btn-md gl-button btn-success-secondary gl-mt-3 gl-sm-w-auto gl-w-full", data: { qa_selector: 'new_subgroup_button' }
          - if can_create_projects
            .gl-px-2.gl-sm-w-auto.gl-w-full
              = link_to _("New project"), new_project_path(namespace_id: @group.id), class: "btn btn-success btn-md gl-button gl-mt-3 gl-sm-w-auto gl-w-full", data: { qa_selector: 'new_project_button' }

  - if @group.description.present?
    .group-home-desc.mt-1
      .home-panel-description
        .home-panel-description-markdown.read-more-container{ itemprop: 'description' }
          = markdown_field(@group, :description)
        %button.btn.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" }
          = _("Read more")