metadata_presenter 0.17.1 → 0.18.4

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: b653825d328257b11234319575f8742e666a45f2d8502adf79a1a2896c331f01
4
- data.tar.gz: d9a3fb7541c8cd077ce66ae3b67c3a828ef97faf15719bb5d278a92d7a3f5bab
3
+ metadata.gz: 6eedfdb8be0287c9afecc889ed795de1cbe54803a3f10ee3534c7b94656a724e
4
+ data.tar.gz: 6c16e4986b0ddbbb964e2e66d89350359e8cde221b1bf934ac58d81b621a11a3
5
5
  SHA512:
6
- metadata.gz: 34ba78444c9620972472ad35de61a0090b5653cc585ce4b8bab8c28b09560c61015f8b22a2233f741aaa757bce22214d5c381ab54f47900965b7df0d362781ba
7
- data.tar.gz: 0ecdff6b63586d59599e6cb69720bd73a949cd4be02929e98625e1c1097f2a201067f0453406459ea458dd4f6c813e08a59717c69b93bcd7e97fcfb36268d99c
6
+ metadata.gz: c927b311be5d096e19b5ca2edd50c33afb899f44942cd3a11ea3d396ba504df656165bb808d02c43b10c679e71a86ec24e5718cd98bf86c254393728ccee7691
7
+ data.tar.gz: a6a0690aae68acd1799acdbfb97f03b37dcf68feabc847d8ed8ee549bd2ac71c0043b49bacb3e05ce24aa3c1737fbd94c8a239b7dda68b4197f4247c65bedc6c
@@ -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 %>
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 %>
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 %>
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 %>
@@ -5,7 +5,7 @@
5
5
  <p class="fb-editable govuk-caption-l fb-section_heading"
6
6
  data-fb-content-type="element"
7
7
  data-fb-content-id="page[section_heading]">
8
- <%= @page.section_heading.html_safe %>
8
+ <%= @page.section_heading %>
9
9
  </p>
10
10
  <%- end %>
11
11
 
@@ -5,23 +5,23 @@
5
5
  <p class="fb-editable govuk-caption-l fb-section_heading"
6
6
  data-fb-content-type="element"
7
7
  data-fb-content-id="page[section_heading]">
8
- <%= @page.section_heading.html_safe %>
8
+ <%= @page.section_heading %>
9
9
  </p>
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
- <%= @page.heading.html_safe %>
16
+ <%= @page.heading %>
17
17
  </h1>
18
18
  <% end %>
19
19
 
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">
24
- <%= @page.lede.html_safe %>
23
+ data-fb-content-type="element">
24
+ <%= @page.lede %>
25
25
  </div>
26
26
  <%- end %>
27
27
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "_id": "component.content",
3
3
  "_type": "content",
4
- "html": "Content HTML"
4
+ "html": "[Optional content]"
5
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.17.1'
2
+ VERSION = '0.18.4'
3
3
  end
@@ -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
+ }
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.17.1
4
+ version: 0.18.4
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-15 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
@@ -280,6 +281,7 @@ files:
280
281
  - default_metadata/definition/radio.json
281
282
  - default_metadata/page/checkanswers.json
282
283
  - default_metadata/page/confirmation.json
284
+ - default_metadata/page/content.json
283
285
  - default_metadata/page/multiplequestions.json
284
286
  - default_metadata/page/singlequestion.json
285
287
  - default_metadata/page/start.json
@@ -346,6 +348,7 @@ files:
346
348
  - schemas/link/link.json
347
349
  - schemas/page/checkanswers.json
348
350
  - schemas/page/confirmation.json
351
+ - schemas/page/content.json
349
352
  - schemas/page/multiplequestions.json
350
353
  - schemas/page/singlequestion.json
351
354
  - schemas/page/start.json