Skip to content

Commit

Permalink
Make proper use of the grid layout CSS classes.
Browse files Browse the repository at this point in the history
The following HTML node was a bit of a hack :-

    <div class="group">&nbsp;</div>
  • Loading branch information
floehopper committed Jan 30, 2012
1 parent 78a18be commit d5ab396
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 104 deletions.
49 changes: 26 additions & 23 deletions app/views/admin/consultation_responses/show.html.erb
@@ -1,27 +1,30 @@
<% page_title @document.title, "Consultation Response" %>
<div class="g2 first">
<section class="document">
<%= render partial: 'navigation', locals: { document: @document } %>
<%= render partial: "rejected_by", locals: { document: @document } %>
<%= render partial: 'document', locals: { document: @document } %>
<% if @document.notes_to_editors.present? %>
<section id="notes_to_editors">
<h1>Notes to editors</h1>
<%= govspeak_to_html @document.notes_to_editors %>
</section>
<% end %>
</section>
</div>
<div class="g3">
<div class="g2 first">
<section class="document">
<%= render partial: 'navigation', locals: { document: @document } %>
<%= render partial: "rejected_by", locals: { document: @document } %>
<%= render partial: 'document', locals: { document: @document } %>
<% if @document.notes_to_editors.present? %>
<section id="notes_to_editors">
<h1>Notes to editors</h1>
<%= govspeak_to_html @document.notes_to_editors %>
</section>
<% end %>
</section>
</div>

<div class="g1">
<section class="container">
<h1>Consultation</h1>
<%= content_tag_for :p, @document.consultation do %>
This is a response to the consultation
<%= link_to @document.consultation.title, admin_consultation_path(@document.consultation) %>
<% end %>
</section>
<div class="g1">
<section class="container">
<h1>Consultation</h1>
<%= content_tag_for :p, @document.consultation do %>
This is a response to the consultation
<%= link_to @document.consultation.title, admin_consultation_path(@document.consultation) %>
<% end %>
</section>
</div>
</div>

<div class="group">&nbsp;</div>
<%= render partial: 'fact_check_responses', locals: {document: @document} %>
<div class="g3">
<%= render partial: 'fact_check_responses', locals: {document: @document} %>
</div>
20 changes: 12 additions & 8 deletions app/views/admin/documents/edit.html.erb
Expand Up @@ -22,13 +22,17 @@
</section>
</div>
<% else %>
<div class="g2 first">
<section>
<h1>Edit <%= @document.type.titleize %></h1>
<%= render partial: "form", locals: {document: @document} %>
<%= render partial: "govspeak_help" %>
</section>
<div class="g3">
<div class="g2 first">
<section>
<h1>Edit <%= @document.type.titleize %></h1>
<%= render partial: "form", locals: {document: @document} %>
<%= render partial: "govspeak_help" %>
</section>
</div>
</div>

<div class="g3">
<%= render partial: 'fact_check_responses', locals: {document: @document} %>
</div>
<div class="group">&nbsp;</div>
<%= render partial: 'fact_check_responses', locals: {document: @document} %>
<% end %>
149 changes: 76 additions & 73 deletions app/views/admin/documents/show.html.erb
@@ -1,86 +1,89 @@
<% page_title @document.title %>
<div class="g2 first">
<%= render partial: 'navigation', locals: { document: @document } %>
<%= render partial: "rejected_by", locals: { document: @document } %>
<section class="document_view">
<%= render partial: 'document', locals: { document: @document } %>
<% if @document.notes_to_editors.present? %>
<section id="notes_to_editors">
<h1>Notes to editors</h1>
<%= govspeak_to_html @document.notes_to_editors %>
</section>
<% end %>
</section>

<%= render partial: 'supporting_pages', locals: { document: @document } %>
<%= render partial: "editorial_remarks", locals: { document: @document } %>
</div>

<div class="g1">
<section class="container">
<h1>Organisations</h1>
<% if @document.organisations.any? %>
<%= render partial: "organisations/list", locals: {organisations: @document.organisations} %>
<% else %>
<p>This document isn't assigned to any organisations.</p>
<% end %>
</section>

<% if @document.can_be_associated_with_policy_areas? %>
<section class="container">
<h1>Policy areas</h1>
<% if @document.policy_areas.any? %>
<%= render partial: "policy_areas/list", locals: {policy_areas: @document.policy_areas} %>
<% else %>
<p>This document isn't assigned to any policy areas.</p>
<div class="g3">
<div class="g2 first">
<%= render partial: 'navigation', locals: { document: @document } %>
<%= render partial: "rejected_by", locals: { document: @document } %>
<section class="document_view">
<%= render partial: 'document', locals: { document: @document } %>
<% if @document.notes_to_editors.present? %>
<section id="notes_to_editors">
<h1>Notes to editors</h1>
<%= govspeak_to_html @document.notes_to_editors %>
</section>
<% end %>
</section>
<% end %>

<% if @document.can_be_associated_with_ministers? %>
<section class="container">
<h1>Ministers</h1>
<% if @document.ministerial_roles.any? %>
<%= render partial: "ministerial_roles/list", locals: {ministerial_roles: @document.ministerial_roles} %>
<% else %>
<p>This document isn't assigned to any ministers.</p>
<% end %>
</section>
<% end %>
<%= render partial: 'supporting_pages', locals: { document: @document } %>
<%= render partial: "editorial_remarks", locals: { document: @document } %>
</div>

<% if @document.can_be_associated_with_countries? %>
<div class="g1">
<section class="container">
<h1>Countries</h1>
<% if @document.countries.any? %>
<%= render partial: "countries/list", locals: {countries: @document.countries} %>
<h1>Organisations</h1>
<% if @document.organisations.any? %>
<%= render partial: "organisations/list", locals: {organisations: @document.organisations} %>
<% else %>
<p>This document isn't assigned to any countries.</p>
<p>This document isn't assigned to any organisations.</p>
<% end %>
</section>
<% end %>

<% if @document.can_apply_to_subset_of_nations? %>
<section class="container">
<h1>Excluded Nations</h1>
<% if @document.nation_inapplicabilities.any? %>
<%= render partial: "nation_inapplicabilities/list", locals: {nation_inapplicabilities: @document.nation_inapplicabilities} %>
<% else %>
<p>This document applies to the whole of the UK.</p>
<% end %>
</section>
<% end %>
<% if @document.can_be_associated_with_policy_areas? %>
<section class="container">
<h1>Policy areas</h1>
<% if @document.policy_areas.any? %>
<%= render partial: "policy_areas/list", locals: {policy_areas: @document.policy_areas} %>
<% else %>
<p>This document isn't assigned to any policy areas.</p>
<% end %>
</section>
<% end %>
<% if @document.can_be_related_to_policies? %>
<section class="container">
<h1>Related Policies</h1>
<% if @document.related_policies.any? %>
<%= render partial: "admin/documents/related", locals: {related_documents: @document.related_policies} %>
<% else %>
<p>This document doesn't have any related documents.</p>
<% end %>
</section>
<% end %>
<% if @document.can_be_associated_with_ministers? %>
<section class="container">
<h1>Ministers</h1>
<% if @document.ministerial_roles.any? %>
<%= render partial: "ministerial_roles/list", locals: {ministerial_roles: @document.ministerial_roles} %>
<% else %>
<p>This document isn't assigned to any ministers.</p>
<% end %>
</section>
<% end %>
<% if @document.can_be_associated_with_countries? %>
<section class="container">
<h1>Countries</h1>
<% if @document.countries.any? %>
<%= render partial: "countries/list", locals: {countries: @document.countries} %>
<% else %>
<p>This document isn't assigned to any countries.</p>
<% end %>
</section>
<% end %>
<% if @document.can_apply_to_subset_of_nations? %>
<section class="container">
<h1>Excluded Nations</h1>
<% if @document.nation_inapplicabilities.any? %>
<%= render partial: "nation_inapplicabilities/list", locals: {nation_inapplicabilities: @document.nation_inapplicabilities} %>
<% else %>
<p>This document applies to the whole of the UK.</p>
<% end %>
</section>
<% end %>
<% if @document.can_be_related_to_policies? %>
<section class="container">
<h1>Related Policies</h1>
<% if @document.related_policies.any? %>
<%= render partial: "admin/documents/related", locals: {related_documents: @document.related_policies} %>
<% else %>
<p>This document doesn't have any related documents.</p>
<% end %>
</section>
<% end %>
</div>
</div>

<div class="group">&nbsp;</div>
<%= render partial: 'fact_check_responses', locals: {document: @document} %>
<div class="g3">
<%= render partial: 'fact_check_responses', locals: {document: @document} %>
</div>

0 comments on commit d5ab396

Please sign in to comment.