Skip to content

Commit

Permalink
Remove spans from wihtin editable elements
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispymm committed Apr 29, 2024
1 parent 57d020b commit 1e7b806
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/helpers/metadata_presenter/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module ApplicationHelper

def main_title(component:, tag: :h1, classes: 'govuk-heading-xl')
content_tag(tag, class: classes) do
content_tag(:span, component.humanised_title)
component.humanised_title
end
end

Expand Down
12 changes: 5 additions & 7 deletions app/views/metadata_presenter/attribute/_heading.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<h1>
<span class="fb-editable govuk-heading-xl"
data-fb-content-id="page[heading]"
data-fb-content-type="element"
data-fb-default-value="<%= default_page_title(@page.type) %>">
<%= @page.heading %>
</span>
<h1 class="fb-editable govuk-heading-xl"
data-fb-content-id="page[heading]"
data-fb-content-type="element"
data-fb-default-value="<%= default_page_title(@page.type) %>">
<%= @page.heading %>
</h1>

2 changes: 0 additions & 2 deletions app/views/metadata_presenter/attribute/_lede.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
data-fb-content-id="page[lede]"
data-fb-content-type="element"
data-fb-default-text="<%= default_text('lede') %>">
<div class="html">
<%= @page.lede %>
</div>
</div>
<%- end %>
12 changes: 4 additions & 8 deletions app/views/metadata_presenter/page/checkanswers.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

<%= render partial:'metadata_presenter/component/conditional_component_banner'%>

<h1>
<span class="fb-editable govuk-heading-xl"
<h1 class="fb-editable govuk-heading-xl"
data-fb-content-type="element"
data-fb-content-id="page[heading]"
data-fb-default-value="<%= default_page_title(@page.type) %>">
<%= @page.heading %>
</span>
</h1>
</h1>

<%= form_for @page, url: reserved_submissions_path, authenticity_token: false, html: { id: 'answers-form' } do |f| %>
<%= hidden_field_tag :authenticity_token, form_authenticity_token -%>
Expand Down Expand Up @@ -65,13 +63,11 @@
</dl>

<% if @page.send_heading.present? %>
<h2>
<span class="fb-send-heading fb-editable govuk-heading-m"
<h2 class="fb-send-heading fb-editable govuk-heading-m"
data-fb-content-type="element"
data-fb-content-id="page[send_heading]">
<%= @page.send_heading %>
</span>
</h2>
</h2>
<% end %>

<% if @page.send_body.present? %>
Expand Down
6 changes: 2 additions & 4 deletions app/views/metadata_presenter/page/confirmation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<% else %>
<div class="govuk-panel govuk-panel--confirmation govuk-grid-column-two-thirds">
<% end %>
<h1>
<span class="fb-editable govuk-panel__title"
<h1 class="fb-editable govuk-panel__title"
data-fb-content-type="element"
data-fb-content-id="page[heading]"
data-fb-default-value="<%= default_page_title(@page.type) %>">
Expand All @@ -18,8 +17,7 @@
<% else %>
<%= @page.heading %>
<% end %>
</span>
</h1>
</h1>

<div class="govuk-panel__body">
<% if reference_number_enabled? %>
Expand Down
5 changes: 2 additions & 3 deletions app/views/metadata_presenter/page/content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@

<%= render 'metadata_presenter/attribute/section_heading' %>

<h1>
<span class="fb-editable govuk-heading-xl"

<h1 class="fb-editable govuk-heading-xl"
data-fb-content-id="page[heading]"
data-fb-content-type="element"
data-fb-default-value="<%= default_page_title(@page.type) %>">
<%= @page.heading %>
</span>
</h1>

<%= render 'metadata_presenter/attribute/lede' %>
Expand Down
6 changes: 2 additions & 4 deletions app/views/metadata_presenter/page/exit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@

<%= render 'metadata_presenter/attribute/section_heading' %>

<h1>
<span class="fb-editable govuk-heading-xl"
<h1 class="fb-editable govuk-heading-xl"
data-fb-content-id="page[heading]"
data-fb-content-type="element"
data-fb-default-value="<%= default_page_title(@page.type) %>">
<%= @page.heading %>
</span>
</h1>
</h1>

<%= render 'metadata_presenter/attribute/lede' %>

Expand Down
3 changes: 1 addition & 2 deletions app/views/metadata_presenter/page/standalone.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
<% end %>
<%# ORIGINAL TEMPLATE: Uses content from form metadata %>
<% if @page.heading %>
<h1> <span class="fb-editable govuk-heading-xl"
<h1 class="fb-editable govuk-heading-xl"
data-fb-content-id="page[heading]"
data-fb-content-type="element"
data-fb-default-value="<%= t("presenter.footer.#{@page.id.gsub('page.','')}.heading") %>">
<%= @page.heading %>
</span>
</h1>
<% end %>
<%= render 'metadata_presenter/attribute/body' %>
Expand Down

0 comments on commit 1e7b806

Please sign in to comment.