Always provide the title before writing anything else

This way our views are more consistent.
This commit is contained in:
Javi Martín
2024-03-15 21:39:54 +01:00
parent 45c1f93562
commit e867135a07
4 changed files with 6 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
<%= render Shared::BannerComponent.new("budgets") %>
<% provide :title do %><%= t("budgets.index.title") %><% end %> <% provide :title do %><%= t("budgets.index.title") %><% end %>
<% provide :main_class, "budgets-index" %> <% provide :main_class, "budgets-index" %>
<%= render Shared::BannerComponent.new("budgets") %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: budgets_url %> <%= render "shared/canonical", href: budgets_url %>
<% end %> <% end %>

View File

@@ -1,6 +1,7 @@
<%= render Shared::BannerComponent.new("budgets") %>
<% provide :title do %><%= @budget.name %><% end %> <% provide :title do %><%= @budget.name %><% end %>
<%= render Shared::BannerComponent.new("budgets") %>
<% content_for :canonical do %> <% content_for :canonical do %>
<%= render "shared/canonical", href: budget_url(@budget, filter: @current_filter) %> <%= render "shared/canonical", href: budget_url(@budget, filter: @current_filter) %>
<% end %> <% end %>

View File

@@ -1,5 +1,5 @@
<%= content_for :body_class, "custom-page" %>
<% provide :title do %><%= @custom_page.title %><% end %> <% provide :title do %><%= @custom_page.title %><% end %>
<%= content_for :body_class, "custom-page" %>
<div class="row margin-top"> <div class="row margin-top">

View File

@@ -1,5 +1,5 @@
<% preview = false unless local_assigns.has_key? :preview %>
<% provide :title do %><%= @proposal.title %><% end %> <% provide :title do %><%= @proposal.title %><% end %>
<% preview = false unless local_assigns.has_key? :preview %>
<% content_for :meta_description do %><%= @proposal.summary %><% end %> <% content_for :meta_description do %><%= @proposal.summary %><% end %>
<% provide :social_media_meta_tags do %> <% provide :social_media_meta_tags do %>
<%= render "shared/social_media_meta_tags", <%= render "shared/social_media_meta_tags",