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

Main element #4414

Draft
wants to merge 5 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
214 changes: 106 additions & 108 deletions app/views/calendar/bank_holidays.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,123 +8,121 @@

<%= render :partial => "calendar_head" %>

<main id="content" role="main" class="govuk-main-wrapper govuk-!-padding-top-0">
<% if @calendar.show_bunting? %>
<div class="app-bunting" aria-hidden="true">
<div class="app-bunting__<%= "#{@calendar.bunting_styles}"%>"></div>
</div>

<div class="app-bunting--spacer"></div>
<% end %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<section class="app-o-main-container" lang="<%= I18n.locale %>">

<%= render "govuk_publishing_components/components/title", {
title: @calendar.title
} %>

<article role="article">
<% tab_content ||= [] %>
<% @calendar.divisions.each_with_index do |division, index| %>
<% tab_content[index] = capture do %>

<% if division.upcoming_event %>
<% rendered_panel = render "govuk_publishing_components/components/panel", {
prepend: t("common.next_holiday_in_is", :in_nation => t("#{division.title}_in")),
title: division.upcoming_event.date == Date.today ? t("common.today") : l(division.upcoming_event.date, format: "%e %B"),
append: division.upcoming_event.title
} %>
<% if variant_b_page? %>
<%= content_tag("span", rendered_panel, class: "bank-hols") %>
<% else %>
<%= rendered_panel %>
<% end %>
<% end %>
<% if @calendar.show_bunting? %>
<div class="app-bunting" aria-hidden="true">
<div class="app-bunting__<%= "#{@calendar.bunting_styles}"%>"></div>
</div>

<% caption = "#{t "common.upcoming_bank_holidays"} #{t "#{division.title}_in"}" %>
<h2 class="govuk-heading-m" id="<%= caption.parameterize %>"><%= caption %></h2>

<% division.upcoming_events_by_year.each do |year, events| %>
<%= render "components/calendar", {
title: caption,
year: year,
events: events,
headings: [
{
text: I18n.t("bank_holidays.date")
},
{
text: I18n.t("bank_holidays.day_of_week")
},
{
text: I18n.t("bank_holidays.bank_holiday")
}
]
} %>
<div class="app-bunting--spacer"></div>
<% end %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<section class="app-o-main-container" lang="<%= I18n.locale %>">

<%= render "govuk_publishing_components/components/title", {
title: @calendar.title
} %>

<article role="article">
<% tab_content ||= [] %>
<% @calendar.divisions.each_with_index do |division, index| %>
<% tab_content[index] = capture do %>

<% if division.upcoming_event %>
<% rendered_panel = render "govuk_publishing_components/components/panel", {
prepend: t("common.next_holiday_in_is", :in_nation => t("#{division.title}_in")),
title: division.upcoming_event.date == Date.today ? t("common.today") : l(division.upcoming_event.date, format: "%e %B"),
append: division.upcoming_event.title
} %>
<% if variant_b_page? %>
<%= content_tag("span", rendered_panel, class: "bank-hols") %>
<% else %>
<%= rendered_panel %>
<% end %>
<% end %>

