Add code to goal title

The same way it's done in UN official SDG pages.
This commit is contained in:
Javi Martín
2020-12-26 22:30:08 +01:00
parent 46c6aa7f5f
commit bec166548c
4 changed files with 11 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
<article class="sdg-goal sdg-goal-<%= goal.code %>">
<header>
<h1><%= goal.title %></h1>
<h1><%= heading %></h1>
</header>
</article>

View File

@@ -15,4 +15,8 @@ class SDG::Goals::ShowComponent < ApplicationComponent
def processes_feed
feeds.find { |feed| feed.kind == "processes" }
end
def heading
safe_join([tag.span(goal.code, class: "goal-code"), tag.span(goal.title, class: "goal-title")], " ")
end
end