metadata_presenter 0.16.2 → 0.18.3

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
  SHA256:
3
- metadata.gz: '09f9fc6e7ed4404617573ba3531101418a53dc43b731dbbd92faeeb95325db28'
4
- data.tar.gz: ecf8c3777cebe819ce26bc3bd7ba69dce8b8de1bb5ae450658355935a2e69d9a
3
+ metadata.gz: 7d9bac76a996b65ec330ae205c2e9c56f345d4dbb16778b4afc0417877f8b859
4
+ data.tar.gz: 0d68ec790e7763a2ca41e19d38fdeda776e1f531bcbc87fc358809fa1b25ad65
5
5
  SHA512:
6
- metadata.gz: 2bf80b5fb3e1d6f0eaed3baa06626d72ebdd4f8e379e332ede82578140b580b7901cd961a0544e63726ed1c9a6d9aaa52af26f4829730fc23e9df6c78c2a950e
7
- data.tar.gz: f815e89fcf290f637a7ee38da32a0957bb097f7fe25ffd83612152f8dd70fd3aed8d8d9a00eb18b444399b9f3fe01f60a0295547dc50fd2cc9b4d1a7075b1783
6
+ metadata.gz: c6a79356bfbf8fb5f972a2afdf294994aea42c7e11f120b8bc6ec4785ae6bf9f790d573101aac341d9d9363ee84783ed21885aa91be41f10b5f3cd1d4ba5ed75
7
+ data.tar.gz: e1e8532be082d12aba3669eceba01e366d23f1b07258f488455622c18712806548fc888a022d98dd34151c8738d0973f6052c58d053a17afad7f3f4529207ee0
@@ -1,4 +1,4 @@
1
- <footer class="govuk-footer " role="contentinfo">
1
+ <footer class="govuk-footer fb-footer" role="contentinfo">
2
2
  <div class="govuk-width-container ">
3
3
  <div class="govuk-footer__meta">
4
4
  <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
@@ -0,0 +1,56 @@
1
+ <div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
2
+ <div class="govuk-grid-row">
3
+ <div class="govuk-grid-column-two-thirds">
4
+ <% if @page.section_heading -%>
5
+ <p class="fb-editable govuk-caption-l fb-section_heading"
6
+ data-fb-content-type="element"
7
+ data-fb-content-id="page[section_heading]">
8
+ <%= @page.section_heading.html_safe %>
9
+ </p>
10
+ <%- end %>
11
+
12
+ <% if @page.heading %>
13
+ <h1 class="fb-editable govuk-heading-xl"
14
+ data-fb-content-id="page[heading]"
15
+ data-fb-content-type="element">
16
+ <%= @page.heading.html_safe %>
17
+ </h1>
18
+ <% end %>
19
+
20
+ <% if @page.lede %>
21
+ <div class="fb-editable govuk-body-l"
22
+ data-fb-content-id="page[lede]"
23
+ data-fb-content-type="element">
24
+ <%= @page.lede.html_safe %>
25
+ </div>
26
+ <%- end %>
27
+
28
+ <% if @page.body %>
29
+ <div class="fb-editable"
30
+ data-fb-content-id="page[body]"
31
+ data-fb-content-type="content">
32
+ <%= to_markdown(@page.body) %>
33
+ </div>
34
+ <%- end %>
35
+
36
+ <%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
37
+ <%= f.govuk_error_summary %>
38
+
39
+ <% @page.components.each_with_index do |component, index| %>
40
+ <div class="fb-editable"
41
+ data-fb-content-type="<%= component._type %>"
42
+ data-fb-content-id="<%= "page[components[#{index}]]" %>"
43
+ data-fb-content-data="<%= component.to_json %>">
44
+ <%= render partial: component, locals: {
45
+ component: component,
46
+ f: f,
47
+ input_title: main_title(component: component) }
48
+ %>
49
+ </div>
50
+ <% end %>
51
+
52
+ <%= f.govuk_submit(disabled: editable?) %>
53
+ <% end %>
54
+ </div>
55
+ </div>
56
+ </div>
@@ -2,7 +2,7 @@
2
2
  <div class="govuk-grid-row">
3
3
  <div class="govuk-grid-column-two-thirds">
4
4
  <% if @page.body %>
5
- <p class="govuk-body-l" data-block-id="<%= @page.id %>" data-block-property="lede">
5
+ <p class="govuk-body-l" data-block-id="<%= @page.id %>" data-block-property="body">
6
6
  <%= to_markdown(@page.body) %>
7
7
  </p>
8
8
  <%- end %>
@@ -10,7 +10,7 @@
10
10
  <%- end %>
11
11
 
12
12
  <% if @page.heading %>
13
- <h1 class="fb-editable <%= @page.heading_class %>"
13
+ <h1 class="fb-editable govuk-heading-xl"
14
14
  data-fb-content-id="page[heading]"
15
15
  data-fb-content-type="element">
16
16
  <%= @page.heading.html_safe %>
@@ -20,7 +20,7 @@
20
20
  <% if @page.lede %>
21
21
  <div class="fb-editable"
22
22
  data-fb-content-id="page[lede]"
23
- data-fb-content-type="content">
23
+ data-fb-content-type="element">
24
24
  <%= @page.lede.html_safe %>
25
25
  </div>
26
26
  <%- end %>
@@ -0,0 +1,5 @@
1
+ {
2
+ "_id": "component.content",
3
+ "_type": "content",
4
+ "html": "[Optional content]"
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_id": "page.content",
3
+ "_type": "page.content",
4
+ "section_heading": "[Optional section heading]",
5
+ "heading": "Title",
6
+ "lede": "[Optional lede paragraph]",
7
+ "body": "[Optional content]",
8
+ "components": [],
9
+ "url": ""
10
+ }
@@ -319,6 +319,16 @@
319
319
  "section_heading": "That's no moon",
320
320
  "url": "/star-wars-knowledge"
321
321
  },
322
+ {
323
+ "_uuid": "1ed3e4ad-5098-41c9-b4b6-426e89f7804e",
324
+ "_id": "page.how-many-lights",
325
+ "_type": "page.content",
326
+ "section_heading": "Chain of Command",
327
+ "heading": "Tell me how many lights you see",
328
+ "body": "There are four lights!",
329
+ "components": [],
330
+ "url": "how-many-lights"
331
+ },
322
332
  {
323
333
  "_uuid": "e819d0c2-7062-4997-89cf-44d26d098404",
324
334
  "_id": "page._check-answers",
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '0.16.2'
2
+ VERSION = '0.18.3'
3
3
  end
@@ -0,0 +1,30 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/content",
3
+ "_name": "component.content",
4
+ "title": "Content",
5
+ "description": "Display ‘flat’ content, such as text",
6
+ "type": "object",
7
+ "category": [
8
+ "content"
9
+ ],
10
+ "properties": {
11
+ "_type": {
12
+ "const": "content"
13
+ },
14
+ "html": {
15
+ "title": "Content",
16
+ "description": "Content to display - use [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format text or add hyperlinks",
17
+ "type": "string",
18
+ "content": true,
19
+ "multiline": true
20
+ }
21
+ },
22
+ "allOf": [
23
+ {
24
+ "$ref": "definition.component"
25
+ }
26
+ ],
27
+ "required": [
28
+ "html"
29
+ ]
30
+ }
@@ -100,6 +100,8 @@
100
100
  ],
