govuk_admin_template 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -11,11 +11,19 @@ This gem provides (via a Rails engine):
|
|
11
11
|
* [CSS helpers and SASS variables](CSS.md) for the admin theme
|
12
12
|
* GOV.UK user friendly date formats
|
13
13
|
|
14
|
+
[Apps using this gem](https://github.com/search?q=govuk_admin_template+path%3AGemfile&type=Code&ref=advsearch&l=) include:
|
15
|
+
* [Transition](https://github.com/alphagov/transition)
|
16
|
+
* [Maslow](https://github.com/alphagov/maslow)
|
17
|
+
* [Support](https://github.com/alphagov/support)
|
18
|
+
* [Travel advice publisher](https://github.com/alphagov/travel-advice-publisher)
|
19
|
+
* [Specialist publisher](https://github.com/alphagov/specialist-publisher)
|
20
|
+
* [Search admin](https://github.com/alphagov/search-admin)
|
21
|
+
|
14
22
|
## Usage
|
15
23
|
|
16
24
|
Firstly, include the gem in your Gemfile, pinned to the appropriate version and run ```bundle```:
|
17
25
|
```ruby
|
18
|
-
gem '
|
26
|
+
gem 'govuk_admin_template', '1.0.0'
|
19
27
|
```
|
20
28
|
|
21
29
|
At the top of `application.scss` include the styles (this provides all the mixins and variables from the gem as well as from bootstrap — [bootstrap mixins](https://github.com/twbs/bootstrap-sass/blob/master/vendor/assets/stylesheets/bootstrap/_mixins.scss)):
|
@@ -80,7 +88,7 @@ Example navbar_items:
|
|
80
88
|
|
81
89
|
### Date formats
|
82
90
|
|
83
|
-
The [gem includes](lib/govuk_admin_template/engine.rb)
|
91
|
+
The [gem includes](lib/govuk_admin_template/engine.rb) date and time formats which match the [recommended style](https://www.gov.uk/design-principles/style-guide/style-points#style-dates-and-times).
|
84
92
|
|
85
93
|
```ruby
|
86
94
|
# 1 January 2013
|
@@ -88,6 +96,15 @@ date.to_s(:govuk_date)
|
|
88
96
|
|
89
97
|
# 1:15pm, 1 January 2013
|
90
98
|
time.to_s(:govuk_date)
|
99
|
+
|
100
|
+
# 1 Jan 2013
|
101
|
+
date.to_s(:govuk_date_short)
|
102
|
+
|
103
|
+
# 1:15pm, 1 Jan 2013
|
104
|
+
time.to_s(:govuk_date_short)
|
105
|
+
|
106
|
+
# 1:15pm
|
107
|
+
time.to_s(:govuk_time)
|
91
108
|
```
|
92
109
|
|
93
110
|
### Environment indicators
|
@@ -54,7 +54,7 @@
|
|
54
54
|
<h2>Dates</h2>
|
55
55
|
<div class="row">
|
56
56
|
<p class="col-md-6 lead">
|
57
|
-
The gem includes
|
57
|
+
The gem includes date and time formats which match the <a href="https://www.gov.uk/design-principles/style-guide/style-points#style-dates-and-times">recommended style</a>.
|
58
58
|
</p>
|
59
59
|
<section class="col-md-6">
|
60
60
|
<h2 class="remove-top-margin">Default</h2>
|
@@ -64,8 +64,17 @@
|
|
64
64
|
</blockquote>
|
65
65
|
|
66
66
|
<h2>Friendly</h2>
|
67
|
-
<blockquote
|
68
|
-
|
67
|
+
<blockquote>
|
68
|
+
<dl class="remove-bottom-margin">
|
69
|
+
<dt class="add-label-margin"><code>:govuk_date</code></dt>
|
70
|
+
<dd><%= halloween.to_s(:govuk_date) %><br />
|
71
|
+
<%= halloween.to_time.to_s(:govuk_date) %></dd>
|
72
|
+
<dt class="add-top-margin add-label-margin"><code>:govuk_date_short</code></dt>
|
73
|
+
<dd><%= halloween.to_s(:govuk_date_short) %><br />
|
74
|
+
<%= halloween.to_time.to_s(:govuk_date_short) %></dd>
|
75
|
+
<dt class="add-top-margin add-label-margin"><code>:govuk_time</code></dt>
|
76
|
+
<dd><%= halloween.to_time.to_s(:govuk_time) %></dd>
|
77
|
+
</dl>
|
69
78
|
</blockquote>
|
70
79
|
</section>
|
71
80
|
</div>
|
@@ -11,10 +11,6 @@
|
|
11
11
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
12
12
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
13
13
|
<script>(function(d){d.className=d.className.replace(/^no-js\b/,'js');}(document.documentElement));</script>
|
14
|
-
<% # HTML5 and bootstrap shims, for <= IE8 support of HTML5 elements %>
|
15
|
-
<!--[if lte IE 8]>
|
16
|
-
<%= javascript_include_tag "lte-ie8" %>
|
17
|
-
<![endif]-->
|
18
14
|
<% # jQuery and Bootstrap %>
|
19
15
|
<%= javascript_include_tag "govuk-admin-template" %>
|
20
16
|
<% if content_for?(:favicon) %>
|
@@ -25,6 +21,14 @@
|
|
25
21
|
%>
|
26
22
|
<% end %>
|
27
23
|
<%= yield :head %>
|
24
|
+
<%
|
25
|
+
# HTML5 and bootstrap shims, for <= IE8 support of HTML5 elements
|
26
|
+
# respond.js must come after CSS (from :head) and media queries so
|
27
|
+
# that rules and styles can be correctly calculated.
|
28
|
+
%>
|
29
|
+
<!--[if lte IE 8]>
|
30
|
+
<%= javascript_include_tag "lte-ie8" %>
|
31
|
+
<![endif]-->
|
28
32
|
</head>
|
29
33
|
<body<% if environment_style %> class="environment-<%= environment_style %>"<% end %>>
|
30
34
|
<header class="
|
@@ -13,8 +13,17 @@ module GovukAdminTemplate
|
|
13
13
|
# 1 January 2013
|
14
14
|
Date::DATE_FORMATS[:govuk_date] = '%-e %B %Y'
|
15
15
|
|
16
|
+
# 1 Jan 2013
|
17
|
+
Date::DATE_FORMATS[:govuk_date_short] = '%-e %b %Y'
|
18
|
+
|
16
19
|
# 1:15pm, 1 January 2013
|
17
20
|
Time::DATE_FORMATS[:govuk_date] = '%-I:%M%P, %-e %B %Y'
|
21
|
+
|
22
|
+
# 1:15pm, 1 Jan 2013
|
23
|
+
Time::DATE_FORMATS[:govuk_date_short] = '%-I:%M%P, %-e %b %Y'
|
24
|
+
|
25
|
+
# 1:15pm
|
26
|
+
Time::DATE_FORMATS[:govuk_time] = '%-I:%M%P'
|
18
27
|
end
|
19
28
|
end
|
20
29
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_admin_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
200
|
version: '0'
|
201
201
|
segments:
|
202
202
|
- 0
|
203
|
-
hash:
|
203
|
+
hash: 3493522119861089579
|
204
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
205
|
none: false
|
206
206
|
requirements:
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
version: '0'
|
210
210
|
segments:
|
211
211
|
- 0
|
212
|
-
hash:
|
212
|
+
hash: 3493522119861089579
|
213
213
|
requirements: []
|
214
214
|
rubyforge_project:
|
215
215
|
rubygems_version: 1.8.23
|