decidim-sortitions 0.27.10 → 0.28.0.rc4

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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/sortitions/sortition_cell.rb +1 -1
  3. data/app/cells/decidim/sortitions/sortition_l_cell.rb +26 -0
  4. data/app/cells/decidim/sortitions/sortition_metadata_cell.rb +66 -0
  5. data/app/commands/decidim/sortitions/admin/create_sortition.rb +2 -2
  6. data/app/commands/decidim/sortitions/admin/destroy_sortition.rb +1 -1
  7. data/app/commands/decidim/sortitions/admin/update_sortition.rb +1 -1
  8. data/app/controllers/decidim/sortitions/admin/sortitions_controller.rb +11 -11
  9. data/app/controllers/decidim/sortitions/sortitions_controller.rb +0 -1
  10. data/app/helpers/decidim/sortitions/admin/sortitions_helper.rb +1 -0
  11. data/app/helpers/decidim/sortitions/sortitions_helper.rb +25 -1
  12. data/app/models/decidim/sortitions/sortition.rb +3 -3
  13. data/app/packs/entrypoints/decidim_sortitions.js +3 -0
  14. data/app/packs/stylesheets/sortitions.scss +31 -0
  15. data/app/permissions/decidim/sortitions/permissions.rb +0 -14
  16. data/app/presenters/decidim/sortitions/admin_log/sortition_presenter.rb +2 -2
  17. data/app/queries/decidim/sortitions/admin/participatory_space_proposal_components.rb +1 -1
  18. data/app/views/decidim/sortitions/admin/sortitions/_form.html.erb +29 -31
  19. data/app/views/decidim/sortitions/admin/sortitions/confirm_destroy.html.erb +24 -15
  20. data/app/views/decidim/sortitions/admin/sortitions/edit.html.erb +26 -22
  21. data/app/views/decidim/sortitions/admin/sortitions/index.html.erb +47 -54
  22. data/app/views/decidim/sortitions/admin/sortitions/new.html.erb +16 -10
  23. data/app/views/decidim/sortitions/admin/sortitions/show.html.erb +42 -46
  24. data/app/views/decidim/sortitions/sortitions/_proposal.html.erb +1 -1
  25. data/app/views/decidim/sortitions/sortitions/_results_count.html.erb +3 -3
  26. data/app/views/decidim/sortitions/sortitions/_sortitions.html.erb +10 -11
  27. data/app/views/decidim/sortitions/sortitions/_tags.html.erb +0 -1
  28. data/app/views/decidim/sortitions/sortitions/index.html.erb +14 -17
  29. data/app/views/decidim/sortitions/sortitions/index.js.erb +0 -5
  30. data/app/views/decidim/sortitions/sortitions/show.html.erb +123 -118
  31. data/config/locales/ar.yml +2 -24
  32. data/config/locales/bg.yml +1 -144
  33. data/config/locales/ca.yml +10 -21
  34. data/config/locales/cs.yml +7 -22
  35. data/config/locales/de.yml +10 -21
  36. data/config/locales/el.yml +6 -19
  37. data/config/locales/en.yml +14 -25
  38. data/config/locales/es-MX.yml +9 -20
  39. data/config/locales/es-PY.yml +9 -20
  40. data/config/locales/es.yml +9 -20
  41. data/config/locales/eu.yml +25 -32
  42. data/config/locales/fi-plain.yml +7 -20
  43. data/config/locales/fi.yml +27 -40
  44. data/config/locales/fr-CA.yml +7 -20
  45. data/config/locales/fr.yml +10 -21
  46. data/config/locales/ga-IE.yml +0 -6
  47. data/config/locales/gl.yml +2 -22
  48. data/config/locales/hu.yml +2 -22
  49. data/config/locales/id-ID.yml +2 -19
  50. data/config/locales/is-IS.yml +2 -16
  51. data/config/locales/it.yml +2 -21
  52. data/config/locales/ja.yml +7 -19
  53. data/config/locales/lt.yml +6 -22
  54. data/config/locales/lv.yml +2 -22
  55. data/config/locales/nl.yml +2 -21
  56. data/config/locales/no.yml +2 -21
  57. data/config/locales/pl.yml +2 -28
  58. data/config/locales/pt-BR.yml +3 -25
  59. data/config/locales/pt.yml +2 -21
  60. data/config/locales/ro-RO.yml +5 -21
  61. data/config/locales/ru.yml +2 -22
  62. data/config/locales/sk.yml +2 -23
  63. data/config/locales/sr-CS.yml +0 -6
  64. data/config/locales/sv.yml +7 -26
  65. data/config/locales/tr-TR.yml +3 -21
  66. data/config/locales/uk.yml +2 -22
  67. data/config/locales/zh-CN.yml +2 -20
  68. data/config/locales/zh-TW.yml +5 -18
  69. data/lib/decidim/sortitions/component.rb +5 -7
  70. data/lib/decidim/sortitions/engine.rb +8 -3
  71. data/lib/decidim/sortitions/seeds.rb +24 -0
  72. data/lib/decidim/sortitions/test/factories.rb +11 -16
  73. data/lib/decidim/sortitions/version.rb +1 -1
  74. metadata +28 -31
  75. data/app/cells/decidim/sortitions/sortition_m/data.erb +0 -15
  76. data/app/cells/decidim/sortitions/sortition_m/footer.erb +0 -13
  77. data/app/cells/decidim/sortitions/sortition_m_cell.rb +0 -55
  78. data/app/controllers/decidim/sortitions/widgets_controller.rb +0 -30
  79. data/app/packs/stylesheets/decidim/sortitions/_sortitions.scss +0 -49
  80. data/app/views/decidim/sortitions/sortition_widgets/show.html.erb +0 -4
  81. data/app/views/decidim/sortitions/sortitions/_filters.html.erb +0 -39
  82. data/app/views/decidim/sortitions/sortitions/_filters_small_view.html.erb +0 -18
  83. data/app/views/decidim/sortitions/sortitions/_sortitions_count.html.erb +0 -1
  84. data/config/locales/he-IL.yml +0 -1
  85. data/decidim-sortitions.gemspec +0 -32
  86. data/lib/tasks/decidim/.keep +0 -0
