Skip to content

Commit

Permalink
Add processes to goal view TODO: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
javierm committed Dec 21, 2020
1 parent 8c7cee6 commit b0c59a4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
15 changes: 15 additions & 0 deletions app/assets/stylesheets/sdg/goals/show.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,19 @@
}
}
}

.processes-feed {

.feed-content {
@include breakpoint(medium) {
@include grid-row-nest;
display: flex;

> * {
@include grid-column-gutter;
width: 50%;
}
}
}
}
}
6 changes: 6 additions & 0 deletions app/components/sdg/goals/show_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@
</article>

<%= render Widgets::Feeds::ParticipationComponent.new(feeds) %>
<% if processes_feed %>
<div class="feeds-list">
<%= render Widgets::Feeds::ProcessesComponent.new(processes_feed) %>
</div>
<% end %>
</div>
4 changes: 4 additions & 0 deletions app/components/sdg/goals/show_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def feeds
SDG::Widget::Feed.for_goal(goal)
end

def processes_feed
feeds.find { |feed| feed.kind == "processes" }
end

private

def title
Expand Down
4 changes: 2 additions & 2 deletions app/components/widgets/feeds/processes_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<section class="card">
<section class="card processes-feed">
<header>
<h2 class="title"><%= t("welcome.feed.most_active.#{feed.kind}") %></h2>
</header>
Expand All @@ -19,5 +19,5 @@
<% end %>
</div>

<%= link_to t("welcome.feed.see_all_processes"), legislation_processes_path, class: "float-right see-all" %>
<%= link_to t("welcome.feed.see_all_processes"), legislation_processes_path, class: "see-all" %>
</section>

0 comments on commit b0c59a4

Please sign in to comment.