metadata_presenter 0.13.7 → 0.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a03324e5fcda2cc6e240abf9de25153de6d3420df67c756616e28f3ae1d645b
4
- data.tar.gz: 865b8c040daa4e3d80a83a64131b1e5e57c3a720d99c94dc325b121453ca33df
3
+ metadata.gz: 7ffb7e8496bed231aba14c36fa67fa03c04c444e8b5275c3227088e4a6be59a1
4
+ data.tar.gz: 72dabb210148570e566b0e5009dfa12c13309b0119ed340835d54631006b0b01
5
5
  SHA512:
6
- metadata.gz: de3122090686c934774b46f29b0db345984681d282c0be662ccf3bd8f8ccb6a8f38dcd5d7660e8b11221b6d617176339aa825eadde59bcf8396e2de8ef8787d9
7
- data.tar.gz: ced8509a65f415a2c0e65378ad3ca880d142e526f8c1ab44e2af6e2f45a2f497ee26d09e6a8037e556b724f8adc6589f1a06a2fdb11a163b25ad706d1f821955
6
+ metadata.gz: 3771de2a24501e2809652c95aed00fd75fb775c289f98f25ed4880cb6e37896b48c5c0248e1d298ae3bece2b5beafa1798741208b473e2add0c6f6553dc33808
7
+ data.tar.gz: 5ef374a66d0a6e8e29ac449cbc15bb1435bc2289bd995d089a5212049c9244fba11597ed68a8917ab179725ebcbb7191fd7af6df2637fa0949d294214d805859
data/README.md CHANGED
@@ -48,6 +48,7 @@ that you need to write the following methods in your controller:
48
48
  1. save_user_data
49
49
  2. load_user_data
50
50
  3. editable?
51
+ 4. create_submission
51
52
 
52
53
  The user answers can be accessed via `params[:answers]`.
53
54
 
@@ -76,6 +77,9 @@ mountable app:
76
77
  end
