metadata_presenter 0.24.0 → 0.27.1
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/helpers/metadata_presenter/application_helper.rb +3 -4
- data/app/views/metadata_presenter/attribute/_body.html.erb +1 -1
- data/app/views/metadata_presenter/component/_components.html.erb +0 -20
- data/app/views/metadata_presenter/component/_content.html.erb +1 -1
- data/app/views/metadata_presenter/page/form.html.erb +1 -1
- data/app/views/metadata_presenter/page/start.html.erb +1 -1
- data/default_metadata/component/content.json +1 -1
- data/default_text/content.json +4 -2
- data/fixtures/version.json +10 -9
- data/lib/metadata_presenter/version.rb +1 -1
- data/schemas/component/content.json +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0b2d2f31a8c12d75f9cf2f3cc9700707bcc9f6f724017ea3a815247c8296b8f
|
4
|
+
data.tar.gz: 9e31cb576a176c3eb47a366527043530fe715a6ced062d8aaa718c5f6c3ffd15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d005a63fb9b095c2312174ab66a0a9e8dfac71086cf7547e4fff44672146ca5c42969bfa31e7170cc93b5f22281a4ea7e080da1ebf8a18f397d579b5bdf541
|
7
|
+
data.tar.gz: 4ebae292b4427aa8c43ad95a1ccd310eaaac6c0de2b64b951a91bc462b9fe89a6eb4509e16f88f8f4dd0fe5f34fb528c4e9885c6774b285488f6076e6a03583b
|
@@ -6,15 +6,14 @@ module MetadataPresenter
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
-
# Renders
|
9
|
+
# Renders html given markdown.
|
10
10
|
#
|
11
11
|
# @example
|
12
|
-
# <%=
|
12
|
+
# <%=to_html '# Some markdown' %>
|
13
13
|
#
|
14
|
-
def
|
14
|
+
def to_html(text)
|
15
15
|
Kramdown::Document.new(text).to_html.html_safe
|
16
16
|
end
|
17
|
-
alias_method :to_markdown, :m
|
18
17
|
|
19
18
|
def default_text(property)
|
20
19
|
MetadataPresenter::DefaultText[property]
|
@@ -18,23 +18,3 @@
|
|
18
18
|
%>
|
19
19
|
</div>
|
20
20
|
<% end %>
|
21
|
-
|
22
|
-
<% if editable? %>
|
23
|
-
<ul class="component-activated-menu govuk-navigation editor-button govuk-button fb-govuk-button">
|
24
|
-
<% if input_components.present? %>
|
25
|
-
<ul>
|
26
|
-
<% input_components.each do |component| %>
|
27
|
-
<li><a href="#add-input-component" data-component-type="<%= component %>"></a>+ Add <%= component %> component</li>
|
28
|
-
<% end %>
|
29
|
-
</ul>
|
30
|
-
<% end %>
|
31
|
-
|
32
|
-
<% if content_components.present? %>
|
33
|
-
<ul>
|
34
|
-
<% content_components.each do |component| %>
|
35
|
-
<li><a href="#add-content-component" data-component-type="<%= component %>">+ Add <%= component %> component</a></li>
|
36
|
-
<% end %>
|
37
|
-
</ul>
|
38
|
-
<% end %>
|
39
|
-
</ul>
|
40
|
-
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<%=
|
1
|
+
<%= to_html(component.content) %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="govuk-grid-column-two-thirds">
|
4
4
|
<% if @page.body %>
|
5
5
|
<p class="govuk-body-l" data-block-id="<%= @page.id %>" data-block-property="body">
|
6
|
-
<%=
|
6
|
+
<%= to_html(@page.body) %>
|
7
7
|
</p>
|
8
8
|
<%- end %>
|
9
9
|
<%= form_tag(reserved_answers_path, method: :post) do %>
|
data/default_text/content.json
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
"section_heading": "[Optional section heading]",
|
3
3
|
"lede": "[Optional lede paragraph]",
|
4
4
|
"body": "[Optional content]",
|
5
|
-
"
|
6
|
-
"hint": "[Optional hint text]"
|
5
|
+
"content": "[Optional content]",
|
6
|
+
"hint": "[Optional hint text]",
|
7
|
+
"option": "[Required option text]",
|
8
|
+
"option_hint": "[Optional hint text]"
|
7
9
|
}
|
data/fixtures/version.json
CHANGED
@@ -178,14 +178,14 @@
|
|
178
178
|
"legend": "Do you like Star Wars?",
|
179
179
|
"items": [
|
180
180
|
{
|
181
|
-
"_id": "do-you-like-star-
|
181
|
+
"_id": "do-you-like-star-wars_radios_1_item_1",
|
182
182
|
"_type": "radio",
|
183
183
|
"label": "Only on weekends",
|
184
184
|
"hint": "Optional item hint",
|
185
185
|
"value": "only-on-weekends"
|
186
186
|
},
|
187
187
|
{
|
188
|
-
"_id": "do-you-like-star-
|
188
|
+
"_id": "do-you-like-star-wars_radios_1_item_2",
|
189
189
|
"_type": "radio",
|
190
190
|
"label": "Hell no!",
|
191
191
|
"hint": "Optional item hint",
|
@@ -236,21 +236,21 @@
|
|
236
236
|
"legend": "What would you like on your burger?",
|
237
237
|
"items": [
|
238
238
|
{
|
239
|
-
"_id": "
|
239
|
+
"_id": "burgers_checkboxes_1_item_1",
|
240
240
|
"_type": "checkbox",
|
241
241
|
"label": "Beef, cheese, tomato",
|
242
242
|
"hint": "Optional item hint",
|
243
243
|
"value": "beef-cheese-tomato"
|
244
244
|
},
|
245
245
|
{
|
246
|
-
"_id": "
|
246
|
+
"_id": "burgers_checkboxes_1_item_2",
|
247
247
|
"_type": "checkbox",
|
248
248
|
"label": "Chicken, cheese, tomato",
|
249
249
|
"hint": "Optional item hint",
|
250
250
|
"value": "chicken-cheese-tomato"
|
251
251
|
},
|
252
252
|
{
|
253
|
-
"_id": "
|
253
|
+
"_id": "burgers_checkboxes_1_item_3",
|
254
254
|
"_type": "checkbox",
|
255
255
|
"label": "Mozzarella, cheddar, feta",
|
256
256
|
"hint": "Optional item hint",
|
@@ -330,7 +330,7 @@
|
|
330
330
|
{
|
331
331
|
"_id": "how-many-lights_content_1",
|
332
332
|
"_type": "content",
|
333
|
-
"
|
333
|
+
"content": "What lights?"
|
334
334
|
}
|
335
335
|
],
|
336
336
|
"url": "how-many-lights"
|
@@ -348,9 +348,10 @@
|
|
348
348
|
{
|
349
349
|
"_id": "check-answers_content_1",
|
350
350
|
"_type": "content",
|
351
|
-
"
|
351
|
+
"content": "Check yourself before you wreck yourself."
|
352
352
|
}
|
353
|
-
]
|
353
|
+
],
|
354
|
+
"extra_components": []
|
354
355
|
},
|
355
356
|
{
|
356
357
|
"_uuid": "b238a22f-c180-48d0-a7d9-8aad2036f1f2",
|
@@ -364,7 +365,7 @@
|
|
364
365
|
{
|
365
366
|
"_id": "confirmation_content_1",
|
366
367
|
"_type": "content",
|
367
|
-
"
|
368
|
+
"content": "Some day I will be the most powerful Jedi ever!"
|
368
369
|
}
|
369
370
|
]
|
370
371
|
}
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"_type": {
|
12
12
|
"const": "content"
|
13
13
|
},
|
14
|
-
"
|
14
|
+
"content": {
|
15
15
|
"title": "Content",
|
16
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
17
|
"type": "string",
|
@@ -25,6 +25,6 @@
|
|
25
25
|
}
|
26
26
|
],
|
27
27
|
"required": [
|
28
|
-
"
|
28
|
+
"content"
|
29
29
|
]
|
30
30
|
}
|
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.27.1
|
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-
|
11
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|