File: _stat_anchor_list.html.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 (16 lines) | stat: -rw-r--r-- 705 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- anchors = local_assigns.fetch(:anchors, [])
- project_buttons = local_assigns.fetch(:project_buttons, false)
- stat_text_classes = "stat-text gl-flex gl-items-center !gl-px-0 !gl-pb-2"

- return unless anchors.any?

%ul.nav.gl-gap-y-2.gl-gap-x-5
  - anchors.each do |anchor|
    %li.nav-item
      - if anchor.link # render actionable link/button
        = link_to(anchor.label, anchor.link, stat_anchor_attrs(anchor))
      - elsif project_buttons # render disabled button
        = render Pajamas::ButtonComponent.new(disabled: true, button_options: { classes: stat_text_classes }) do
          = anchor.label
      - else # render as text label
        %div{ class: stat_text_classes }= anchor.label