Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove spans from within editable elements #399

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
### Changed
### Fixed

## [3.3.36] - 2023-04-29
### Changed
- Removed <span> elements from within editable headings, as Editor has been updated to inject them

## [3.3.35] - 2024-04-25
### Fixed
- Fixed an issue with the back link in save and return pages and prevented an error when access email confirmation page when session cannot be loaded
Expand Down
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
2 changes: 1 addition & 1 deletion lib/metadata_presenter/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MetadataPresenter
VERSION = '3.3.35'.freeze
VERSION = '3.3.36'.freeze
end
Loading