|
1 | | -<% cache_if edition.topical_event_ids.empty?, "#{taggable_topical_events_cache_digest}-design-system" do %> |
2 | | - <%= render "govuk_publishing_components/components/select_with_search", { |
3 | | - id: "edition_topical_event_ids", |
4 | | - name: "edition[topical_event_ids][]", |
5 | | - include_blank: true, |
6 | | - label: "Topical events", |
7 | | - heading_size: "m", |
8 | | - options: TopicalEvent.order(:name).map do |topical_event| |
9 | | - { |
10 | | - text: topical_event.name, |
11 | | - value: topical_event.id, |
12 | | - selected: edition.topical_event_ids.include?(topical_event.id), |
13 | | - } |
14 | | - end, |
15 | | - multiple: true, |
16 | | - } %> |
17 | | -<% end %> |
18 | | -<% if Flipflop.enabled?(:configurable_document_types) %> |
19 | | - <%= render "govuk_publishing_components/components/select_with_search", { |
20 | | - id: "edition_topical_event_document_ids", |
21 | | - name: "edition[topical_event_document_ids][]", |
22 | | - include_blank: true, |
23 | | - label: "Topical events (experimental)", |
24 | | - hint: "Topical events created via the documents menu will appear here", |
25 | | - heading_size: "m", |
26 | | - options: StandardEdition.where(configurable_document_type: "topical_event").order(:title).map do |topical_event| |
27 | | - { |
28 | | - text: topical_event.title, |
29 | | - value: topical_event.document_id, |
30 | | - selected: edition.topical_event_document_ids.include?(topical_event.document_id), |
31 | | - } |
32 | | - end, |
33 | | - multiple: true, |
34 | | - } %> |
| 1 | +<% if edition.can_be_associated_with_topical_events? %> |
| 2 | + <h2 class="govuk-heading-m">Topical events</h2> |
| 3 | + <% cache_if edition.topical_event_ids.empty?, "#{taggable_topical_events_cache_digest}-design-system" do %> |
| 4 | + <%= render "govuk_publishing_components/components/select_with_search", { |
| 5 | + id: "edition_topical_event_ids", |
| 6 | + name: "edition[topical_event_ids][]", |
| 7 | + include_blank: true, |
| 8 | + label: "Topical events", |
| 9 | + heading_size: "m", |
| 10 | + options: TopicalEvent.order(:name).map do |topical_event| |
| 11 | + { |
| 12 | + text: topical_event.name, |
| 13 | + value: topical_event.id, |
| 14 | + selected: edition.topical_event_ids.include?(topical_event.id), |
| 15 | + } |
| 16 | + end, |
| 17 | + multiple: true, |
| 18 | + } %> |
| 19 | + <% end %> |
| 20 | + <% if Flipflop.enabled?(:configurable_document_types) %> |
| 21 | + <%= render "govuk_publishing_components/components/select_with_search", { |
| 22 | + id: "edition_topical_event_document_ids", |
| 23 | + name: "edition[topical_event_document_ids][]", |
| 24 | + include_blank: true, |
| 25 | + label: "Topical events (experimental)", |
| 26 | + hint: "Topical events created via the documents menu will appear here", |
| 27 | + heading_size: "m", |
| 28 | + options: StandardEdition.where(configurable_document_type: "topical_event").order(:title).map do |topical_event| |
| 29 | + { |
| 30 | + text: topical_event.title, |
| 31 | + value: topical_event.document_id, |
| 32 | + selected: edition.topical_event_document_ids.include?(topical_event.document_id), |
| 33 | + } |
| 34 | + end, |
| 35 | + multiple: true, |
| 36 | + } %> |
| 37 | + <% end %> |
35 | 38 | <% end %> |
0 commit comments