decidim-accountability 0.27.9 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/accountability/content_blocks/highlighted_results_cell.rb +3 -8
  3. data/app/cells/decidim/accountability/highlighted_results/show.erb +3 -1
  4. data/app/cells/decidim/accountability/highlighted_results_for_component/show.erb +19 -19
  5. data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +29 -6
  6. data/app/cells/decidim/accountability/project/show.erb +11 -0
  7. data/app/cells/decidim/accountability/project/timeline.erb +22 -0
  8. data/app/cells/decidim/accountability/project_cell.rb +75 -0
  9. data/app/cells/decidim/accountability/result_activity_cell.rb +1 -4
  10. data/app/cells/decidim/accountability/result_card_cell.rb +21 -0
  11. data/app/cells/decidim/accountability/result_cell.rb +2 -2
  12. data/app/cells/decidim/accountability/result_l/extra_data.erb +3 -0
  13. data/app/cells/decidim/accountability/result_l_cell.rb +30 -0
  14. data/app/cells/decidim/accountability/result_metadata/project_aside.erb +6 -0
  15. data/app/cells/decidim/accountability/result_metadata/show_footer.erb +11 -0
  16. data/app/cells/decidim/accountability/result_metadata/versions.erb +1 -0
  17. data/app/cells/decidim/accountability/result_metadata_cell.rb +136 -0
  18. data/app/cells/decidim/accountability/results/show.erb +7 -0
  19. data/app/cells/decidim/accountability/results_cell.rb +14 -0
  20. data/app/cells/decidim/accountability/status/show.erb +9 -0
  21. data/app/cells/decidim/accountability/status/status.erb +16 -0
  22. data/app/cells/decidim/accountability/status_cell.rb +91 -0
  23. data/app/commands/decidim/accountability/admin/import_projects_to_accountability.rb +37 -0
  24. data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +2 -2
  25. data/app/controllers/decidim/accountability/admin/import_results_controller.rb +18 -6
  26. data/app/controllers/decidim/accountability/admin/projects_import_controller.rb +31 -0
  27. data/app/controllers/decidim/accountability/admin/results_controller.rb +4 -5
  28. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +3 -3
  29. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +3 -3
  30. data/app/controllers/decidim/accountability/results_controller.rb +20 -2
  31. data/app/events/decidim/accountability/proposal_linked_event.rb +18 -1
  32. data/app/events/decidim/accountability/result_progress_updated_event.rb +18 -2
  33. data/app/forms/decidim/accountability/admin/import_results_form.rb +22 -0
  34. data/app/forms/decidim/accountability/admin/result_import_projects_form.rb +51 -0
  35. data/app/helpers/decidim/accountability/admin/application_helper.rb +1 -0
  36. data/app/helpers/decidim/accountability/application_helper.rb +43 -2
  37. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +10 -0
  38. data/app/jobs/decidim/accountability/admin/import_projects_job.rb +72 -0
  39. data/app/mailers/decidim/accountability/import_projects_mailer.rb +25 -0
  40. data/app/models/decidim/accountability/result.rb +1 -1
  41. data/app/packs/entrypoints/decidim_accountability.js +4 -1
  42. data/app/packs/entrypoints/decidim_accountability_admin_imports.js +3 -0
  43. data/app/packs/images/decidim/accountability/breadcrumb_arrow.svg +3 -0
  44. data/app/packs/src/decidim/accountability/admin/imports.js +15 -0
  45. data/app/packs/stylesheets/accountability.scss +169 -0
  46. data/app/permissions/decidim/accountability/admin/permissions.rb +17 -6
  47. data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +2 -2
  48. data/app/presenters/decidim/accountability/admin_log/status_presenter.rb +2 -2
  49. data/app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb +2 -2
  50. data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +1 -1
  51. data/app/services/decidim/accountability/results_calculator.rb +1 -1
  52. data/app/services/decidim/accountability/results_csv_importer.rb +2 -2
  53. data/app/views/decidim/accountability/admin/import_results/new.html.erb +27 -23
  54. data/app/views/decidim/accountability/admin/projects_import/new.html.erb +45 -0
  55. data/app/views/decidim/accountability/admin/results/_form.html.erb +46 -46
  56. data/app/views/decidim/accountability/admin/results/edit.html.erb +18 -7
  57. data/app/views/decidim/accountability/admin/results/index.html.erb +102 -91
  58. data/app/views/decidim/accountability/admin/results/new.html.erb +18 -8
  59. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
  60. data/app/views/decidim/accountability/admin/statuses/_form.html.erb +15 -17
  61. data/app/views/decidim/accountability/admin/statuses/edit.html.erb +16 -6
  62. data/app/views/decidim/accountability/admin/statuses/index.html.erb +33 -36
  63. data/app/views/decidim/accountability/admin/statuses/new.html.erb +16 -6
  64. data/app/views/decidim/accountability/admin/timeline_entries/_form.html.erb +12 -14
  65. data/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb +17 -6
  66. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +35 -34
  67. data/app/views/decidim/accountability/admin/timeline_entries/new.html.erb +17 -6
  68. data/app/views/decidim/accountability/import_projects_mailer/import.html.erb +2 -0
  69. data/app/views/decidim/accountability/results/_home_categories.html.erb +28 -73
  70. data/app/views/decidim/accountability/results/_linked_results.html.erb +3 -12
  71. data/app/views/decidim/accountability/results/_project.html.erb +29 -0
  72. data/app/views/decidim/accountability/results/_projects_aside.html.erb +40 -0
  73. data/app/views/decidim/accountability/results/_scope_filters.html.erb +27 -27
  74. data/app/views/decidim/accountability/results/_search.html.erb +15 -9
  75. data/app/views/decidim/accountability/results/_stats_box.html.erb +3 -3
  76. data/app/views/decidim/accountability/results/home.html.erb +34 -8
  77. data/app/views/decidim/accountability/results/index.html.erb +15 -15
  78. data/app/views/decidim/accountability/results/index.js.erb +3 -0
  79. data/app/views/decidim/accountability/results/show.html.erb +9 -10
  80. data/app/views/decidim/accountability/versions/show.html.erb +13 -10
  81. data/app/views/decidim/participatory_spaces/_result.html.erb +4 -4
  82. data/config/assets.rb +2 -2
  83. data/config/locales/ar.yml +23 -61
  84. data/config/locales/bg.yml +0 -96
  85. data/config/locales/ca.yml +54 -31
  86. data/config/locales/cs.yml +58 -29
  87. data/config/locales/da.yml +1 -36
  88. data/config/locales/de.yml +59 -36
  89. data/config/locales/el.yml +62 -29
  90. data/config/locales/en.yml +55 -31
  91. data/config/locales/es-MX.yml +52 -29
  92. data/config/locales/es-PY.yml +52 -29
  93. data/config/locales/es.yml +55 -32
  94. data/config/locales/eu.yml +53 -30
  95. data/config/locales/fi-plain.yml +51 -28
  96. data/config/locales/fi.yml +54 -31
  97. data/config/locales/fr-CA.yml +51 -28
  98. data/config/locales/fr.yml +52 -29
  99. data/config/locales/ga-IE.yml +0 -4
  100. data/config/locales/gl.yml +0 -41
  101. data/config/locales/hu.yml +41 -29
  102. data/config/locales/id-ID.yml +1 -30
  103. data/config/locales/is-IS.yml +0 -32
  104. data/config/locales/it.yml +0 -43
  105. data/config/locales/ja.yml +55 -39
  106. data/config/locales/kaa.yml +20 -1
  107. data/config/locales/ko.yml +0 -188
  108. data/config/locales/lb.yml +1 -42
  109. data/config/locales/lt.yml +60 -41
  110. data/config/locales/lv.yml +1 -36
  111. data/config/locales/nl.yml +0 -41
  112. data/config/locales/no.yml +8 -49
  113. data/config/locales/pl.yml +17 -61
  114. data/config/locales/pt-BR.yml +41 -29
  115. data/config/locales/pt.yml +0 -42
  116. data/config/locales/ro-RO.yml +39 -66
  117. data/config/locales/ru.yml +1 -30
  118. data/config/locales/si-LK.yml +0 -4
  119. data/config/locales/sk.yml +1 -40
  120. data/config/locales/sl.yml +0 -11
  121. data/config/locales/sq-AL.yml +82 -7
  122. data/config/locales/sr-CS.yml +1 -30
  123. data/config/locales/sv.yml +36 -51
  124. data/config/locales/th-TH.yml +0 -140
  125. data/config/locales/tr-TR.yml +9 -75
  126. data/config/locales/uk.yml +1 -28
  127. data/config/locales/zh-CN.yml +1 -36
  128. data/config/locales/zh-TW.yml +52 -43
  129. data/lib/decidim/accountability/admin_engine.rb +3 -2
  130. data/lib/decidim/accountability/component.rb +4 -99
  131. data/lib/decidim/accountability/engine.rb +9 -1
  132. data/lib/decidim/accountability/result_serializer.rb +1 -1
  133. data/lib/decidim/accountability/seeds.rb +115 -0
  134. data/lib/decidim/accountability/test/factories.rb +18 -29
  135. data/lib/decidim/accountability/version.rb +1 -1
  136. data/lib/decidim/api/result_type.rb +1 -0
  137. metadata +62 -51
  138. data/app/cells/decidim/accountability/content_blocks/highlighted_results/elements.erb +0 -5
  139. data/app/cells/decidim/accountability/content_blocks/highlighted_results/heading.erb +0 -1
  140. data/app/cells/decidim/accountability/result_m/data.erb +0 -23
  141. data/app/cells/decidim/accountability/result_m/footer.erb +0 -22
  142. data/app/cells/decidim/accountability/result_m/tags.erb +0 -1
  143. data/app/cells/decidim/accountability/result_m_cell.rb +0 -37
  144. data/app/events/decidim/accountability/base_result_event.rb +0 -29
  145. data/app/packs/stylesheets/decidim/accountability/_accountability.scss +0 -4
  146. data/app/packs/stylesheets/decidim/accountability/accountability/_cards.scss +0 -11
  147. data/app/packs/stylesheets/decidim/accountability/accountability/_categories.scss +0 -121
  148. data/app/packs/stylesheets/decidim/accountability/accountability/_lines_breadcrumb.scss +0 -37
  149. data/app/packs/stylesheets/decidim/accountability/accountability/_results.scss +0 -148
  150. data/app/views/decidim/accountability/admin/results/proposals_picker.html.erb +0 -1
  151. data/app/views/decidim/accountability/result_widgets/show.html.erb +0 -2
  152. data/app/views/decidim/accountability/results/_home_header.html.erb +0 -23
  153. data/app/views/decidim/accountability/results/_results_leaf.html.erb +0 -47
  154. data/app/views/decidim/accountability/results/_results_parent.html.erb +0 -32
  155. data/app/views/decidim/accountability/results/_show_leaf.html.erb +0 -81
  156. data/app/views/decidim/accountability/results/_show_parent.html.erb +0 -30
  157. data/app/views/decidim/accountability/results/_stats.html.erb +0 -15
  158. data/app/views/decidim/accountability/results/_timeline.html.erb +0 -30
  159. data/app/views/decidim/accountability/versions/index.html.erb +0 -12
  160. data/config/locales/he-IL.yml +0 -219
  161. data/decidim-accountability.gemspec +0 -38
@@ -1,79 +1,34 @@
1
- <div class="categories section">
2
- <div class="categories--header">
3
- <div class="row">
4
- <div class="small-12 medium-4 columns">
5
- <%= icon("arrow-bottom", class: "icon", aria_label: categories_label, role: "img") %>
6
- <span><%= categories_label %></span>
7
- </div>
8
- <div class="show-for-medium small-12 medium-8 columns">
9
- <%= icon("arrow-bottom", class: "icon", aria_label: subcategories_label, role: "img") %>
10
- <span><%= subcategories_label %></span>
11
-
12
- <div class="float-right">
13
- <%= render partial: "search" %>
14
- </div>
15
-
16
- </div>
1
+ <div class="accountability__grid">
2
+ <% first_class_categories.each do |category| %>
3
+ <% subelements = cell(
4
+ "decidim/accountability/status",
5
+ category,
6
+ extra_classes: "accountability__status__background",
7
+ url: results_path(filter: { with_category: category, with_scope: current_scope }),
8
+ render_blank: true
9
+ ) %>
10
+
11
+ <div>
12
+ <span class="accountability__grid-title"><%= categories_label %></span>
13
+ <%= subelements.call %>
17
14
  </div>
18
- </div>
19
-
20
- <div class="categories--list">
21
- <div class="row">
22
- <div class="small-12 columns">
23
- <% first_class_categories.each do |category| %>
24
- <% next if (category_results_count = count_calculator(current_scope, category.id)) == 0 %>
25
- <div class="categories--group row">
26
- <div class="category--section small-12 medium-4 columns">
27
- <div class="category--title">
28
- <p class="heading3">
29
- <%= link_to translated_attribute(category.name),results_path(filter: { with_category: category, with_scope: current_scope }) %></p>
30
-
31
- <% if component_settings.display_progress_enabled? && progress_calculator(current_scope, category.id).present? %>
32
- <div class="progress">
33
- <div class="progress-meter" style="width:<%= progress_calculator(current_scope, category.id) %>%"></div>
34
- </div>
35
- <% end %>
36
15
 
37
- <div class="progress-info">
38
- <% if component_settings.display_progress_enabled? && progress_calculator(current_scope, category.id).present? %>
39
- <div class="progress-figure heading3">
40
- <%= display_percentage progress_calculator(current_scope, category.id) %>
41
- </div>
42
- <% end %>
43
- <div class="category--count">
44
- <%= display_count(category_results_count) if category_results_count && category_results_count > 0 %>
45
- </div>
46
- </div>
47
- </div>
48
- </div>
49
-
50
- <div class="category--elements show-for-medium medium-8 columns">
51
- <div class="row">
52
- <% category.subcategories.each do |subcategory| %>
53
- <% if (subcategory_results_count = count_calculator(current_scope, subcategory.id)) > 0 %>
54
- <%= link_to results_path(filter: { with_category: subcategory, with_scope: current_scope }), class: "medium-4 columns end card__link card__link--block" do %>
55
- <div class="category--line">
56
- <strong><%= translated_attribute(subcategory.name) %></strong>
57
-
58
- <% if component_settings.display_progress_enabled? && progress_calculator(current_scope, subcategory.id).present? %>
59
- <div class="progress-figure heading3">
60
- <%= display_percentage progress_calculator(current_scope, subcategory.id) %>
61
- </div>
62
- <% end %>
63
-
64
- <div class="category--count">
65
- <%= display_count subcategory_results_count %>
66
- </div>
67
- </div>
68
- <% end %>
69
- <% end %>
70
- <% end %>
71
-
72
- </div>
73
- </div>
16
+ <div>
17
+ <span class="accountability__grid-title"><%= subcategories_label %></span>
18
+ <% if subelements.has_results? %>
19
+ <div class="accountability__subgrid">
20
+ <% category.subcategories.each do |subcategory| %>
21
+ <%= cell(
22
+ "decidim/accountability/status",
23
+ subcategory,
24
+ extra_classes: "accountability__status__border",
25
+ url: results_path(filter: { with_category: subcategory, with_scope: current_scope })
26
+ ) %>
27
+ <% end %>
74
28
  </div>
29
+ <% else %>
30
+ <%= cell("decidim/announcement", t("no_results", scope: "decidim.accountability.results")) %>
75
31
  <% end %>
76
32
  </div>
77
- </div>
78
- </div>
33
+ <% end %>
79
34
  </div>
@@ -1,12 +1,3 @@
1
- <div class="card card--action card--list">
2
- <% resources.each do |result| %>
3
- <div class="card--list__item">
4
- <%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %>
5
- <%= link_to resource_locator(result).path, class: "card--list__text card__link card__link--block" do %>
6
- <h5 class="card--list__heading">
7
- <%= translated_attribute(result.title) %>
8
- </h5>
9
- <% end %>
10
- </div>
11
- <% end %>
12
- </div>
1
+ <% resources.each do |result| %>
2
+ <%= cell "decidim/accountability/result_l", result, url_extra_params: { included_in: resource.to_gid } %>
3
+ <% end %>
@@ -0,0 +1,29 @@
1
+ <%= render layout: "layouts/decidim/shared/layout_item", locals: nav_paths do %>
2
+ <%= cell("decidim/accountability/project", result) %>
3
+
4
+ <section class="layout-main__section layout-main__buttons" data-buttons>
5
+ <%= cell "decidim/comments_button", nil %>
6
+ <div class="ml-auto">
7
+ <%= cell "decidim/tags", result %>
8
+ </div>
9
+ </section>
10
+
11
+ <% content_for :aside do %>
12
+ <section class="layout-aside__section layout-aside__buttons accountability__project-aside">
13
+ <% if component_settings.display_progress_enabled? %>
14
+ <%= cell(
15
+ "decidim/accountability/status",
16
+ result,
17
+ title: t("models.result.fields.progress", scope: "decidim.accountability"),
18
+ extra_classes: "accountability__status__project"
19
+ ) %>
20
+ <% end %>
21
+
22
+ <%= cell("decidim/accountability/result_metadata", result, template: :project_aside) %>
23
+ </section>
24
+ <% end %>
25
+ <% content_for :item_footer do %>
26
+ <%= comments_for result %>
27
+ <%= cell "decidim/accountability/result_metadata", result, template: :show_footer %>
28
+ <% end %>
29
+ <% end %>
@@ -0,0 +1,40 @@
1
+ <% if local_assigns[:main_action] %>
2
+ <h1 class="title-decorator"><%= component_name %></h1>
3
+ <% else %>
4
+ <h2 class="title-decorator"><%= component_name %></h2>
5
+ <% end %>
6
+
7
+ <div class="accountability__status-container">
8
+ <%= cell(
9
+ "decidim/accountability/status",
10
+ nil,
11
+ url: root_path,
12
+ title: t("decidim.accountability.results.home_header.global_status"),
13
+ extra_classes: "accountability__status__parent",
14
+ render_blank: true
15
+ ) %>
16
+ <% categories_hierarchy.each do |category| %>
17
+ <%= cell(
18
+ "decidim/accountability/status",
19
+ category,
20
+ url: results_path(filter: { with_category: category, with_scope: current_scope }),
21
+ extra_classes: "accountability__status__parent",
22
+ render_count: false,
23
+ render_blank: true
24
+ ) %>
25
+ <% end %>
26
+ <% if category.present? %>
27
+ <div>
28
+ <%= external_icon "media/images/breadcrumb_arrow.svg" %>
29
+ <%= cell(
30
+ "decidim/accountability/status",
31
+ category,
32
+ extra_classes: "accountability__status__child",
33
+ url: results_path(filter: { with_category: category, with_scope: current_scope }),
34
+ render_blank: true
35
+ ) %>
36
+ </div>
37
+ <% end %>
38
+ </div>
39
+
40
+ <%= render partial: "scope_filters" if current_component.has_subscopes? %>
@@ -1,31 +1,31 @@
1
- <div class="scope-filters section">
2
- <% if current_component.has_subscopes? %>
3
- <div><%= t("results.filters.scopes", scope: "decidim.accountability") %></div>
4
-
5
- <ul class="tags tags--action">
6
- <li <%= active_class_if_current(nil) %>>
7
- <%= link_to url_for(filter: { with_category: category.try(:id) }) do %>
8
- <span class="show-for-sr"><%= Decidim::Scope.model_name.human(count: 2) %></span>
9
- <%= t("results.filters.all", scope: "decidim.accountability") %>
10
- <% end %>
11
- </li>
1
+ <% items = filter_items_for(participatory_space: current_participatory_space, category:) %>
2
+ <div class="accountability__filters">
3
+ <%= render partial: "search" %>
12
4
 
13
- <% if current_participatory_space.scope %>
14
- <li <%= active_class_if_current(current_participatory_space.scope.id) %>>
15
- <%= link_to url_for(filter: { with_scope: current_participatory_space.scope.id, with_category: category.try(:id) }) do %>
16
- <span class="show-for-sr"><%= Decidim::Scope.model_name.human(count: 1) %></span>
17
- <%= translated_attribute(current_participatory_space.scope.name) %>
18
- <% end %>
19
- </li>
20
- <% end %>
21
- <% current_participatory_space.subscopes.each do |scope| %>
22
- <li <%= active_class_if_current(scope.id) %>>
23
- <%= link_to url_for(filter: { with_scope: scope.id, with_category: category.try(:id) }) do %>
24
- <span class="show-for-sr"><%= Decidim::Scope.model_name.human(count: 1) %></span>
25
- <%= translated_attribute(scope.name) %>
5
+ <% if current_component.has_subscopes? %>
6
+ <div class="filter-container">
7
+ <button id="dropdown-trigger-accountability" data-component="dropdown" data-target="dropdown-menu-accountability" data-auto-close="true" data-disabled-md="true">
8
+ <% items.each do |item| %>
9
+ <%= content_tag :span, class: "#{"is-active" if item[:active]}" do %>
10
+ <span class="sr-only"><%= item[:sr_text] %></span>
11
+ <%= icon item[:icon] %>
12
+ <span><%= item[:text] %></span>
26
13
  <% end %>
27
- </li>
28
- <% end %>
29
- </ul>
14
+ <% end %>
15
+ <%= icon "arrow-down-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
16
+ <%= icon "arrow-up-s-line", class: "w-8 h-8 flex-none text-secondary fill-current" %>
17
+ </button>
18
+ <ul id="dropdown-menu-accountability" data-scope-filters>
19
+ <% items.each do |item| %>
20
+ <li>
21
+ <%= link_to item[:url], class: "filter#{" is-active" if item[:active]}" do %>
22
+ <span class="sr-only"><%= item[:sr_text] %></span>
23
+ <%= icon item[:icon] %>
24
+ <span><%= item[:text] %></span>
25
+ <% end %>
26
+ </li>
27
+ <% end %>
28
+ </ul>
29
+ </div>
30
30
  <% end %>
31
31
  </div>
@@ -1,12 +1,18 @@
1
1
  <%= form_tag results_path, method: :get do %>
2
- <div class="filters__search">
3
- <div class="input-group">
4
- <%= search_field_tag "filter[search_text_cont]", nil, class: "input-group-field", placeholder: t(".search"), value: "", title: t(".search") %>
5
- <div class="input-group-button">
6
- <button type="submit" class="button">
7
- <%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
8
- </button>
9
- </div>
10
- </div>
2
+ <div class="filter-search">
3
+ <label>
4
+ <span class="sr-only"><%= t("search", scope: "decidim.accountability.results.search") %></span>
5
+ <%= search_field_tag(
6
+ "filter[search_text_cont]",
7
+ nil,
8
+ class: "input-group-field",
9
+ placeholder: t("search", scope: "decidim.accountability.results.search"),
10
+ value: "",
11
+ title: t("search", scope: "decidim.accountability.results.search")
12
+ ) %>
13
+ <button type="submit" aria-label="<%= t("search", scope: "decidim.accountability.results.search") %>">
14
+ <%= icon "search-line" %>
15
+ </button>
16
+ </label>
11
17
  </div>
12
18
  <% end %>
@@ -21,14 +21,14 @@
21
21
  <% if result.versions.any? %>
22
22
  <div class="definition-data__item versions_count">
23
23
  <div>
24
- <%= resource_version_number(result.versions_count, "text-large") %>
25
- <small class="text-medium">
24
+ <%= resource_version_number(result.versions_count) %>
25
+ <small>
26
26
  <%= resource_version_of(result.versions_count) %>
27
27
  </small>
28
28
  </div>
29
29
 
30
30
  <div>
31
- <span class="text-medium">
31
+ <span>
32
32
  <%= link_to_other_resource_versions(result_versions_path(result)) %>
33
33
  </span>
34
34
  </div>
@@ -1,11 +1,37 @@
1
- <div class="row accountability">
2
- <div class="small-12 columns">
3
- <%= render partial: "home_header" %>
4
- <%= render partial: "scope_filters", locals: { url_method: :root_path } %>
1
+ <% add_decidim_page_title component_name %>
2
+ <%= append_javascript_pack_tag "decidim_accountability" %>
3
+ <%= append_stylesheet_pack_tag "decidim_accountability" %>
4
+
5
+ <% content_for :aside do %>
6
+ <h1 class="title-decorator"><%= component_name %></h1>
7
+
8
+ <% if component_settings.display_progress_enabled? %>
9
+ <%= cell(
10
+ "decidim/accountability/status",
11
+ nil,
12
+ title: t("decidim.accountability.results.home_header.global_status"),
13
+ progress: progress_calculator(current_scope, nil).presence,
14
+ extra_classes: "accountability__status__home"
15
+ ) %>
16
+ <% end %>
17
+
18
+ <%= render partial: "scope_filters" %>
19
+ <% end %>
20
+
21
+ <%= render layout: "layouts/decidim/shared/layout_two_col" do %>
22
+
23
+ <section class="layout-main__section">
24
+ <div class="editor-content"><%== translated_attribute component_settings.intro %></div>
25
+ </section>
26
+
27
+ <section class="layout-main__section">
28
+ <% if first_class_categories.empty? %>
29
+ <%= cell("decidim/announcement",
30
+ params[:filter].present? ?
31
+ t("empty_filters", scope: "decidim.accountability.results.home") :
32
+ t("empty", scope: "decidim.accountability.results.home")) %>
33
+ <% end %>
5
34
  <%= render partial: "home_categories" %>
6
- </div>
7
- </div>
35
+ </section>
8
36
 
9
- <% content_for :js_content do %>
10
- <%= javascript_pack_tag "decidim_accountability" %>
11
37
  <% end %>
@@ -1,17 +1,17 @@
1
- <div class="row accountability">
2
- <div class="small-12 columns">
3
- <%= render partial: "scope_filters", locals: { url_method: :results_path } %>
4
- </div>
1
+ <%= append_javascript_pack_tag "decidim_accountability" %>
2
+ <%= append_stylesheet_pack_tag "decidim_accountability" %>
5
3
 
6
- <div class="small-12 columns">
7
- <%= render partial: "nav_breadcrumb", locals: { category: category, result: nil } %>
8
- </div>
4
+ <% content_for :aside do %>
5
+ <%= render partial: "projects_aside", locals: { main_action: true } %>
6
+ <% end %>
9
7
 
10
- <div class="small-12 columns end">
11
- <% if results.any?{|r| r.children_count > 0 } %>
12
- <%= render partial: "results_parent", locals: { results: results, total_count: results.total_count } %>
13
- <% else %>
14
- <%= render partial: "results_leaf", locals: { results: results, total_count: results.total_count } %>
15
- <% end %>
16
- </div>
17
- </div>
8
+ <%= render layout: "layouts/decidim/shared/layout_two_col" do %>
9
+ <section class="layout-main__section">
10
+ <h2 class="h4"><%= category.present? ? translated_attribute(category.name) : t("decidim.accountability.results.home_header.global_status") %></h2>
11
+ </section>
12
+
13
+ <section id="results" class="layout-main__section">
14
+ <%= cell "decidim/accountability/results", results %>
15
+ <%= decidim_paginate results, order_start_time: params[:order_start_time], with_scope: params.dig(:filter, :with_scope) %>
16
+ </section>
17
+ <% end %>
@@ -1,2 +1,5 @@
1
1
  var $results = $('#results');
2
+ var $project_frame = $('#project_frame');
3
+
2
4
  $results.html('<%= j(render partial: "results") %>');
5
+ $project_frame.data("filteredPath", "<%= request.fullpath %>");
@@ -1,20 +1,19 @@
1
1
  <% add_decidim_meta_tags({
2
- description: translated_attribute(result.description),
3
- title: translated_attribute(result.title),
4
- url: result_url(result.id)
5
- }) %>
2
+ description: translated_attribute(result.description),
3
+ title: translated_attribute(result.title),
4
+ url: result_url(result.id)
5
+ }) %>
6
6
 
7
7
  <%
