Commit 4c599f2c authored by Lee Tickett's avatar Lee Tickett Committed by Kushal Pandya

Make topics badges pajamas compliant

parent 3f7be75b
- cache_enabled = false unless local_assigns[:cache_enabled] == true - cache_enabled = false unless local_assigns[:cache_enabled] == true
- max_project_topic_length = 15 - max_project_topic_length = 15
- project_topics_classes = "badge badge-pill badge-secondary gl-mr-2"
- if project.topics.present? - if project.topics.present?
= cache_if(cache_enabled, [project, :topic_list], expires_in: 1.day) do = cache_if(cache_enabled, [project, :topic_list], expires_in: 1.day) do
...@@ -10,11 +9,11 @@ ...@@ -10,11 +9,11 @@
- project.topics_to_show.each do |topic| - project.topics_to_show.each do |topic|
- explore_project_topic_path = topic_explore_projects_path(topic_name: topic) - explore_project_topic_path = topic_explore_projects_path(topic_name: topic)
- if topic.length > max_project_topic_length - if topic.length > max_project_topic_length
%a{ class: "#{ project_topics_classes } str-truncated-30 has-tooltip", data: { container: "body" }, title: topic, href: explore_project_topic_path, itemprop: 'keywords' } %a.gl-mr-3.has-tooltip{ data: { container: "body" }, title: topic, href: explore_project_topic_path, itemprop: 'keywords' }
= truncate(topic, length: max_project_topic_length) = gl_badge_tag truncate(topic, length: max_project_topic_length)
- else - else
%a{ class: project_topics_classes, href: explore_project_topic_path, itemprop: 'keywords' } %a.gl-mr-3{ href: explore_project_topic_path, itemprop: 'keywords' }
= topic = gl_badge_tag topic
- if project.has_extra_topics? - if project.has_extra_topics?
- title = _('More topics') - title = _('More topics')
...@@ -23,10 +22,10 @@ ...@@ -23,10 +22,10 @@
- project.topics_not_shown.each do |topic| - project.topics_not_shown.each do |topic|
- explore_project_topic_path = topic_explore_projects_path(topic_name: topic) - explore_project_topic_path = topic_explore_projects_path(topic_name: topic)
- if topic.length > max_project_topic_length - if topic.length > max_project_topic_length
%a{ class: "#{ project_topics_classes } gl-mb-3 str-truncated has-tooltip", data: { container: "body" }, title: topic, href: explore_project_topic_path, itemprop: 'keywords' } %a.gl-mr-3.gl-mb-3.has-tooltip{ data: { container: "body" }, title: topic, href: explore_project_topic_path, itemprop: 'keywords' }
= truncate(topic, length: max_project_topic_length) = gl_badge_tag truncate(topic, length: max_project_topic_length)
- else - else
%a{ class: "#{ project_topics_classes } gl-mb-3", href: explore_project_topic_path, itemprop: 'keywords' } %a.gl-mr-3.gl-mb-3{ href: explore_project_topic_path, itemprop: 'keywords' }
= topic = gl_badge_tag topic
.text-nowrap{ role: 'button', tabindex: 0, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } } .text-nowrap{ role: 'button', tabindex: 0, data: { toggle: 'popover', html: 'true', placement: 'top', title: title, content: content } }
= _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown } = _("+ %{count} more") % { count: project.count_of_extra_topics_not_shown }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment