Skip to content

Commit

Permalink
Switch to using govuk_admin_template layout
Browse files Browse the repository at this point in the history
* Use nested layouts
* Import gem’s SASS styles
* Remove now unnecessary javascript and SASS includes,
  * Delete application.js altogether, it’s not being used
* Remove HTML5 shim, now provided by gem
  • Loading branch information
fofr committed Aug 28, 2014
1 parent e04621f commit 6a117de
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 91 deletions.
4 changes: 0 additions & 4 deletions app/assets/javascripts/application.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/assets/stylesheets/application.css

This file was deleted.

4 changes: 4 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import 'govuk_admin_template';
@import 'formtastic-bootstrap';
@import 'bootstrap_and_overrides';
@import 'data_sets';
File renamed without changes.
94 changes: 24 additions & 70 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,76 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>
<%= yield :page_title %> | GOV.UK Imminence
</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<%= javascript_include_tag "html5" %>
<![endif]-->
<%= stylesheet_link_tag "application", :media => "all" %>
<%= csrf_meta_tag %>
<% content_for :app_title, 'GOV.UK Imminence' %>
<% content_for :page_title, ' | GOV.UK Imminence' %>
<% content_for :head do %>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application' %>
<%= yield :extra_headers %>
</head>
<body>
<% end %>
<header class="navbar navbar-inverse navbar-fixed-top" role="banner">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<%= link_to 'GOV.UK Imminence', admin_root_path, :class => "brand" %>
<nav role="navigation" class="nav-collapse">
<ul class="nav">
<%= nav_link 'All data sets', admin_root_path %>
<li class="divider-vertical"></li>
</ul>
<ul class="nav pull-right">
<li class="dropdown">
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">
Services
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="http://digital.cabinetoffice.gov.uk/">GDS blog</a></li>
<li><a href="http://wiki.digital.cabinet-office.gov.uk/">GDS wiki</a></li>
<li class="divider"></li>
<li><%= link_to 'Analytics', 'https://www.google.com/analytics/web/#dashboard/default/a26179049w50705554p51337955/'%></li>
<li class="divider"></li>
<li><%= link_to 'Sign out', gds_sign_out_path %></li>
</ul>
</li>
</ul>
<p class="navbar-text pull-right">Signed in as <a href="<%= Plek.current.find('signon') %>"><%= current_user %></a></p>
</nav><!--/.nav-collapse -->
</div>
</div>
</header>

<section class="container-fluid" role="main">
<% [:notice, :alert].select { |k| flash[k].present? }.each do |k| %>
<div class="alert <%= k %>">
<%= flash[k] %>
</div>
<% end %>
<% content_for :navbar_items do %>
<%= nav_link 'All data sets', admin_root_path %>
<% end %>
<%= yield %>
<% content_for :navbar_right do %>
<%= link_to current_user.name, Plek.current.find('signon') %>
&bull; <%= link_to 'Sign out', gds_sign_out_path %>
<% end %>
<hr>
<% content_for :content do %>
<% [:notice, :alert].select { |k| flash[k].present? }.each do |k| %>
<div class="alert <%= k %>">
<%= flash[k] %>
</div>
<% end %>
<%= yield %>
<% end %>
<footer>
<p>&copy; GDS. <span class="pull-right">Imminence release: <%= CURRENT_RELEASE_SHA %></span></p>
</footer>
<% content_for :footer_version, CURRENT_RELEASE_SHA %>
</section><!--/.container-fluid -->
<%= javascript_include_tag "application" %>
</body>
</html>
<%# use the govuk_admin_template layout %>
<%= render :template => 'layouts/govuk_admin_template' %>
6 changes: 1 addition & 5 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class Application < Rails::Application
# config.i18n.default_locale = :de
config.i18n.enforce_available_locales = false

config.assets.precompile += %W(
html5.js
)

# Enable the asset pipeline
config.assets.enabled = true
config.assets.version = '1.0'
Expand All @@ -51,7 +47,7 @@ class Application < Rails::Application

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]

config.generators do |g|
g.orm :mongoid
g.template_engine :erb # this could be :haml or whatever
Expand Down
3 changes: 0 additions & 3 deletions vendor/assets/javascripts/html5.js

This file was deleted.

0 comments on commit 6a117de

Please sign in to comment.