Add basic header to SDG goals view
This commit is contained in:
@@ -28,4 +28,5 @@
|
||||
@import "leaflet";
|
||||
@import "sticky_overrides";
|
||||
@import "admin/*";
|
||||
@import "sdg/**/*";
|
||||
@import "sdg_management/*";
|
||||
|
||||
7
app/assets/stylesheets/sdg/goals/show.scss
Normal file
7
app/assets/stylesheets/sdg/goals/show.scss
Normal file
@@ -0,0 +1,7 @@
|
||||
.sdg-goal-show {
|
||||
@include grid-row;
|
||||
|
||||
> * {
|
||||
@include grid-column-gutter;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<% provide(:title) { goal.title } %>
|
||||
|
||||
<div class="sdg-goal-show">
|
||||
<%= back_link_to sdg_goals_path %>
|
||||
|
||||
<article class="sdg-goal sdg-goal-<%= goal.code %>">
|
||||
<header>
|
||||
<h1><%= goal.title %></h1>
|
||||
</header>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class SDG::Goals::ShowComponent < ApplicationComponent
|
||||
attr_reader :goal
|
||||
delegate :back_link_to, to: :helpers
|
||||
|
||||
def initialize(goal)
|
||||
@goal = goal
|
||||
|
||||
@@ -31,4 +31,12 @@ describe "SDG Goals", :js do
|
||||
expect(page).to have_current_path sdg_goal_path(7)
|
||||
end
|
||||
end
|
||||
|
||||
describe "Show" do
|
||||
scenario "shows the SDG" do
|
||||
visit sdg_goal_path(15)
|
||||
|
||||
within(".sdg-goal header") { expect(page).to have_content "Life on Land" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user