77
78
  ```
78
79
 
80
+ The `create_submission` is related to process the submission in a backend
81
+ service.
82
+
79
83
  ## Generate documentation
80
84
 
81
85
  Run `rake doc` and open the doc/index.html
@@ -4,10 +4,22 @@ module MetadataPresenter
4
4
  @page = service.confirmation_page
5
5
 
6
6
  if @page
7
+ create_submission
7
8
  redirect_to_page @page.url
8
9
  else
9
10
  not_found
10
11
  end
11
12
  end
13
+
14
+ def create_submission
15
+ # The runner is the only app that sends the submission.
16
+ # and it is not needed on the editor app (editing & previewing).
17
+ # So in the Runner we defined the #create_submission in the parent
18
+ # controller and in the Editor we don't.
19
+ #
20
+ if defined? super
21
+ super
22
+ end
23
+ end
12
24
  end
13
25
  end
@@ -27,6 +27,8 @@
27
27
  <%= yield %>
28
28
  </main>
29
29
  </div>
30
+ <%= render template: 'metadata_presenter/footer/footer' %>
31
+
30
32
  <%= javascript_pack_tag 'application' %>
31
33
  <%= javascript_pack_tag 'govuk' %>
32
34
  </body>
@@ -1,10 +1,12 @@
1
- <%=
2
- f.govuk_text_area component.id.to_sym,
3
- label: { text: input_title },
4
- hint: { text: component.hint },
5
- name: "answers[#{component.name}]",
6
- max_chars: component.maxchars,
7
- max_words: component.maxwords,
8
- threshold: component.threshold,
9
- rows: component.rows
10
- %>
1
+ <div class="fb-editable" data-fb-content-type="<%= component._type %>" data-fb-content-id="<%= component_id %>" data-fb-content-data="<%= component.to_json %>">
2
+ <%=
3
+ f.govuk_text_area component.id.to_sym,
4
+ label: { text: input_title },
5
+ hint: { text: component.hint },
6
+ name: "answers[#{component.name}]",
7
+ max_chars: component.maxchars,
8
+ max_words: component.maxwords,
9
+ threshold: component.threshold,
10
+ rows: component.rows
11
+ %>
12
+ </div>
@@ -0,0 +1,19 @@
1
+ <footer class="govuk-footer " role="contentinfo">
2
+ <div class="govuk-width-container ">
3
+ <div class="govuk-footer__meta">
4
+ <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
5
+
6
+ <svg aria-hidden="true" focusable="false" class="govuk-footer__licence-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 483.2 195.7" height="17" width="41">
7
+ <path fill="currentColor" d="M421.5 142.8V.1l-50.7 32.3v161.1h112.4v-50.7zm-122.3-9.6A47.12 47.12 0 0 1 221 97.8c0-26 21.1-47.1 47.1-47.1 16.7 0 31.4 8.7 39.7 21.8l42.7-27.2A97.63 97.63 0 0 0 268.1 0c-36.5 0-68.3 20.1-85.1 49.7A98 98 0 0 0 97.8 0C43.9 0 0 43.9 0 97.8s43.9 97.8 97.8 97.8c36.5 0 68.3-20.1 85.1-49.7a97.76 97.76 0 0 0 149.6 25.4l19.4 22.2h3v-87.8h-80l24.3 27.5zM97.8 145c-26 0-47.1-21.1-47.1-47.1s21.1-47.1 47.1-47.1 47.2 21 47.2 47S123.8 145 97.8 145" />
8
+ </svg>
9
+ <span class="govuk-footer__licence-description">
10
+ All content is available under the
11
+ <a class="govuk-footer__link" href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" rel="license">Open Government Licence v3.0</a>, except where otherwise stated
12
+ </span>
13
+ </div>
14
+ <div class="govuk-footer__meta-item">
15
+ <a class="govuk-footer__link govuk-footer__copyright-logo" href="https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/">© Crown copyright</a>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </footer>
@@ -1,26 +1,34 @@
1
1
  <div class="govuk-grid-row">
2
2
  <div class="govuk-grid-column-two-thirds">
3
3
  <% if @page.section_heading.present? %>
4
- <p class="govuk-caption-l fb-section-heading" data-block-id="<%= @page.id %>" data-block-property="section_heading">
4
+ <p class="fb-section-heading fb-editable govuk-caption-l"
5
+ data-fb-content-type="element"
6
+ data-fb-content-id="page[section_heading]">
5
7
  <%= @page.section_heading %>
6
8
  </p>
7
9
  <% end %>
8
10
 
9
11
  <% if @page.heading.present? %>
10
- <h1 class="govuk-heading-xl" data-block-id="<%= @page.id %>" data-block-property="heading">
12
+ <h1 class="fb-editable govuk-heading-xl"
13
+ data-fb-content-type="element"
14
+ data-fb-content-id="page[heading]">
11
15
  <%= @page.heading %>
12
16
  </h1>
13
17
  <% end %>
14
18
 
15
19
  <% if @page.lede.present? %>
16
- <p class="govuk-body-l" data-block-id="<%= @page.id %>" data-block-property="lede">
20
+ <p class="fb-editable govuk-body-l"
21
+ data-fb-content-type="element"
22
+ data-fb-content-id="page[lede]">
17
23
  <%= @page.lede %>
18
24
  </p>
19
25
  <% end %>
20
26
 
21
27
  <% if @page.body.present? %>
22
- <div class="fb-body govuk-prose-scope" data-block-id="<%= @page.id %>" data-block-property="body">
23
- <p><%= @page.body %></p>
28
+ <div class="fb-body fb-editable govuk-prose-scope"
29
+ data-fb-content-type="content"
30
+ data-fb-content-id="page[body]">
31
+ <%= @page.body %>
24
32
  </div>
25
33
  <% end %>
26
34
 
@@ -51,16 +59,18 @@
51
59
  </div>
52
60
 
53
61
  <% if @page.send_heading.present? %>
54
- <h2 class="fb-send-heading govuk-heading-m" data-block-id="<%= @page.id %>" data-block-property="send_heading">
62
+ <h2 class="fb-send-heading fb-editable govuk-heading-m"
63
+ data-fb-content-type="element"
64
+ data-fb-content-id="page[send_heading]">
55
65
  <%= @page.send_heading %>
56
66
  </h2>
57
67
  <% end %>
58
68
 
59
69
  <% if @page.send_body.present? %>
60
- <div class="fb-send-body" data-block-id="<%= @page.id %>" data-block-property="send_body">
61
- <p>
62
- <%= @page.send_body %>
63
- </p>
70
+ <div class="fb-send-body fb-editable"
71
+ data-fb-content-type="content"
72
+ data-fb-content-id="page[send_body]">
73
+ <%= @page.send_body %>
64
74
  </div>
65
75
  <% end %>
66
76
 
@@ -1,19 +1,25 @@
1
1
  <div class="govuk-panel govuk-panel--confirmation" data-block-id="<%= @page.id %>" data-block-property="heading" data-block-property-class="govuk-panel__body:lede">
2
- <h1 class="govuk-panel__title">
2
+ <h1 class="fb-editable govuk-panel__title"
3
+ data-fb-content-type="element"
4
+ data-fb-content-id="page[heading]">
3
5
  <%= @page.heading %>
4
6
  </h1>
5
7
 
6
8
  <% if @page.lede %>
7
- <div class="govuk-panel__body">
8
- <p><%= @page.lede %></p>
9
- </div>
9
+ <p class="fb-editable govuk-panel__body"
10
+ data-fb-content-type="element"
11
+ data-fb-content-id="page[lede]">
12
+ <%= @page.lede %>
13
+ </p>
10
14
  <% end %>
11
15
  </div>
12
16
 
13
17
  <% if @page.body %>
14
18
  <div class="govuk-grid-row">
15
19
  <div class="govuk-grid-column-two-thirds">
16
- <div class="fb-body govuk-prose-scope" data-block-id="<%= @page.id %>" data-block-property="body">
20
+ <div class="fb-editable fb-body govuk-prose-scope"
21
+ data-fb-content-type="content"
22
+ data-fb-content-id="page[body]">
17
23
  <%= @page.body %>
18
24
  </div>
19
25
  </div>
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '0.13.7'
2
+ VERSION = '0.15.1'
3
3
  end
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.13.7
4
+ version: 0.15.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-02-23 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -256,6 +256,7 @@ files:
256
256
  - app/views/metadata_presenter/component/_radios.html.erb
257
257
  - app/views/metadata_presenter/component/_text.html.erb
258
258
  - app/views/metadata_presenter/component/_textarea.html.erb
259
+ - app/views/metadata_presenter/footer/footer.html.erb
259
260
  - app/views/metadata_presenter/header/show.html.erb
260
261
  - app/views/metadata_presenter/page/checkanswers.html.erb
261
262
  - app/views/metadata_presenter/page/confirmation.html.erb