@@ -1,64 +1,57 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
  <div class="card">
3
- <div class="card-divider">
4
- <h2 class="card-title">
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
5
5
  <%= t(".title") %>
6
- <div class="button--title">
7
- <% if allowed_to? :create, :sortition %>
8
- <%= link_to t("actions.new", scope: "decidim.sortitions.admin", name: t("models.sortition.name", scope: "decidim.sortitions.admin")), new_sortition_path, class: "button tiny button--simple" %>
9
- <% end %>
10
- </div>
6
+ <% if allowed_to? :create, :sortition %>
7
+ <%= link_to t("actions.new_sortition", scope: "decidim.sortitions.admin"), new_sortition_path, class: "button button__sm button__secondary" %>
8
+ <% end %>
9
+ <%= render partial: "decidim/admin/components/resource_action" %>
11
10
  </h2>
12
11
  </div>
12
+ <div class="table-scroll">
13
+ <table class="table-list">
14
+ <thead>
15
+ <tr>
16
+ <th><%= t("models.sortition.fields.reference", scope: "decidim.sortitions.admin") %></th>
17
+ <th><%= t("models.sortition.fields.title", scope: "decidim.sortitions.admin") %></th>
18
+ <th><%= t("models.sortition.fields.created_at", scope: "decidim.sortitions.admin") %></th>
19
+ <th class="actions"></th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <% sortitions.each do |sortition| %>
24
+ <tr>
25
+ <td><%= sortition.reference %></td>
26
+ <td>
27
+ <% if allowed_to? :update, :sortition, sortition: sortition %>
28
+ <%= link_to decidim_html_escape(translated_attribute(sortition.title)), edit_sortition_path(sortition) %>
29
+ <% else %>
30
+ <%= decidim_html_escape(translated_attribute(sortition.title)) %>
31
+ <% end %>
32
+ </td>
33
+ <td><%= l sortition.created_at, format: :short %></td>
34
+ <td class="table-list__actions">
35
+ <% if allowed_to? :update, :sortition, sortition: sortition %>
36
+ <%= icon_link_to "pencil-line", edit_sortition_path(sortition), t("actions.edit", scope: "decidim.sortitions.admin"), class: "action-icon--edit" %>
37
+ <% else %>
38
+ <span class="action-space icon"></span>
39
+ <% end %>
13
40
 
14
- <div class="card-section">
15
- <div class="table-scroll">
16
- <table class="table-list">
17
- <thead>
18
- <tr>
19
- <th><%= t("models.sortition.fields.reference", scope: "decidim.sortitions.admin") %></th>
20
- <th><%= t("models.sortition.fields.title", scope: "decidim.sortitions.admin") %></th>
21
- <th><%= t("models.sortition.fields.created_at", scope: "decidim.sortitions.admin") %></th>
22
- <th class="actions"></th>
23
- </tr>
24
- </thead>
25
- <tbody>
26
- <% sortitions.each do |sortition| %>
27
- <tr>
28
- <td><%= sortition.reference %></td>
29
- <td><%= decidim_html_escape(translated_attribute(sortition.title)) %></td>
30
- <td><%= l sortition.created_at, format: :short %></td>
31
- <td class="table-list__actions">
32
- <%= icon_link_to "eye",
33
- sortition_path(sortition),
34
- t("actions.show", scope: "decidim.sortitions.admin"),
35
- class: "action-icon--preview" %>
36
-
37
- <% if allowed_to? :update, :sortition, sortition: sortition %>
38
- <%= icon_link_to "pencil",
39
- edit_sortition_path(sortition),
40
- t("actions.edit", scope: "decidim.sortitions.admin"),
41
- class: "action-icon--edit" %>
42
- <% else %>
43
- <span class="action-space icon"></span>
44
- <% end %>
41
+ <%= icon_link_to "eye-line", sortition_path(sortition), t("actions.show", scope: "decidim.sortitions.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %>
45
42
 
46
- <%= resource_permissions_link(sortition) %>
43
+ <%= resource_permissions_link(sortition) %>
47
44
 
48
- <% if allowed_to? :destroy, :sortition, sortition: sortition %>
49
- <%= icon_link_to "circle-x",
50
- confirm_destroy_sortition_path(sortition),
51
- t("actions.destroy", scope: "decidim.sortitions.admin"),
52
- class: "action-icon--remove" %>
53
- <% else %>
54
- <span class="action-space icon"></span>
55
- <% end %>
56
- </td>
57
- </tr>
58
- <% end %>
59
- </tbody>
60
- </table>
61
- <%= paginate sortitions, theme: "decidim" %>
62
- </div>
45
+ <% if allowed_to? :destroy, :sortition, sortition: sortition %>
46
+ <%= icon_link_to "delete-bin-line", confirm_destroy_sortition_path(sortition), t("actions.destroy", scope: "decidim.sortitions.admin"), class: "action-icon--remove" %>
47
+ <% else %>
48
+ <span class="action-space icon"></span>
49
+ <% end %>
50
+ </td>
51
+ </tr>
52
+ <% end %>
53
+ </tbody>
54
+ </table>
63
55
  </div>
64
56
  </div>
57
+ <%= decidim_paginate sortitions %>
@@ -1,12 +1,18 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
- <h2 class="process-title-summary">
3
- <%= t ".title" %>
4
- </h2>
5
-
6
- <%= decidim_form_for(@form, html: { class: "form new_sortition" }) do |f| %>
7
- <%= render partial: "form", object: f %>
8
-
9
- <div class="button--double form-general-submit">
10
- <%= f.submit t(".create"), data: { confirm: t(".confirm") } %>
2
+ <div class="item_show__header">
3
+ <h2 class="item_show__header-title">
4
+ <%= t ".title" %>
5
+ </h2>
6
+ </div>
7
+ <div class="item__edit item__edit-1col">
8
+ <div class="item__edit-form">
9
+ <%= decidim_form_for(@form, html: { class: "form-defaults form new_sortition" }) do |f| %>
10
+ <%= render partial: "form", object: f %>
11
+ <div class="item__edit-sticky">
12
+ <div class="item__edit-sticky-container">
13
+ <%= f.submit t(".create"), data: { confirm: t(".confirm") }, class: "button button__sm button__secondary" %>
14
+ </div>
15
+ </div>
16
+ <% end %>
11
17
  </div>
12
- <% end %>
18
+ </div>
@@ -1,56 +1,52 @@
1
1
  <% add_decidim_page_title(translated_attribute(sortition.title)) %>
2
2
  <div class="card" id="sortition">
3
- <div class="card-divider">
4
- <h2 class="card-title">
3
+ <div class="item_show__header">
4
+ <h2 class="item_show__header-title">
5
5
  <%= decidim_html_escape(translated_attribute(sortition.title)) %>
6
6
  </h2>
7
7
  </div>
8
- <div class="card-section">
9
- <div class="table-scroll">
10
- <table class="table-list sortition">
11
- <thead>
12
- <tr>
13
- <th><%= t("models.sortition.fields.request_timestamp", scope: "decidim.sortitions.admin") %></th>
14
- <th><%= t("models.sortition.fields.dice", scope: "decidim.sortitions.admin") %></th>
15
- <th><%= t("models.sortition.fields.target_items", scope: "decidim.sortitions.admin") %></th>
16
- <th><%= t("models.sortition.fields.category", scope: "decidim.sortitions.admin") %></th>
17
- <th><%= t("models.sortition.fields.decidim_proposals_component", scope: "decidim.sortitions.admin") %></th>
18
- <th><%= t("models.sortition.fields.seed", scope: "decidim.sortitions.admin") %></th>
19
- <th></th>
20
- </tr>
21
- </thead>
22
- <tbody>
23
- <tr>
24
- <td><%= l sortition.request_timestamp, format: :long %></td>
25
- <td><%= sortition.dice %></td>
26
- <td><%= sortition.target_items %></td>
27
- <td><%= sortition_category sortition %></td>
28
- <td><%= translated_attribute sortition.decidim_proposals_component.name %></td>
29
- <td><%= sortition.seed %></td>
30
- <td></td>
31
- </tr>
32
- </tbody>
33
- </table>
34
- </div>
8
+ <div class="table-scroll">
9
+ <table class="table-list sortition">
10
+ <thead>
11
+ <tr>
12
+ <th><%= t("models.sortition.fields.request_timestamp", scope: "decidim.sortitions.admin") %></th>
13
+ <th><%= t("models.sortition.fields.dice", scope: "decidim.sortitions.admin") %></th>
14
+ <th><%= t("models.sortition.fields.target_items", scope: "decidim.sortitions.admin") %></th>
15
+ <th><%= t("models.sortition.fields.category", scope: "decidim.sortitions.admin") %></th>
16
+ <th><%= t("models.sortition.fields.decidim_proposals_component", scope: "decidim.sortitions.admin") %></th>
17
+ <th><%= t("models.sortition.fields.seed", scope: "decidim.sortitions.admin") %></th>
18
+ <th></th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <tr>
23
+ <td><%= l sortition.request_timestamp, format: :long %></td>
24
+ <td><%= sortition.dice %></td>
25
+ <td><%= sortition.target_items %></td>
26
+ <td><%= sortition_category sortition %></td>
27
+ <td><%= translated_attribute sortition.decidim_proposals_component.name %></td>
28
+ <td><%= sortition.seed %></td>
29
+ <td></td>
30
+ </tr>
31
+ </tbody>
32
+ </table>
35
33
  </div>
36
- <div class="card-section">
37
- <div class="table-scroll">
38
- <table class="table-list proposals">
39
- <thead>
34
+ <div class="table-scroll">
35
+ <table class="table-list proposals">
36
+ <thead>
37
+ <tr>
38
+ <th><%= t ".selected_proposals" %></th>
39
+ <th></th>
40
+ </tr>
41
+ </thead>
42
+ <tbody>
43
+ <% sortition.proposals.each do |proposal| %>
40
44
  <tr>
41
- <th><%= t ".selected_proposals" %></th>
42
- <th></th>
45
+ <td><%= decidim_html_escape(present(proposal).title).html_safe %></td>
46
+ <td></td>
43
47
  </tr>
44
- </thead>
45
- <tbody>
46
- <% sortition.proposals.each do |proposal| %>
47
- <tr>
48
- <td><%= decidim_html_escape(present(proposal).title).html_safe %></td>
49
- <td></td>
50
- </tr>
51
- <% end %>
52
- </tbody>
53
- </table>
54
- </div>
48
+ <% end %>
49
+ </tbody>
50
+ </table>
55
51
  </div>
56
52
  </div>
@@ -1 +1 @@
1
- <%= card_for proposal %>
1
+ <%= card_for proposal, url_extra_params: { included_in: sortition.to_gid } %>
@@ -1,8 +1,8 @@
1
- <div id="sortition-<%= sortition.id %>-results-count" class="card__support__data">
2
- <span class="extra__suport-number">
1
+ <div id="sortition-<%= sortition.id %>-results-count">
2
+ <span class="sortition__aside__count-number">
3
3
  <%= sortition.selected_proposals.count %>
4
4
  </span>
5
- <span class="extra__suport-text">
5
+ <span class="sortition__aside__count-text">
6
6
  <%= t(".count", count: sortition.selected_proposals.count) %>
7
7
  </span>
8
8
  </div>
@@ -1,14 +1,13 @@
1
- <div class="collection-sort-controls row small-up-1 medium-up-3 card-grid">
2
- <div class="column">
3
- <%= order_selector available_orders, i18n_scope: "decidim.sortitions.sortitions.orders" %>
4
- </div>
1
+ <% if @sortitions.any? %>
2
+ <h2 class="h5 md:h3 decorator"><%= t("count", scope: "decidim.sortitions.sortitions.sortitions_count", count: @sortitions.total_count) %></h2>
3
+
4
+ <%= order_selector available_orders, i18n_scope: "decidim.sortitions.sortitions.orders" %>
5
5
 
6
- <div class="column">
7
- <%= render partial: "decidim/shared/results_per_page" %>
6
+ <div class="card__list-list">
7
+ <%= render @sortitions %>
8
8
  </div>
9
- </div>
10
9
 
11
- <div class="row small-up-1 medium-up-2 card-grid">
12
- <%= render @sortitions %>
13
- </div>
14
- <%= decidim_paginate @sortitions %>
10
+ <%= decidim_paginate @sortitions %>
11
+ <% else %>
12
+ <%= cell "decidim/announcement", t("empty", scope: "decidim.sortitions.sortitions.index") %>
13
+ <% end %>
@@ -1,4 +1,3 @@
1
-
2
1
  <ul class="tags tags--sortition">
3
2
  <li>
4
3
  <%= link_to t("filters.active", scope: "decidim.sortitions.sortitions"),
@@ -1,18 +1,15 @@
1
- <div class="row columns">
2
- <div class="title-action">
3
- <h2 id="sortitions-count" class="title-action__title section-heading">
4
- <%= render partial: "sortitions_count" %>
5
- </h2>
6
- </div>
7
- </div>
8
- <div class="row">
9
- <div class="columns mediumlarge-4 large-3">
10
- <%= render partial: "filters_small_view" %>
11
- <div class="card card--secondary show-for-mediumlarge">
12
- <%= render partial: "filters" %>
13
- </div>
14
- </div>
15
- <div id="sortitions" class="columns mediumlarge-8 large-9" aria-live="polite">
1
+ <% add_decidim_page_title component_name %>
2
+
3
+ <% content_for :aside do %>
4
+ <h1 class="title-decorator"><%= component_name %></h1>
5
+
6
+ <%= render layout: "decidim/shared/filters", locals: { filter_sections: filter_sections_sortitions, search_variable: :search_text_cont, skip_to_id: "sortitions" } do %>
7
+ <%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= render layout: "layouts/decidim/shared/layout_two_col" do %>
12
+ <section id="sortitions" class="layout-main__section layout-main__heading">
16
13
  <%= render partial: "sortitions" %>
17
- </div>
18
- </div>
14
+ </section>
15
+ <% end %>
@@ -1,10 +1,5 @@
1
1
  var $sortitions = $('#sortitions');
2
- var $sortitionsCount = $('#sortitions-count');
3
2
  var $orderFilterInput = $('.order_filter');
4
3
 
5
4
  $sortitions.html('<%= j(render partial: "sortitions").strip.html_safe %>');
6
- $sortitionsCount.html('<%= j(render partial: "sortitions_count").strip.html_safe %>');
7
5
  $orderFilterInput.val('<%= order %>');
8
-
9
- var $dropdownMenu = $('.dropdown.menu', $sortitions);
10
- $dropdownMenu.foundation();
@@ -1,139 +1,144 @@
1
1
  <% add_decidim_meta_tags({
2
- description: decidim_sanitize_editor(translated_attribute(sortition.additional_info)),
3
- title: decidim_html_escape(translated_attribute(sortition.title)),
4
- url: sortition_url(sortition.to_param)
5
- }) %>
2
+ description: decidim_sanitize_editor(translated_attribute(sortition.additional_info)),
3
+ title: decidim_html_escape(translated_attribute(sortition.title)),
4
+ url: sortition_url(sortition.to_param)
5
+ }) %>
6
6
 
7
- <div class="row column">
8
- <div class="callout success">
9
- <p><%= t ".introduction", reference: sortition.id, target_items: sortition.target_items %></p>
10
- </div>
11
- </div>
7
+ <%
8
+ edit_link(
9
+ resource_locator(sortition).edit,
10
+ :update,
11
+ :sortition,
12
+ sortition:
13
+ )
14
+ %>
12
15
 
13
- <div class="row column view-header">
16
+ <%= append_javascript_pack_tag "decidim_sortitions" %>
17
+ <%= append_stylesheet_pack_tag "decidim_sortitions" %>
14
18
 
15
- <div class="m-bottom">
16
- <%= link_to :sortitions, class: "small hollow" do %>
17
- <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
18
- <%= t(".back") %>
19
- <% end %>
20
- </div>
19
+ <%= render layout: "layouts/decidim/shared/layout_item", locals: { back_path: :sortitions, commentable: sortition } do %>
20
+ <%= cell("decidim/announcement", t("introduction", scope: "decidim.sortitions.sortitions.show", reference: sortition.id, target_items: sortition.target_items), callout_class: "secondary") %>
21
21
 
22
- <h2 class="heading2"><%= decidim_html_escape(translated_attribute(sortition.title)) %></h2>
23
- <div class="author-data">
24
- <%= render partial: "sortition_author", locals: { sortition: sortition } %>
25
- </div>
26
- </div>
27
-
28
- <div class="row">
29
- <div class="columns section view-side mediumlarge-4 mediumlarge-push-8 large-3 large-push-9">
30
- <div class="card extra">
31
- <div class="card__content">
32
- <%= render partial: "results_count", locals: { sortition: sortition } %>
33
- </div>
22
+ <section class="layout-main__section layout-main__heading">
23
+ <h1 class="h1 decorator mb-4">
24
+ <%= decidim_html_escape(translated_attribute(sortition.title)) %>
25
+ </h1>
26
+ <div class="layout-author">
27
+ <%= cell "decidim/author", present(sortition.author), context_actions: [:date], from: sortition, layout: :compact %>
28
+ <% if sortition.author&.deleted? %>
29
+ <span class="label alert">
30
+ <%= t("deleted", scope: "decidim.sortitions.sortitions.sortition_author") %>
31
+ </span>
32
+ <% end %>
34
33
  </div>
