Add cards to SDG homepage

This commit is contained in:
Javi Martín
2021-01-13 14:44:55 +01:00
parent 5907ddf884
commit c3e60ff514
7 changed files with 37 additions and 4 deletions

View File

@@ -1,3 +1,13 @@
<div class="sdg-goals-index">
<%= link_list(*goal_links, class: "sdg-goal-list") %>
<% phases.each do |phase| %>
<section class="sdg-phase" id="sdg_phase_<%= phase.kind %>">
<header>
<h2 class="title"><%= phase.title %></h2>
</header>
<%= render "shared/cards", cards: phase.cards %>
</section>
<% end %>
</div>

View File

@@ -1,9 +1,10 @@
class SDG::Goals::IndexComponent < ApplicationComponent
attr_reader :goals
attr_reader :goals, :phases
delegate :link_list, to: :helpers
def initialize(goals)
def initialize(goals, phases)
@goals = goals
@phases = phases
end
private