Extract method to provide a title for SDG pages
This way we'll avoid the duplication that can be found in the admin section.
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
<% provide(:title) do %>
|
||||
<%= t("sdg_management.header.title") %> - <%= title %>
|
||||
<% end %>
|
||||
|
||||
<h2><%= title %></h2>
|
||||
<%= header %>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class SDGManagement::Goals::IndexComponent < ApplicationComponent
|
||||
include SDGManagement::Header
|
||||
|
||||
attr_reader :goals
|
||||
|
||||
def initialize(goals)
|
||||
|
||||
11
app/components/sdg_management/header.rb
Normal file
11
app/components/sdg_management/header.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module SDGManagement::Header
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def header
|
||||
provide(:title) do
|
||||
"#{t("sdg_management.header.title")} - #{title}"
|
||||
end
|
||||
|
||||
tag.h2 title
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user