35
- <%= resource_reference(sortition) %>
36
- <%= render partial: "decidim/shared/share_modal" %>
37
- <%= embed_modal_for sortition_widget_url(sortition, format: :js) %>
38
- </div>
39
-
40
- <div class="columns mediumlarge-8 mediumlarge-pull-4">
41
- <div class="section">
34
+ </section>
35
+ <section class="layout-main__section">
36
+ <div class="editor-content">
42
37
  <%= decidim_sanitize_editor_admin translated_attribute sortition.additional_info %>
43
38
  </div>
44
- </div>
45
- </div>
46
-
47
- <% if sortition.cancelled? %>
48
- <div class="row column">
49
- <div class="title-action">
50
- <h2 class="title-action__title section-heading"><%= t ".cancelled" %></h2>
51
- </div>
52
- <div class=section>
53
- <div class="author-data">
54
- <%= render partial: "sortition_cancel_author", locals: { sortition: sortition } %>
39
+ </section>
40
+ <section class="layout-main__section">
41
+ <h2 class="h3">
42
+ <%= t("witnesses", scope: "decidim.sortitions.sortitions.show") %>
43
+ </h2>
44
+ <div class="editor-content">
45
+ <%= decidim_sanitize_editor translated_attribute sortition.witnesses %>
55
46
  </div>
