File: _topics.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 (27 lines) | stat: -rw-r--r-- 1,777 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
- max_project_topic_length = 15

- if project.topics.present?
  .gl-w-full.gl-inline-flex.gl-flex-wrap.gl-text-base.gl-font-normal.gl-items-center.-gl-mx-2.-gl-my-2{ 'data-testid': 'project_topic_list' }
    - project.topics_to_show.each do |topic|
      - explore_project_topic_path = topic_explore_projects_cleaned_path(topic_name: topic[:name])
      - if topic[:title].length > max_project_topic_length
        %a.gl-p-2.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' }
          = gl_badge_tag truncate(topic[:title], length: max_project_topic_length)
      - else
        %a.gl-p-2{ href: explore_project_topic_path, itemprop: 'keywords' }
          = gl_badge_tag topic[:title]

    - if project.has_extra_topics?
      - title = _('More topics')
      - content = capture do
        %span.gl-inline-flex.gl-flex-wrap
          - project.topics_not_shown.each do |topic|
            - explore_project_topic_path = topic_explore_projects_cleaned_path(topic_name: topic[:name])
            - if topic[:title].length > max_project_topic_length
              %a.gl-mr-3.gl-mb-3.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' }
                = gl_badge_tag truncate(topic[:title], length: max_project_topic_length)
            - else
              %a.gl-mr-3.gl-mb-3{ href: explore_project_topic_path, itemprop: 'keywords' }
                = gl_badge_tag topic[:title]
      .text-nowrap.gl-p-2{ role: 'button', tabindex: 0, data: { toggle: 'popover', triggers: 'focus hover', html: 'true', placement: 'top', title: title, content: content } }
        = _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown }