diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index daa8ffc81..54c96e0d5 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -28,4 +28,5 @@ @import "leaflet"; @import "sticky_overrides"; @import "admin/*"; +@import "sdg/**/*"; @import "sdg_management/*"; diff --git a/app/assets/stylesheets/sdg/goals/show.scss b/app/assets/stylesheets/sdg/goals/show.scss new file mode 100644 index 000000000..a8ba7ec9e --- /dev/null +++ b/app/assets/stylesheets/sdg/goals/show.scss @@ -0,0 +1,7 @@ +.sdg-goal-show { + @include grid-row; + + > * { + @include grid-column-gutter; + } +} diff --git a/app/components/sdg/goals/show_component.html.erb b/app/components/sdg/goals/show_component.html.erb index e69de29bb..9bdf4b1e2 100644 --- a/app/components/sdg/goals/show_component.html.erb +++ b/app/components/sdg/goals/show_component.html.erb @@ -0,0 +1,11 @@ +<% provide(:title) { goal.title } %> + +
+ <%= back_link_to sdg_goals_path %> + +
+
+

<%= goal.title %>

+
+
+
diff --git a/app/components/sdg/goals/show_component.rb b/app/components/sdg/goals/show_component.rb index 49a311b41..c7f17335a 100644 --- a/app/components/sdg/goals/show_component.rb +++ b/app/components/sdg/goals/show_component.rb @@ -1,5 +1,6 @@ class SDG::Goals::ShowComponent < ApplicationComponent attr_reader :goal + delegate :back_link_to, to: :helpers def initialize(goal) @goal = goal diff --git a/spec/system/sdg/goals_spec.rb b/spec/system/sdg/goals_spec.rb index 00ab66a4d..2b0ba6030 100644 --- a/spec/system/sdg/goals_spec.rb +++ b/spec/system/sdg/goals_spec.rb @@ -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