56
- </div>
57
- <div class=section>
58
- <%= decidim_sanitize_editor translated_attribute sortition.cancel_reason %>
59
- </div>
60
- </div>
61
- <% end %>
47
+ </section>
62
48
 
63
- <div class="row column">
64
- <div class="title-action">
65
- <h2 class="title-action__title section-heading"><%= t ".witnesses" %></h2>
66
- </div>
67
- <div class="section">
68
- <%= decidim_sanitize_editor translated_attribute sortition.witnesses %>
69
- </div>
70
- </div>
49
+ <% if sortition&.proposals %>
50
+ <section class="layout-main__section">
51
+ <h2 id="proposals-count" class="h3 mb-4">
52
+ <%= t("proposals_selected_by_sortition", scope: "decidim.sortitions.sortitions.show") %>
53
+ </h2>
54
+ <div id="proposals">
55
+ <%= render partial: "proposal", collection: sortition.proposals %>
56
+ </div>
57
+ </section>
58
+ <% end %>
71
59
 
72
- <% if sortition&.proposals %>
73
- <div class="row columns">
74
- <div class="title-action">
75
- <h2 id="proposals-count" class="title-action__title section-heading">
76
- <%= t ".proposals_selected_by_sortition" %>
60
+ <% if sortition.cancelled? %>
61
+ <section class="layout-main__section">
62
+ <h2 class="h3 mt-8 mb-4">
63
+ <%= t("cancelled", scope: "decidim.sortitions.sortitions.show") %>
77
64
  </h2>
