Skip to content

Commit d3e1b05

Browse files
authored
Merge pull request #4230 from alphagov/update-slimmer-template
Update slimmer template
2 parents 5a84d12 + abf3b6f commit d3e1b05

7 files changed

+39
-36
lines changed

app/assets/stylesheets/smart_answers.scss

+10
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,13 @@ $is-ie: false !default;
6262
margin-bottom: govuk-spacing(3);
6363
}
6464
}
65+
66+
.app-c-meta-data {
67+
@include govuk-font($size: 16);
68+
color: $govuk-secondary-text-colour;
69+
}
70+
71+
.app-o-next-steps,
72+
.app-o-answer {
73+
margin-bottom: govuk-spacing(6);
74+
}

app/controllers/application_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
55
rescue_from GdsApi::HTTPForbidden, with: :error_403
66
rescue_from ActionController::UnknownFormat, with: :error_404
77

8-
slimmer_template "wrapper"
8+
slimmer_template "core_layout"
99

1010
protected
1111

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<title><%= yield :title %> - GOV.UK</title>
45
<%= stylesheet_link_tag "application", :media => "all" %>
56
<%= stylesheet_link_tag "print.css", media: "print" %>
6-
<title><%= yield :title %> - GOV.UK</title>
77
<%= yield :head %>
8-
98
<% if @content_item %>
109
<%= render "govuk_publishing_components/components/meta_tags",
1110
content_item: @content_item,
1211
strip_dates_pii: true,
1312
strip_postcode_pii: true %>
1413
<% end %>
1514
</head>
16-
<body class="mainstream">
17-
<%= yield :before_wrapper %>
18-
19-
<div id="wrapper" class="govuk-width-container answer smart_answer">
20-
<%= yield %>
21-
<%= render "govuk_publishing_components/components/feedback" %>
22-
</div>
23-
</body>
15+
<body class="govuk-template__body">
16+
<div class="govuk-width-container smart_answer" id="wrapper">
17+
<%= yield %>
18+
<%= render "govuk_publishing_components/components/feedback" %>
19+
</div>
20+
</body>
2421
</html>

app/views/smart_answers/_previous_answers.html.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<% if @presenter.current_question_number > 1 %>
2-
<table class="govuk-table govuk-!-margin-top-9">
2+
<table class="govuk-table">
33
<caption class="govuk-table__caption">
4-
Previous answers
5-
<p><%= link_to "Start again", smart_answer_path(params[:id]), :class => "govuk-link" %></p>
4+
<h2 class="govuk-heading-m">Previous answers</h2>
5+
<p class="govuk-body"><%= link_to "Start again", smart_answer_path(params[:id]), :class => "govuk-link" %></p>
66
</caption>
77
<thead class="govuk-table__head">
88
<tr class="govuk-table__row">
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<div class="meta-wrapper">
2-
<div class="meta-data group">
3-
<div class="inner">
4-
<div class="print-and-modified-date group">
5-
<p class="modified-date">Last updated: <%= last_updated_date.strftime('%e %B %Y') %></p>
6-
</div>
7-
</div>
8-
</div>
9-
</div>
1+
<p class="app-c-meta-data">
2+
Last updated: <%= last_updated_date.strftime('%e %B %Y') %>
3+
</p>

app/views/smart_answers/question.html.erb

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
title: @presenter.title,
1313
margin_bottom: 9
1414
} %>
15-
<%= form_tag calculate_current_question_path(@presenter), :method => :get %>
15+
<%= form_tag calculate_current_question_path(@presenter), :method => :get do %>
1616
<div class="govuk-!-margin-top-9" id="current-question">
17-
<div class="question" data-debug-template-path="<%= question.relative_erb_template_path %>">
18-
<%
19-
show_body = ['salary_question', 'country_select_question'].include? question.partial_template_name
20-
%>
17+
<div class="question govspeak-wrapper" data-debug-template-path="<%= question.relative_erb_template_path %>">
18+
<% show_body = ['salary_question', 'country_select_question'].include? question.partial_template_name %>
19+
2120
<% if question.body.present? && show_body %>
2221
<article role="article">
2322
<%= question.body %>
@@ -31,10 +30,11 @@
3130

3231
<input type="hidden" name="next" value="1" />
3332
<%= render "govuk_publishing_components/components/button", {
34-
text: "Next step"
33+
text: "Next step",
34+
margin_bottom: true
3535
} %>
3636
</div>
37-
</form>
37+
<% end %>
3838

3939
<%= render 'previous_answers' %>
4040
</div>

app/views/smart_answers/result.html.erb

+8-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<% end %>
44

55
<div class="govuk-grid-row">
6-
<div id="result-info" class="govuk-grid-column-two-thirds outcome govspeak-wrapper">
6+
<div id="result-info" class="govuk-grid-column-two-thirds outcome">
77
<%= render 'debug' %>
88
<%= render "govuk_publishing_components/components/title", {
99
title: @presenter.title
1010
} %>
1111

1212
<% outcome = @presenter.current_node %>
1313

14-
<div data-debug-template-path="<%= outcome.relative_erb_template_path %>">
14+
<div class="app-o-answer govspeak-wrapper" data-debug-template-path="<%= outcome.relative_erb_template_path %>">
1515
<% if outcome.title.present? %>
1616
<%= render "govuk_publishing_components/components/heading", {
1717
text: outcome.title
@@ -22,11 +22,13 @@
2222
</div>
2323

2424
<% if outcome.next_steps.present? %>
25-
<%= render "govuk_publishing_components/components/heading", {
26-
text: "Next steps"
27-
} %>
25+
<div class="app-o-next-steps govspeak-wrapper">
26+
<%= render "govuk_publishing_components/components/heading", {
27+
text: "Next steps"
28+
} %>
2829

29-
<%= outcome.next_steps %>
30+
<%= outcome.next_steps %>
31+
</div>
3032
<% end %>
3133

3234
<script type="text/javascript">

0 commit comments

Comments
 (0)