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 +4 -4
- data/app/views/metadata_presenter/footer/footer.html.erb +1 -1
- data/app/views/metadata_presenter/page/content.html.erb +56 -0
- data/app/views/metadata_presenter/page/form.html.erb +1 -1
- data/app/views/metadata_presenter/page/start.html.erb +2 -2
- data/default_metadata/component/content.json +5 -0
- data/default_metadata/page/content.json +10 -0
- data/fixtures/version.json +10 -0
- data/lib/metadata_presenter/version.rb +1 -1
- data/schemas/component/content.json +30 -0
- data/schemas/definition/page.json +2 -0
- data/schemas/page/checkanswers.json +0 -3
- data/schemas/page/confirmation.json +0 -3
- data/schemas/page/content.json +23 -0
- data/schemas/page/singlequestion.json +1 -0
- data/schemas/page/start.json +0 -2
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d9bac76a996b65ec330ae205c2e9c56f345d4dbb16778b4afc0417877f8b859
|
4
|
+
data.tar.gz: 0d68ec790e7763a2ca41e19d38fdeda776e1f531bcbc87fc358809fa1b25ad65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a79356bfbf8fb5f972a2afdf294994aea42c7e11f120b8bc6ec4785ae6bf9f790d573101aac341d9d9363ee84783ed21885aa91be41f10b5f3cd1d4ba5ed75
|
7
|
+
data.tar.gz: e1e8532be082d12aba3669eceba01e366d23f1b07258f488455622c18712806548fc888a022d98dd34151c8738d0973f6052c58d053a17afad7f3f4529207ee0
|
@@ -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="
|
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
|
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="
|
23
|
+
data-fb-content-type="element">
|
24
24
|
<%= @page.lede.html_safe %>
|
25
25
|
</div>
|
26
26
|
<%- end %>
|
data/fixtures/version.json
CHANGED
@@ -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",
|
@@ -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
|
+
}
|
@@ -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
|
+
}
|
data/schemas/page/start.json
CHANGED
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.
|
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-
|
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
|