debian-mirror-gitlab/app/views/shared/projects/_topics.html.haml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
2 KiB
Text
Raw Normal View History

2021-10-27 15:23:28 +05:30
- cache_enabled = false unless local_assigns[:cache_enabled] == true
- max_project_topic_length = 15
- if project.topics.present?
= cache_if(cache_enabled, [project, :topic_list], expires_in: 1.day) do
2022-08-27 11:52:29 +05:30
.gl-w-full.gl-display-inline-flex.gl-flex-wrap.gl-font-base.gl-font-weight-normal.gl-align-items-center.gl-mx-n2.gl-my-n2{ 'data-testid': 'project_topic_list' }
%span.gl-p-2.gl-text-gray-500
= _('Topics') + ':'
2021-10-27 15:23:28 +05:30
- project.topics_to_show.each do |topic|
2022-07-16 23:28:13 +05:30
- explore_project_topic_path = topic_explore_projects_path(topic_name: topic[:name])
- if topic[:title].length > max_project_topic_length
2022-08-27 11:52:29 +05:30
%a.gl-p-2.has-tooltip{ data: { container: "body" }, title: topic[:title], href: explore_project_topic_path, itemprop: 'keywords' }
2022-07-16 23:28:13 +05:30
= gl_badge_tag truncate(topic[:title], length: max_project_topic_length)
2021-10-27 15:23:28 +05:30
- else
2022-08-27 11:52:29 +05:30
%a.gl-p-2{ href: explore_project_topic_path, itemprop: 'keywords' }
2022-07-16 23:28:13 +05:30
= gl_badge_tag topic[:title]
2021-10-27 15:23:28 +05:30
- if project.has_extra_topics?
- title = _('More topics')
- content = capture do
%span.gl-display-inline-flex.gl-flex-wrap
- project.topics_not_shown.each do |topic|
2022-07-16 23:28:13 +05:30
- explore_project_topic_path = topic_explore_projects_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)
2021-10-27 15:23:28 +05:30
- else
2022-01-26 12:08:38 +05:30
%a.gl-mr-3.gl-mb-3{ href: explore_project_topic_path, itemprop: 'keywords' }
2022-07-16 23:28:13 +05:30
= gl_badge_tag topic[:title]
2022-08-27 11:52:29 +05:30
.text-nowrap.gl-p-2{ role: 'button', tabindex: 0, data: { toggle: 'popover', triggers: 'focus hover', html: 'true', placement: 'top', title: title, content: content } }
2021-10-27 15:23:28 +05:30
= _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown }