govuk_admin_template 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +11 -0
- data/JAVASCRIPT.md +7 -7
- data/README.md +4 -2
- data/app/assets/javascripts/govuk-admin-template.js +2 -2
- data/app/assets/javascripts/{govuk-admin.js → govuk-admin-template/govuk-admin.js} +0 -0
- data/app/assets/javascripts/{modules → govuk-admin-template/modules}/auto_show_modal.js +0 -0
- data/app/assets/javascripts/{modules → govuk-admin-template/modules}/auto_track_event.js +0 -0
- data/app/assets/javascripts/{modules → govuk-admin-template/modules}/filterable_table.js +0 -0
- data/app/assets/javascripts/{modules → govuk-admin-template/modules}/fixed_table_header.js +0 -0
- data/app/assets/javascripts/{modules → govuk-admin-template/modules}/selectable_table.js +0 -0
- data/app/assets/javascripts/{modules → govuk-admin-template/modules}/toggle.js +0 -0
- data/app/assets/javascripts/{vendor → govuk-admin-template/vendor}/html5.js +0 -0
- data/app/assets/javascripts/{vendor → govuk-admin-template/vendor}/respond.min.js +0 -0
- data/app/assets/javascripts/lte-ie8.js +2 -2
- data/app/assets/stylesheets/govuk_admin_template.scss +7 -7
- data/app/assets/stylesheets/{base.css.scss → govuk_admin_template/base.css.scss} +62 -20
- data/app/assets/stylesheets/{buttons.css.scss → govuk_admin_template/buttons.css.scss} +0 -0
- data/app/assets/stylesheets/{navbar.css.scss → govuk_admin_template/navbar.css.scss} +0 -0
- data/app/assets/stylesheets/{style_guide.css.scss → govuk_admin_template/style_guide.css.scss} +0 -0
- data/app/assets/stylesheets/{tables.css.scss → govuk_admin_template/tables.css.scss} +0 -0
- data/app/assets/stylesheets/{theme.css.scss → govuk_admin_template/theme.css.scss} +0 -0
- data/app/assets/stylesheets/{toggles.css.scss → govuk_admin_template/toggles.css.scss} +0 -0
- data/app/views/govuk_admin_template/style_guide/index.html.erb +78 -5
- data/app/views/layouts/govuk_admin_template.html.erb +2 -0
- data/lib/govuk_admin_template/version.rb +1 -1
- metadata +20 -20
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# 0.0.7
|
2
|
+
|
3
|
+
* Fix visited link styles on bootstrap components
|
4
|
+
* Allow content in footer and bottom of page
|
5
|
+
* Namespace CSS and Javascript files
|
6
|
+
|
7
|
+
# 0.0.6
|
8
|
+
|
9
|
+
* Add `:govuk_date` date format
|
10
|
+
* Fix broken footer HTML
|
11
|
+
|
1
12
|
# 0.0.5
|
2
13
|
|
3
14
|
* Fix gem.files to include all needed files (routes)
|
data/JAVASCRIPT.md
CHANGED
@@ -12,7 +12,7 @@ Javascript modules are specified in markup using `data-` attributes:
|
|
12
12
|
</div>
|
13
13
|
```
|
14
14
|
|
15
|
-
When javascript runs on the page the framework will look for a module at `GOVUKAdmin.Modules.SomeModule`. Note the value of the data attribute has been converted to
|
15
|
+
When javascript runs on the page the framework will look for a module at `GOVUKAdmin.Modules.SomeModule`. Note the value of the data attribute has been converted to _PascalCase_.
|
16
16
|
|
17
17
|
The module will first be instantiated and then will automatically call the module’s `start` method, passing it the element the `data` attribute is on:
|
18
18
|
|
@@ -98,9 +98,9 @@ Found in the [app/assets/javascripts/modules](app/assets/javascripts/modules) di
|
|
98
98
|
|
99
99
|
File | Module | Attribute | Description
|
100
100
|
------ | ------ | --------- | -----------
|
101
|
-
auto_show_modal.js | AutoShowModal | auto-show-modal | Initialise a
|
102
|
-
auto_track_event.js | AutoTrackEvent | auto-track-event | Use data attributes to track events in Google Analytics on page load
|
103
|
-
filterable_table.js | FilterableTable | filterable-table | Filter the contents of a table, showing only matching rows
|
104
|
-
fixed_table_header.js | FixedTableHeader | fixed-table-header | Fix the `<thead>` portion of a table when scrolling offscreen
|
105
|
-
selectable_table.js | SelectableTable | selectable-table | Select rows in a table and perform an action on them
|
106
|
-
toggle.js | Toggle | toggle | A simple toggle
|
101
|
+
auto_show_modal.js | `AutoShowModal` | `auto-show-modal` | Initialise a Bootstrap modal on page load and remove markup when closed
|
102
|
+
auto_track_event.js | `AutoTrackEvent` | `auto-track-event` | Use data attributes to track events in Google Analytics on page load
|
103
|
+
filterable_table.js | `FilterableTable` | `filterable-table` | Filter the contents of a table, showing only matching rows
|
104
|
+
fixed_table_header.js | `FixedTableHeader` | `fixed-table-header` | Fix the `<thead>` portion of a table when scrolling offscreen
|
105
|
+
selectable_table.js | `SelectableTable` | `selectable-table` | Select rows in a table and perform an action on them
|
106
|
+
toggle.js | `Toggle` | `toggle` | A simple toggle
|
data/README.md
CHANGED
@@ -61,11 +61,13 @@ content_for | Description
|
|
61
61
|
------------- | -------------
|
62
62
|
app_title | Name of your admin application
|
63
63
|
content | Main content
|
64
|
-
footer_version (optional) | Text indicating the release, eg commit SHA
|
65
64
|
head | HTML to include in the <head> of your application
|
65
|
+
page_title | Page title
|
66
66
|
navbar_items | A set of HTML list items (`<li>`) forming the primary navigation
|
67
67
|
navbar_right | Text to the right of the nav bar. Logged in user, sign out link, etc
|
68
|
-
|
68
|
+
footer_top (optional) | Footer content before copyright text
|
69
|
+
footer_version (optional) | Text indicating the release, eg commit SHA
|
70
|
+
body_end (optional) | Just before the `</body>` tag
|
69
71
|
|
70
72
|
Example navbar_items:
|
71
73
|
```erb
|
@@ -1,8 +1,8 @@
|
|
1
1
|
//= require jquery
|
2
2
|
//= require jquery_ujs
|
3
3
|
//= require bootstrap
|
4
|
-
//= require govuk-admin
|
5
|
-
//= require_tree ./modules
|
4
|
+
//= require govuk-admin-template/govuk-admin
|
5
|
+
//= require_tree ./govuk-admin-template/modules
|
6
6
|
|
7
7
|
// Find and auto-start modules specified using the data-module="" pattern in markup
|
8
8
|
(function($, GOVUKAdmin) {
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,2 +1,2 @@
|
|
1
|
-
//= require vendor/html5
|
2
|
-
//= require vendor/respond.min
|
1
|
+
//= require govuk-admin-template/vendor/html5
|
2
|
+
//= require govuk-admin-template/vendor/respond.min
|
@@ -1,10 +1,10 @@
|
|
1
1
|
@import 'bootstrap';
|
2
|
-
@import 'buttons'; // overrides bootstrap buttons
|
3
|
-
@import 'theme';
|
4
|
-
@import 'base';
|
2
|
+
@import 'govuk_admin_template/buttons'; // overrides bootstrap buttons
|
3
|
+
@import 'govuk_admin_template/theme';
|
4
|
+
@import 'govuk_admin_template/base';
|
5
5
|
|
6
6
|
// Components
|
7
|
-
@import 'toggles';
|
8
|
-
@import 'navbar';
|
9
|
-
@import 'tables';
|
10
|
-
@import 'style_guide';
|
7
|
+
@import 'govuk_admin_template/toggles';
|
8
|
+
@import 'govuk_admin_template/navbar';
|
9
|
+
@import 'govuk_admin_template/tables';
|
10
|
+
@import 'govuk_admin_template/style_guide';
|
@@ -196,6 +196,60 @@ main a {
|
|
196
196
|
|
197
197
|
}
|
198
198
|
|
199
|
+
/* Visited links in Bootstrap component overrides
|
200
|
+
========================================================================== */
|
201
|
+
|
202
|
+
/* Navigation pills */
|
203
|
+
|
204
|
+
.nav-pills a:visited {
|
205
|
+
color: $link-color;
|
206
|
+
}
|
207
|
+
|
208
|
+
.nav-pills a:visited:hover {
|
209
|
+
color: $link-hover-color;
|
210
|
+
}
|
211
|
+
|
212
|
+
/* Dropdown menu */
|
213
|
+
|
214
|
+
.dropdown-menu a:visited {
|
215
|
+
color: $text-color;
|
216
|
+
}
|
217
|
+
|
218
|
+
/* List groups */
|
219
|
+
|
220
|
+
.list-group a.list-group-item:visited {
|
221
|
+
color: $list-group-link-color;
|
222
|
+
}
|
223
|
+
|
224
|
+
.list-group a.list-group-item:visited:hover {
|
225
|
+
color: $list-group-link-color;
|
226
|
+
}
|
227
|
+
|
228
|
+
.list-group a.list-group-item.active:visited {
|
229
|
+
color: $list-group-active-text-color;
|
230
|
+
}
|
231
|
+
|
232
|
+
.list-group a.list-group-item.active:visited:hover {
|
233
|
+
color: $list-group-active-text-color;
|
234
|
+
}
|
235
|
+
|
236
|
+
/* List groups with content */
|
237
|
+
|
238
|
+
a.list-group-item {
|
239
|
+
|
240
|
+
&:hover .list-group-item-heading {
|
241
|
+
text-decoration: underline;
|
242
|
+
}
|
243
|
+
|
244
|
+
.list-group-item-heading {
|
245
|
+
color: $link-color;
|
246
|
+
}
|
247
|
+
|
248
|
+
}
|
249
|
+
|
250
|
+
/* Further link types
|
251
|
+
========================================================================== */
|
252
|
+
|
199
253
|
.link-muted,
|
200
254
|
.link-muted:visited {
|
201
255
|
color: $gray-light;
|
@@ -207,14 +261,8 @@ main a {
|
|
207
261
|
color: $gray;
|
208
262
|
}
|
209
263
|
|
210
|
-
|
211
|
-
.
|
212
|
-
word-break: break-all;
|
213
|
-
display: inline-block;
|
214
|
-
}
|
215
|
-
|
216
|
-
.glossary-link,
|
217
|
-
.glossary-link:visited {
|
264
|
+
.link-inherit,
|
265
|
+
.link-inherit:visited {
|
218
266
|
color: inherit;
|
219
267
|
text-decoration: underline;
|
220
268
|
}
|
@@ -255,6 +303,12 @@ main a {
|
|
255
303
|
Common content patterns
|
256
304
|
========================================================================== */
|
257
305
|
|
306
|
+
// Force long URLs to break
|
307
|
+
.breakable {
|
308
|
+
word-break: break-all;
|
309
|
+
display: inline-block;
|
310
|
+
}
|
311
|
+
|
258
312
|
.subtitle {
|
259
313
|
margin: -$default-vertical-margin 0 $default-vertical-margin;
|
260
314
|
font-size: $font-size-large;
|
@@ -275,18 +329,6 @@ main a {
|
|
275
329
|
padding-bottom: $default-vertical-margin;
|
276
330
|
}
|
277
331
|
|
278
|
-
a.list-group-item {
|
279
|
-
|
280
|
-
&:hover .list-group-item-heading {
|
281
|
-
text-decoration: underline;
|
282
|
-
}
|
283
|
-
|
284
|
-
.list-group-item-heading {
|
285
|
-
color: $link-color;
|
286
|
-
}
|
287
|
-
|
288
|
-
}
|
289
|
-
|
290
332
|
/* No content
|
291
333
|
========================================================================== */
|
292
334
|
|
File without changes
|
File without changes
|
data/app/assets/stylesheets/{style_guide.css.scss → govuk_admin_template/style_guide.css.scss}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -51,6 +51,26 @@
|
|
51
51
|
</div>
|
52
52
|
<hr>
|
53
53
|
|
54
|
+
<h2>Dates</h2>
|
55
|
+
<div class="row">
|
56
|
+
<p class="col-md-6 lead">
|
57
|
+
The gem includes <code>:govuk_date</code> 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
|
+
</p>
|
59
|
+
<section class="col-md-6">
|
60
|
+
<h2 class="remove-top-margin">Default</h2>
|
61
|
+
<% halloween = Date.new(2013, 10, 31) %>
|
62
|
+
<blockquote><%= halloween %><br />
|
63
|
+
<%= halloween.to_time %>
|
64
|
+
</blockquote>
|
65
|
+
|
66
|
+
<h2>Friendly</h2>
|
67
|
+
<blockquote><%= halloween.to_s(:govuk_date) %><br />
|
68
|
+
<%= halloween.to_time.to_s(:govuk_date) %>
|
69
|
+
</blockquote>
|
70
|
+
</section>
|
71
|
+
</div>
|
72
|
+
<hr>
|
73
|
+
|
54
74
|
<h2>Page headers with subtitles</h2>
|
55
75
|
<div class="row">
|
56
76
|
<p class="col-md-6 lead">Page headers have a single pixel bottom-border. Subtitles - if used - run underneath this.</p>
|
@@ -155,11 +175,64 @@
|
|
155
175
|
<p>Purple <code>:visited</code> styles have been added. These apply to the main content but not to buttons.</p>
|
156
176
|
</div>
|
157
177
|
<div class="col-md-6">
|
158
|
-
<a href="/style" class="link-muted">Muted link</a><br><br>
|
159
|
-
<a href="/style">Visited link</a><br><br>
|
160
|
-
<a href="/style#<%= "#{Time.now.utc.to_i}" %>">Normal link</a><br><br>
|
161
|
-
<a href="/style" class="
|
162
|
-
<a href="/style" class="btn btn-
|
178
|
+
<a href="/style-guide" class="link-muted">Muted link</a><br><br>
|
179
|
+
<a href="/style-guide">Visited link</a><br><br>
|
180
|
+
<a href="/style-guide#<%= "#{Time.now.utc.to_i}" %>">Normal link</a><br><br>
|
181
|
+
An <a href="/style-guide" class="link-inherit">underlined link</a> that inherits its colour<br><br>
|
182
|
+
<a href="/style-guide" class="btn btn-default">Visited button link</a><br><br>
|
183
|
+
<a href="/style-guide" class="btn btn-success">Another visited button link</a><br><br>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<h3>Links in Bootstrap components</h3>
|
188
|
+
<div class="row">
|
189
|
+
<div class="col-md-3">
|
190
|
+
<h4 class="add-bottom-margin">List group with content</h4>
|
191
|
+
<div class="list-group">
|
192
|
+
<a href="/style-guide" class="list-group-item active">
|
193
|
+
<h4 class="list-group-item-heading">Active visited link</h4>
|
194
|
+
<p class="list-group-item-text">Active visited link</p>
|
195
|
+
</a>
|
196
|
+
<a href="/style-guide" class="list-group-item">
|
197
|
+
<h4 class="list-group-item-heading">Visited link</h4>
|
198
|
+
<p class="list-group-item-text">Visited link</p>
|
199
|
+
</a>
|
200
|
+
<a href="/style-guide#<%= "#{Time.now.utc.to_i}" %>" class="list-group-item">
|
201
|
+
<h4 class="list-group-item-heading">Normal link</h4>
|
202
|
+
<p class="list-group-item-text">Normal link</p>
|
203
|
+
</a>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
<div class="col-md-3">
|
207
|
+
<h4 class="add-bottom-margin">List group</h4>
|
208
|
+
<div class="list-group">
|
209
|
+
<a href="/style-guide" class="list-group-item active">
|
210
|
+
Active visited link style
|
211
|
+
</a>
|
212
|
+
<a href="/style-guide" class="list-group-item">Visited link</a>
|
213
|
+
<a href="/style-guide#<%= "#{Time.now.utc.to_i}" %>" class="list-group-item">Normal link</a>
|
214
|
+
</div>
|
215
|
+
</div>
|
216
|
+
<div class="col-md-3">
|
217
|
+
<h4 class="add-bottom-margin">Navigation pills</h4>
|
218
|
+
<ul class="nav nav-pills nav-stacked">
|
219
|
+
<li class="active"><a href="/style-guide">Active visited link</a></li>
|
220
|
+
<li><a href="/style-guide">Visited link</a></li>
|
221
|
+
<li><a href="/style-guide#<%= "#{Time.now.utc.to_i}" %>">Normal link</a></li>
|
222
|
+
</ul>
|
223
|
+
</div>
|
224
|
+
<div class="col-md-3">
|
225
|
+
<h4 class="add-bottom-margin">Dropdowns</h4>
|
226
|
+
<!-- Single button -->
|
227
|
+
<div class="btn-group open">
|
228
|
+
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
229
|
+
Action <span class="caret"></span>
|
230
|
+
</button>
|
231
|
+
<ul class="dropdown-menu" role="menu">
|
232
|
+
<li><a href="/style-guide">Visited link</a></li>
|
233
|
+
<li><a href="/style-guide#<%= "#{Time.now.utc.to_i}" %>">Normal link</a></li>
|
234
|
+
</ul>
|
235
|
+
</div>
|
163
236
|
</div>
|
164
237
|
</div>
|
165
238
|
<hr>
|
@@ -53,11 +53,13 @@
|
|
53
53
|
<%= content_for?(:content) ? yield(:content) : yield %>
|
54
54
|
</main>
|
55
55
|
<footer class="page-footer">
|
56
|
+
<%= yield :footer_top %>
|
56
57
|
<a class="inherit" href="http://www.nationalarchives.gov.uk/information-management/our-services/crown-copyright.htm">© Crown Copyright</a>
|
57
58
|
<% if content_for?(:footer_version) %>
|
58
59
|
<span class="pull-right">Version: <%= yield :footer_version %></span>
|
59
60
|
<% end %>
|
60
61
|
</footer>
|
61
62
|
</section>
|
63
|
+
<%= yield :body_end %>
|
62
64
|
</body>
|
63
65
|
</html>
|
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: 0.0.
|
4
|
+
version: 0.0.7
|
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-
|
12
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -148,24 +148,24 @@ extra_rdoc_files: []
|
|
148
148
|
files:
|
149
149
|
- app/views/layouts/govuk_admin_template.html.erb
|
150
150
|
- app/views/govuk_admin_template/style_guide/index.html.erb
|
151
|
-
- app/assets/stylesheets/theme.css.scss
|
152
|
-
- app/assets/stylesheets/tables.css.scss
|
153
|
-
- app/assets/stylesheets/style_guide.css.scss
|
154
|
-
- app/assets/stylesheets/navbar.css.scss
|
151
|
+
- app/assets/stylesheets/govuk_admin_template/theme.css.scss
|
152
|
+
- app/assets/stylesheets/govuk_admin_template/tables.css.scss
|
153
|
+
- app/assets/stylesheets/govuk_admin_template/style_guide.css.scss
|
154
|
+
- app/assets/stylesheets/govuk_admin_template/navbar.css.scss
|
155
|
+
- app/assets/stylesheets/govuk_admin_template/toggles.css.scss
|
156
|
+
- app/assets/stylesheets/govuk_admin_template/base.css.scss
|
157
|
+
- app/assets/stylesheets/govuk_admin_template/buttons.css.scss
|
155
158
|
- app/assets/stylesheets/govuk_admin_template.scss
|
156
|
-
- app/assets/stylesheets/toggles.css.scss
|
157
|
-
- app/assets/stylesheets/base.css.scss
|
158
|
-
- app/assets/stylesheets/buttons.css.scss
|
159
159
|
- app/assets/images/header-crown.png
|
160
|
-
- app/assets/javascripts/vendor/html5.js
|
161
|
-
- app/assets/javascripts/vendor/respond.min.js
|
162
|
-
- app/assets/javascripts/govuk-admin.js
|
163
|
-
- app/assets/javascripts/modules/selectable_table.js
|
164
|
-
- app/assets/javascripts/modules/filterable_table.js
|
165
|
-
- app/assets/javascripts/modules/fixed_table_header.js
|
166
|
-
- app/assets/javascripts/modules/auto_track_event.js
|
167
|
-
- app/assets/javascripts/modules/toggle.js
|
168
|
-
- app/assets/javascripts/modules/auto_show_modal.js
|
160
|
+
- app/assets/javascripts/govuk-admin-template/vendor/html5.js
|
161
|
+
- app/assets/javascripts/govuk-admin-template/vendor/respond.min.js
|
162
|
+
- app/assets/javascripts/govuk-admin-template/govuk-admin.js
|
163
|
+
- app/assets/javascripts/govuk-admin-template/modules/selectable_table.js
|
164
|
+
- app/assets/javascripts/govuk-admin-template/modules/filterable_table.js
|
165
|
+
- app/assets/javascripts/govuk-admin-template/modules/fixed_table_header.js
|
166
|
+
- app/assets/javascripts/govuk-admin-template/modules/auto_track_event.js
|
167
|
+
- app/assets/javascripts/govuk-admin-template/modules/toggle.js
|
168
|
+
- app/assets/javascripts/govuk-admin-template/modules/auto_show_modal.js
|
169
169
|
- app/assets/javascripts/lte-ie8.js
|
170
170
|
- app/assets/javascripts/govuk-admin-template.js
|
171
171
|
- app/controllers/govuk_admin_template/application_controller.rb
|
@@ -192,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
segments:
|
194
194
|
- 0
|
195
|
-
hash:
|
195
|
+
hash: -1043402677546777694
|
196
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
197
|
none: false
|
198
198
|
requirements:
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
segments:
|
203
203
|
- 0
|
204
|
-
hash:
|
204
|
+
hash: -1043402677546777694
|
205
205
|
requirements: []
|
206
206
|
rubyforge_project:
|
207
207
|
rubygems_version: 1.8.23
|