101
101
  "required": [
102
102
  "_uuid",
103
+ "_id",
104
+ "_type",
103
105
  "url"
104
106
  ],
105
107
  "category": [
@@ -48,13 +48,10 @@
48
48
  }
49
49
  },
50
50
  "required": [
51
- "_id",
52
- "_type",
53
51
  "heading",
54
52
  "send_heading",
55
53
  "send_body"
56
54
  ],
57
- "additionalProperties": false,
58
55
  "allOf": [
59
56
  {
60
57
  "$ref": "definition.page.form"
@@ -22,11 +22,8 @@
22
22
  }
23
23
  },
24
24
  "required": [
25
- "_id",
26
- "_type",
27
25
  "heading"
28
26
  ],
29
- "additionalProperties": false,
30
27
  "allOf": [
31
28
  {
32
29
  "$ref": "definition.page.content"
@@ -0,0 +1,23 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/content",
3
+ "_name": "page.content",
4
+ "title": "Content",
5
+ "description": "Display content to users without asking any questions",
6
+ "type": "object",
7
+ "properties": {
8
+ "_type": {
9
+ "const": "page.content"
10
+ }
11
+ },
12
+ "allOf": [
13
+ {
14
+ "$ref": "definition.page.content"
15
+ }
16
+ ],
17
+ "uiCategory": {
18
+ "main": [
19
+ "lede",
20
+ "body"
21
+ ]
22
+ }
23
+ }
@@ -21,6 +21,7 @@
21
21
  }
22
22
  ],
23
23
  "required": [
24
+ "heading",
24
25
  "components"
25
26
  ],
26
27
  "surplus_properties": [
@@ -37,8 +37,6 @@
37
37
  ]
38
38
  },
39
39
  "required": [
40
- "_id",
41
- "_type",
42
40
  "heading",
43
41
  "steps"
44
42
  ]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.2
4
+ version: 0.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Online
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -260,6 +260,7 @@ files:
260
260
  - app/views/metadata_presenter/header/show.html.erb
261
261
  - app/views/metadata_presenter/page/checkanswers.html.erb
262
262
  - app/views/metadata_presenter/page/confirmation.html.erb
263
+ - app/views/metadata_presenter/page/content.html.erb
263
264
  - app/views/metadata_presenter/page/form.html.erb
264
265
  - app/views/metadata_presenter/page/multiplequestions.html.erb
265
266
  - app/views/metadata_presenter/page/singlequestion.html.erb
@@ -268,6 +269,7 @@ files:
268
269
  - config/initializers/schemas.rb
269
270
  - config/routes.rb
270
271
  - default_metadata/component/checkboxes.json
272
+ - default_metadata/component/content.json
271
273
  - default_metadata/component/date.json
272
274
  - default_metadata/component/number.json
273
275
  - default_metadata/component/radios.json
@@ -279,6 +281,7 @@ files:
279
281
  - default_metadata/definition/radio.json
280
282
  - default_metadata/page/checkanswers.json
281
283
  - default_metadata/page/confirmation.json
284
+ - default_metadata/page/content.json
282
285
  - default_metadata/page/multiplequestions.json
283
286
  - default_metadata/page/singlequestion.json
284
287
  - default_metadata/page/start.json
@@ -297,6 +300,7 @@ files:
297
300
  - lib/metadata_presenter/version.rb
298
301
  - lib/tasks/metadata_presenter_tasks.rake
299
302
  - schemas/component/checkboxes.json
303
+ - schemas/component/content.json
300
304
  - schemas/component/date.json
301
305
  - schemas/component/number.json
302
306
  - schemas/component/radios.json
@@ -344,6 +348,7 @@ files:
344
348
  - schemas/link/link.json
345
349
  - schemas/page/checkanswers.json
346
350
  - schemas/page/confirmation.json
351
+ - schemas/page/content.json
347
352
  - schemas/page/multiplequestions.json
348
353
  - schemas/page/singlequestion.json
349
354
  - schemas/page/start.json