File: crud_component.haml

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (35 lines) | stat: -rw-r--r-- 1,709 bytes parent folder | download
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
%section
  .crud.gl-bg-subtle.gl-border.gl-border-section.gl-rounded-base{ @options, class: ('js-toggle-container' if @toggle_text) }
    %header.crud-header.gl-flex.gl-flex-wrap.gl-justify-between.gl-gap-x-5.gl-gap-y-2.gl-px-5.gl-py-4.gl-bg-section.gl-border-b.gl-border-section.gl-rounded-t-base
      .gl-flex.gl-flex-col.gl-self-center
        %h2.gl-text-base.gl-font-bold.gl-leading-normal.gl-inline-flex.gl-gap-3.gl-m-0{ data: { testid: 'crud-title' } }
          = @title
          - if @count
            %span.gl-inline-flex.gl-items-center.gl-gap-2.gl-text-sm.gl-text-subtle{ data: { testid: 'crud-count' } }
              - if @icon
                = sprite_icon(@icon, css_class: @icon_class)
              %span{ @count_options }
                = @count
        - if description? || @description
          .gl-text-sm.gl-text-subtle.gl-leading-normal.gl-mt-2.gl-mb-0{ data: { testid: 'crud-description' } }
            = description || @description
      .gl-flex.gl-gap-3.gl-items-baseline{ data: { testid: 'crud-actions' } }
        - if @toggle_text
          = render Pajamas::ButtonComponent.new(size: :small, button_options: toggle_button_options_attrs) do
            = @toggle_text
        = actions

    - if form?
      .gl-p-5.gl-pt-4.gl-bg-section.gl-border-b.gl-border-section{ form_options_attrs }
        = form

    .crud-body.gl-mx-5.gl-my-4{ body_options_attrs }
      = body

      - if pagination?
        .crud-pagination.gl-flex.gl-justify-center.gl-p-5.gl-border-t{ data: { testid: 'crud-pagination' } }
          = pagination

    - if footer?
      .gl-px-5.gl-py-4.gl-bg-section.gl-border-t.gl-border-section.gl-rounded-b-base{ footer_options_attrs }
        = footer