78
- </div>
79
- <div class="row">
80
- <div id="proposals" class="columns mediumlarge-12 large-12">
81
- <div class="row small-up-1 medium-up-2 large-up-3 card-grid">
82
- <%= render partial: "proposal", collection: sortition.proposals %>
83
- </div>
65
+ <div class="layout-author">
66
+ <%= cell "decidim/author", present(sortition.cancelled_by_user), context_actions: [:cancelled_on], from: sortition, layout: :compact %>
67
+ <% if sortition.cancelled_by_user&.deleted? %>
68
+ <span class="label alert">
69
+ <%= t("deleted", scope: "decidim.sortitions.sortitions.sortition_author") %>
70
+ </span>
71
+ <% end %>
84
72
  </div>
85
- </div>
86
- </div>
87
- <% end %>
73
+ <%= cell("decidim/announcement", decidim_sanitize_editor(translated_attribute(sortition.cancel_reason)), callout_class: "alert") %>
74
+ </section>
75
+ <% end %>
88
76
 
89
- <div class="row column">
90
- <section class="extended" id="sortition-details">
91
- <div class="row column">
92
- <h4 class="section-heading"><%= t ".sortition_reproducibility_details" %></h4>
93
- </div>
94
- <div class=row>
95
- <div class="columns small-centered mediumlarge-12 large-12 sortition-details">
96
- <div class="sortition-details-item">
97
- <span class="sortition-details-title sortition-details-text"><%= t ".dice_result" %></span>
98
- <span class=sortition-details-text><%= sortition.dice %></span>
99
- </div>
77
+ <section class="layout-main__section layout-main__buttons" data-buttons>
78
+ <%= cell "decidim/comments_button", nil %>
79
+ </section>
100
80
 
