govuk_admin_template 2.3.4 → 2.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdfa85b6555d0e44bd630b9653127e1dec903315
4
- data.tar.gz: baa018f4f29f150d5251d58661300a0ebc6c20f0
3
+ metadata.gz: 05b446a77b5540fe25898d6d3d4ddb8d1d019e98
4
+ data.tar.gz: 41e69f7e09148dd7127e1eaea2a5aff923d8530f
5
5
  SHA512:
6
- metadata.gz: 26dc516c73da55fc2036e5e29b7c91b65aaf78679d9a066b88853d7558a1d2ca84b2c873f36d0d0150fa644f43f79a9afa42a1a047407d015fbf0ff01ef667a4
7
- data.tar.gz: 35fcdc4700f92ed3c3cf899c76f2426ef9c1fcd57888ec78bf9a1e199203adfde394e3a9daeb8f7ecc25ec00d83e12555777503a589e04a2614e9f701d8bc063
6
+ metadata.gz: 5b18bfbc9babd4668e0e83f5809b126a1a0a4088534bfb8e21ecc85fea7bf8779c142510620f8a5cd71f65c71c478ebc318582662b8c9fab5dc98c31706af105
7
+ data.tar.gz: b2b2d9ed13c2a77ae1f728f437f65de8084b711f29ca0f61cd97654431d918adf0fe357d4dac48147cc5632c1250470b03bbfcd17d0851c059be99973f8e6190
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.4.0
2
+
3
+ * Add a table filter partial for re-use in apps
4
+
1
5
  # 2.3.4
2
6
 
3
7
  * Improve Bootstrap 3 in IE7
@@ -0,0 +1,13 @@
1
+ <%
2
+ placeholder ||= "Filter table"
3
+ colspan ||= 100
4
+ filter_id ||= SecureRandom.uuid
5
+ %>
6
+ <tr class="if-no-js-hide table-header-secondary">
7
+ <td colspan="<%= colspan %>">
8
+ <form>
9
+ <label for="<%= filter_id %>" class="rm"><%= placeholder %></label>
10
+ <input id="<%= filter_id %>" type="text" class="form-control normal js-filter-table-input" placeholder="<%= placeholder %>">
11
+ </form>
12
+ </td>
13
+ </tr>
@@ -184,7 +184,8 @@
184
184
  <h2>Tables</h2>
185
185
  <div class="row">
186
186
  <div class="col-md-6 lead">
187
- <p>When using a table with two layers of headings, usually for interacting with table content, <code>table-header</code> and <code>table-header-secondary</code> classes are used.</p>
187
+ <p>Tables should use the Bootstrap 3 classes <code>table table-bordered</code>. The row of table headings should have the admin template class <code>table-headers</code>.</p>
188
+ <p>When using a table with two layers of headings, <code>table-header</code> and <code>table-header-secondary</code> classes can be used.</p>
188
189
  </div>
189
190
  <div class="col-md-6">
190
191
  <table class="table table-bordered table-hover">
@@ -207,9 +208,23 @@
207
208
  </table>
208
209
  </div>
209
210
  </div>
211
+ <h3>Filterable tables</h3>
210
212
  <div class="row">
211
213
  <div class="col-md-6 lead">
212
- <p>Using the <code>filterable-table</code> <a href="https://github.com/alphagov/govuk_admin_template/blob/master/app/assets/javascripts/govuk-admin-template/modules/filterable_table.js">module</a> table rows can be filtered. The module performs a simple match against the content of each row, if there’s no match the row is hidden.</p>
214
+ <p>Using the <a href="https://github.com/alphagov/govuk_admin_template/blob/master/app/assets/javascripts/govuk-admin-template/modules/filterable_table.js">filterable-table module</a> and the <a href="https://github.com/alphagov/govuk_admin_template/tree/master/app/views/govuk_admin_template/_table_filter.html.erb">table_filter partial</a> any table can be filtered. The module performs a simple match against the content of each row, if there’s no match the row is hidden.</p>
215
+ <p>If the class <code>js-open-on-submit</code> is added to a link within a row, then the first link visible with that class will be opened when the user hits <code>ENTER</code>.</p>
216
+ <pre class="add-top-margin">&lt;table class="table table-bordered" data-module="filterable-table"&gt;
217
+ &lt;thead&gt;
218
+ &lt;tr class="table-header"&gt;
219
+ &lt;th&gt;
220
+ Heading
221
+ &lt;/th&gt;
222
+ &lt;/tr&gt;
223
+ &lt;%= render partial: "govuk_admin_template/table_filter",
224
+ locals: {placeholder: "Filter items"} %&gt;
225
+ &lt;/thead&gt;
226
+
227
+ &lt;/table&gt;</pre>
213
228
  </div>
214
229
  <div class="col-md-6">
215
230
  <table class="table table-bordered table-hover" data-module="filterable-table">
@@ -218,14 +233,7 @@
218
233
  <th>Primary header</th>
219
234
  <th style="width: 80px">Number</th>
220
235
  </tr>
221
- <tr class="if-no-js-hide table-header-secondary">
222
- <td colspan="2">
223
- <form>
224
- <label for="table-filter" class="rm">Filter organisations</label>
225
- <input id="table-filter" type="text" class="form-control normal js-filter-table-input" placeholder="Filter table">
226
- </form>
227
- </td>
228
- </tr>
236
+ <%= render partial: 'govuk_admin_template/table_filter', locals: {placeholder: 'Filter fruity things'} %>
229
237
  </thead>
230
238
  <tbody>
231
239
  <tr>
@@ -1,3 +1,3 @@
1
1
  module GovukAdminTemplate
2
- VERSION = "2.3.4"
2
+ VERSION = "2.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_admin_template
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.4
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-09 00:00:00.000000000 Z
11
+ date: 2015-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -166,6 +166,7 @@ files:
166
166
  - app/assets/stylesheets/govuk_admin_template/bootstrap-ie7.scss
167
167
  - app/controllers/govuk_admin_template/application_controller.rb
168
168
  - app/controllers/govuk_admin_template/style_guide_controller.rb
169
+ - app/views/govuk_admin_template/_table_filter.html.erb
169
170
  - app/views/govuk_admin_template/style_guide/index.html.erb
170
171
  - app/views/layouts/govuk_admin_template.html.erb
171
172
  - config/routes.rb