8
8
  edit_link(
9
9
  resource_locator(result).edit,
10
10
  :update,
11
11
  :result,
12
- result: result
12
+ result:
13
13
  )
14
14
  %>
15
15
 
16
- <% if result.children.any? %>
17
- <%= render partial: "show_parent", locals: { result: result } %>
18
- <% else %>
19
- <%= render partial: "show_leaf", locals: { result: result } %>
20
- <% end %>
16
+ <%= append_javascript_pack_tag "decidim_accountability" %>
17
+ <%= append_stylesheet_pack_tag "decidim_accountability" %>
18
+
19
+ <%= render partial: "project", locals: { result: } %>
@@ -1,17 +1,20 @@
1
- <% content_for :js_content do %>
2
- <%= javascript_pack_tag "decidim_accountability" %>
1
+ <% content_for :aside do %>
2
+ <%= cell(
3
+ "decidim/versions_list",
4
+ versioned_resource,
5
+ version_path: proc { |version_index| url_for(action: :show, id: version_index) },
6
+ i18n_scope: "decidim.meetings.versions"
7
+ ) %>
3
8
  <% end %>
4
- <div class="row accountability">
5
- <div class="small-12 columns">
6
- <%= render partial: "decidim/accountability/results/nav_breadcrumb", locals: { category: versioned_resource.parent.try(:category) || versioned_resource.try(:category) } %>
7
- </div>
8
9
 
10
+ <%= render layout: "layouts/decidim/shared/layout_item" do %>
9
11
  <%= cell(
10
12
  "decidim/version",
11
13
  current_version,
12
- index: params[:id].to_i,
13
- versioned_resource: versioned_resource,
14
+ index: params[:id],
15
+ versioned_resource:,
16
+ path: proc { |extra_params| url_for(action: :show, id: params[:id], **extra_params) },
14
17
  versions_path: proc { url_for(action: :index) },
15
- i18n_scope: "decidim.accountability.results.show.stats"
18
+ i18n_scope: "decidim.meetings.versions"
16
19
  ) %>
17
- </div>
20
+ <% end %>
@@ -2,11 +2,11 @@
2
2
  <%= icon "actions", class: "card--list__icon", role: "img", "aria-hidden": true, remove_icon_class: true %>
3
3
 
4
4
  <%= link_to resource_locator(result).path, class: "card--list__text card__link card__link--block" do %>
5
- <h4 class="card--list__heading heading6">
6
- <%= decidim_escape_translated(result.title) %>
5
+ <h4 class="card--list__heading">
6
+ <%= translated_attribute(result.title) %>
7
7
  </h4>
8
8
 
9
- <div class="text-small card--meta">
9
+ <div class="card--meta">
10
10
  <% if result.start_date %>
11
11
  <strong><%= t("models.result.fields.start_date", scope: "decidim.accountability") %></strong>
12
12
  <span><%= l result.start_date, format: :short %></span>
@@ -19,7 +19,7 @@
19
19
 
20
20
  <% if result.status %>
21
21
  <strong><%= t("models.result.fields.status", scope: "decidim.accountability") %></strong>
22
- <span><%= decidim_escape_translated(result.status.name) %></span>
22
+ <span><%= translated_attribute(result.status.name) %></span>
23
23
  <% end %>
24
24
  </div>
25
25
  <% end %>
data/config/assets.rb CHANGED
@@ -5,6 +5,6 @@ base_path = File.expand_path("..", __dir__)
5
5
  Decidim::Webpacker.register_path("#{base_path}/app/packs")
6
6
  Decidim::Webpacker.register_entrypoints(
7
7
  decidim_accountability: "#{base_path}/app/packs/entrypoints/decidim_accountability.js",
8
- decidim_accountability_admin: "#{base_path}/app/packs/entrypoints/decidim_accountability_admin.js"
8
+ decidim_accountability_admin: "#{base_path}/app/packs/entrypoints/decidim_accountability_admin.js",
9
+ decidim_accountability_admin_imports: "#{base_path}/app/packs/entrypoints/decidim_accountability_admin_imports.js"
9
10
  )
10
- Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/accountability/accountability")