101
- <div class="sortition-details-item">
102
- <span class="sortition-details-title sortition-details-text"><%= t ".time_seed" %></span>
103
- <span class=sortition-details-text><%= sortition.request_timestamp.to_i %></span>
81
+ <% content_for :aside do %>
82
+ <section class="layout-aside__section">
83
+ <%= render partial: "results_count", locals: { sortition: } %>
84
+ </section>
85
+ <section class="layout-aside__section">
86
+ <div class="text-sm text-gray-2 uppercase font-semibold mb-4 ">
87
+ <%= t("sortition_reproducibility_details", scope: "decidim.sortitions.sortitions.show") %>
88
+ </div>
89
+ <div class="sortition__aside-element bg-background p-4 rounded">
90
+ <div class="sortition__aside-element-item">
91
+ <span class="sortition__aside-element-item__title">
92
+ <%= t("dice_result", scope: "decidim.sortitions.sortitions.show") %>
93
+ </span>
94
+ <span class="sortition__aside-element-item__text">
95
+ <%= sortition.dice %>º
96
+ </span>
104
97
  </div>
105
-
106
- <div class="sortition-details-item">
107
- <span class="sortition-details-title sortition-details-text"><%= t ".mathematical_result" %></span>
108
- <span class=sortition-details-text><%= sortition.seed %></span>
98
+ <div class="sortition__aside-element-item">
99
+ <span class="sortition__aside-element-item__title">
100
+ <%= t("time_seed", scope: "decidim.sortitions.sortitions.show") %>
101
+ </span>
102
+ <span class="sortition__aside-element-item__text">
103
+ <%= sortition.request_timestamp.to_i %>
104
+ </span>
109
105
  </div>
110
-
111
- <div class="sortition-details-item">
112
- <span class="sortition-details-title sortition-details-text"><%= t ".algorithm" %></span><br>
113
- <span class=sortition-details-text>
114
- <%= link_to Decidim::Sortitions.sortition_algorithm,
115
- Decidim::Sortitions.sortition_algorithm,
116
- target: "_blank",
117
- title: t(".algorithm") %>
106
+ <div class="sortition__aside-element-item">
107
+ <span class="sortition__aside-element-item__title">
108
+ <%= t("mathematical_result", scope: "decidim.sortitions.sortitions.show") %>
118
109
  </span>
110
+ <span class="sortition__aside-element-item__text">
111
+ <%= sortition.seed %>
112
+ </span>
113
+ </div>
114
+ <div class="sortition__aside-element-item">
115
+ <%= link_to t("algorithm", scope: "decidim.sortitions.sortitions.show"), Decidim::Sortitions.sortition_algorithm, class: "text-secondary sortition__aside-element-item__title underline" %>
119
116
  </div>
120
117
  </div>
121
- </div>
122
- </section>
123
-
124
- <section class=extended>
125
- <div class="row column">
126
- <h4 class="section-heading"><%= t ".candidate_proposal_ids" %></h4>
127
- </div>
128
- <div class="row columns">
129
- <%= t ".candidate_proposals_info", category_label: sortition_category_label(sortition) %>:
130
- </div>
131
- <div class=row>
132
- <div class="columns small-centered mediumlarge-12 large-12">
133
- <%= sortition_proposal_candidate_ids sortition %>
118
+ </section>
119
+ <section class="layout-aside__section">
120
+ <div class="text-sm text-gray-2 uppercase font-semibold mb-4">
121
+ <%= t("candidate_proposal_ids", scope: "decidim.sortitions.sortitions.show") %>
134
122
  </div>
135
- </div>
136
- </section>
137
- </div>
138
-
139
- <%= comments_for sortition %>
123
+ <div class="sortition__aside-element bg-background p-4 rounded">
124
+ <div class="sortition__aside-element-item">
125
+ <span class="sortition__aside-element-item__title">
126
+ <%= t("candidate_proposals_info", scope: "decidim.sortitions.sortitions.show", category_label: sortition_category_label(sortition)) %>
127
+ </span>
128
+ <span class="sortition__aside-element-item__numbers">
129
+ <%= sortition_proposal_candidate_ids sortition %>
130
+ </span>
131
+ </div>
132
+ </div>
133
+ </section>
134
+ <section class="layout-aside__section actions__secondary">
135
+ <%= cell "decidim/share_button", nil %>
136
+ </section>
137
+ <% end %>
138
+ <% content_for :item_footer do %>
139
+ <%= comments_for sortition %>
140
+ <ul class="metadata__container layout-main__section" data-metadata-footer>
141
+ <%= content_tag :li, resource_reference(sortition), class: "metadata__item" %>
142
+ </ul>
143
+ <% end %>
144
+ <% end %>