Files
nairobi/app/components/sdg_management/header.rb
Senén Rodero Rodríguez 3364423698 Update SDG header component
* Add a header element as component markup wrapper
* Allow component to receive an optional block
* Add reusable styles for header links

Co-autored-by: Javi Martín <javim@elretirao.net>
2020-12-11 16:09:43 +01:00

18 lines
311 B
Ruby

module SDGManagement::Header
extend ActiveSupport::Concern
def header(&block)
provide(:title) do
"#{t("sdg_management.header.title")} - #{title}"
end
tag.header do
if block_given?
tag.h2(title) + capture(&block)
else
tag.h2(title)
end
end
end
end