<p class="govuk-body"><%= t("common.bank_holiday_on_wkend") %></p>
<p class="govuk-body"><%= t("common.holiday_entitlement_html") %></p>
<p class="govuk-body"><%= t("common.bank_holiday_benefits_html") %></p>
<%= render "govuk_publishing_components/components/inset_text", {
text: t("common.bank_holiday_translation_html")
<% caption = "#{t "common.upcoming_bank_holidays"} #{t "#{division.title}_in"}" %>
<h2 class="govuk-heading-m" id="<%= caption.parameterize %>"><%= caption %></h2>

<% division.upcoming_events_by_year.each do |year, events| %>
<%= render "components/calendar", {
title: caption,
year: year,
events: events,
headings: [
{
text: I18n.t("bank_holidays.date")
},
{
text: I18n.t("bank_holidays.day_of_week")
},
{
text: I18n.t("bank_holidays.bank_holiday")
}
]
} %>
<% end %>

<%= render "components/subscribe", {
label: t("common.add_holiday_ics", :for_nation => t("#{division.title}_for")),
url: division_path(@calendar, division, :format => 'ics'),
title: t("common.download_ics"),
data: {
module: "ga4-link-tracker",
ga4_link: {
event_name: "file_download",
type: "generic download"
}
<p class="govuk-body"><%= t("common.bank_holiday_on_wkend") %></p>
<p class="govuk-body"><%= t("common.holiday_entitlement_html") %></p>
<p class="govuk-body"><%= t("common.bank_holiday_benefits_html") %></p>
<%= render "govuk_publishing_components/components/inset_text", {
text: t("common.bank_holiday_translation_html")
} %>

<%= render "components/subscribe", {
label: t("common.add_holiday_ics", :for_nation => t("#{division.title}_for")),
url: division_path(@calendar, division, :format => 'ics'),
title: t("common.download_ics"),
data: {
module: "ga4-link-tracker",
ga4_link: {
event_name: "file_download",
type: "generic download"
}
}
} %>

<% caption = "#{t "common.past_bank_holidays"} #{t "#{division.title}_in"}" %>
<h2 class="govuk-heading-m" id="<%= caption.parameterize %>"><%= caption %></h2>

<% division.past_events_by_year.each do |year, events| %>
<%= render "components/calendar", {
title: caption,
year: year,
events: events,
headings: [
{
text: I18n.t("bank_holidays.date")
},
{
text: I18n.t("bank_holidays.day_of_week")
},
{
text: I18n.t("bank_holidays.bank_holiday")
}
]
} %>

<% caption = "#{t "common.past_bank_holidays"} #{t "#{division.title}_in"}" %>
<h2 class="govuk-heading-m" id="<%= caption.parameterize %>"><%= caption %></h2>

<% division.past_events_by_year.each do |year, events| %>
<%= render "components/calendar", {
title: caption,
year: year,
events: events,
headings: [
{
text: I18n.t("bank_holidays.date")
},
{
text: I18n.t("bank_holidays.day_of_week")
},
{
text: I18n.t("bank_holidays.bank_holiday")
}
]
} %>
<% end %>

<% end %>
<% end %>

<%= render "govuk_publishing_components/components/tabs", {
panel_border: false,
tabs: @calendar.divisions.each_with_index.map { |division, index| {
:id => division.slug,
:label => t(division.title),
:content => tab_content[index],
} }
} %>
</article>

<%= render "govuk_publishing_components/components/metadata", {
last_updated: format_date(last_updated_date)
<% end %>
<% end %>

<%= render "govuk_publishing_components/components/tabs", {
panel_border: false,
tabs: @calendar.divisions.each_with_index.map { |division, index| {
:id => division.slug,
:label => t(division.title),
:content => tab_content[index],
} }
} %>
</section>
</div>
<%= render :partial => "calendar_footer" %>
</article>

<%= render "govuk_publishing_components/components/metadata", {
last_updated: format_date(last_updated_date)
} %>
</section>
</div>
<%= render :partial => "calendar_footer" %>
</div>

</main>
98 changes: 47 additions & 51 deletions app/views/calendar/when_do_the_clocks_change.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,54 @@

<%= render :partial => "calendar_head" %>

<div class="govuk-width-container">
<main id="content" role="main" class="govuk-main-wrapper govuk-!-padding-top-0">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/title", {
title: @calendar.title
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= render "govuk_publishing_components/components/title", {
title: @calendar.title
} %>

<article role="article">
<%- division = @calendar.divisions.first -%>

<% if division.upcoming_event %>
<%= render "govuk_publishing_components/components/panel", {
prepend: "The #{division.upcoming_event.notes.gsub(' one hour', '').downcase}",
title: division.upcoming_event.date.strftime("%e %B"),
} %>

<article role="article">
<%- division = @calendar.divisions.first -%>

<% if division.upcoming_event %>
<%= render "govuk_publishing_components/components/panel", {
prepend: "The #{division.upcoming_event.notes.gsub(' one hour', '').downcase}",
title: division.upcoming_event.date.strftime("%e %B"),
} %>
<% end %>

<div class="app-c-calendar app-c-calendar--clocks">
<%= render "govuk_publishing_components/components/table", {
first_cell_is_header: true,
head: [
{ text: t('bank_holidays.year') },
{ text: t('bank_holidays.clocks_forward') },
{ text: t('bank_holidays.clocks_backward') }
],
rows: division.years.each.map { |year| [
{ :text => year },
{ :text => year.events[0].date.strftime('%e %B') },
{ :text => year.events[1].date.strftime('%e %B') }
] }
} %>
</div>

<%= render "components/subscribe", {
label: t('bank_holidays.add_clock_changes_to_calendar'),
url: division_path(@calendar, division, :format => 'ics'),
title: t('bank_holidays.download_clock_changes')
} %>

<p class="govuk-body"> <%= t('bank_holidays.clock_change_explanation') %> </p>

<p class="govuk-body"> <%= t('bank_holidays.bst_explanation') %> </p>

<p class="govuk-body"> <%= t('bank_holidays.gmt_explanation') %> </p>
</article>

<%= render "govuk_publishing_components/components/metadata", {
last_updated: format_date(last_updated_date)
<% end %>

<div class="app-c-calendar app-c-calendar--clocks">
<%= render "govuk_publishing_components/components/table", {
first_cell_is_header: true,
head: [
{ text: t('bank_holidays.year') },
{ text: t('bank_holidays.clocks_forward') },
{ text: t('bank_holidays.clocks_backward') }
],
rows: division.years.each.map { |year| [
{ :text => year },
{ :text => year.events[0].date.strftime('%e %B') },
{ :text => year.events[1].date.strftime('%e %B') }
] }
} %>
</div>
<%= render :partial => "calendar_footer" %>
</div>
</main>

<%= render "components/subscribe", {
label: t('bank_holidays.add_clock_changes_to_calendar'),
url: division_path(@calendar, division, :format => 'ics'),
title: t('bank_holidays.download_clock_changes')
} %>

<p class="govuk-body"> <%= t('bank_holidays.clock_change_explanation') %> </p>

<p class="govuk-body"> <%= t('bank_holidays.bst_explanation') %> </p>

<p class="govuk-body"> <%= t('bank_holidays.gmt_explanation') %> </p>
</article>

<%= render "govuk_publishing_components/components/metadata", {
last_updated: format_date(last_updated_date)
} %>
</div>
<%= render :partial => "calendar_footer" %>
</div>
16 changes: 7 additions & 9 deletions app/views/csv_preview/access_limited.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<% content_for :title, "#{I18n.t('csv_preview.access_limited.title')} - GOV.UK" %>

<main id="content" role="main" class="govuk-main-wrapper">
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<p class="govuk-body">
<%= I18n.t("csv_preview.access_limited.body") %>
</p>
</div>
<div class="govuk-width-container">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<p class="govuk-body">
<%= I18n.t("csv_preview.access_limited.body") %>
</p>
</div>
</div>
</main>
</div>
Loading
Loading