decidim-accountability 0.27.5 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) 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/forms/decidim/accountability/admin/import_results_form.rb +22 -0
  32. data/app/forms/decidim/accountability/admin/result_import_projects_form.rb +51 -0
  33. data/app/helpers/decidim/accountability/admin/application_helper.rb +1 -0
  34. data/app/helpers/decidim/accountability/application_helper.rb +43 -2
  35. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +10 -0
  36. data/app/jobs/decidim/accountability/admin/import_projects_job.rb +72 -0
  37. data/app/mailers/decidim/accountability/import_projects_mailer.rb +25 -0
  38. data/app/models/decidim/accountability/result.rb +1 -1
  39. data/app/packs/entrypoints/decidim_accountability.js +4 -1
  40. data/app/packs/entrypoints/decidim_accountability_admin_imports.js +3 -0
  41. data/app/packs/images/decidim/accountability/breadcrumb_arrow.svg +3 -0
  42. data/app/packs/src/decidim/accountability/admin/imports.js +15 -0
  43. data/app/packs/stylesheets/accountability.scss +169 -0
  44. data/app/permissions/decidim/accountability/admin/permissions.rb +17 -6
  45. data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +2 -2
  46. data/app/presenters/decidim/accountability/admin_log/status_presenter.rb +2 -2
  47. data/app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb +2 -2
  48. data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +1 -1
  49. data/app/services/decidim/accountability/results_calculator.rb +1 -1
  50. data/app/services/decidim/accountability/results_csv_importer.rb +2 -2
  51. data/app/views/decidim/accountability/admin/import_results/new.html.erb +27 -23
  52. data/app/views/decidim/accountability/admin/projects_import/new.html.erb +45 -0
  53. data/app/views/decidim/accountability/admin/results/_form.html.erb +46 -46
  54. data/app/views/decidim/accountability/admin/results/edit.html.erb +18 -7
  55. data/app/views/decidim/accountability/admin/results/index.html.erb +102 -91
  56. data/app/views/decidim/accountability/admin/results/new.html.erb +18 -8
  57. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
  58. data/app/views/decidim/accountability/admin/statuses/_form.html.erb +15 -17
  59. data/app/views/decidim/accountability/admin/statuses/edit.html.erb +16 -6
  60. data/app/views/decidim/accountability/admin/statuses/index.html.erb +33 -36
  61. data/app/views/decidim/accountability/admin/statuses/new.html.erb +16 -6
  62. data/app/views/decidim/accountability/admin/timeline_entries/_form.html.erb +12 -14
  63. data/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb +17 -6
  64. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +35 -34
  65. data/app/views/decidim/accountability/admin/timeline_entries/new.html.erb +17 -6
  66. data/app/views/decidim/accountability/import_projects_mailer/import.html.erb +2 -0
  67. data/app/views/decidim/accountability/results/_home_categories.html.erb +28 -73
  68. data/app/views/decidim/accountability/results/_linked_results.html.erb +3 -12
  69. data/app/views/decidim/accountability/results/_project.html.erb +29 -0
  70. data/app/views/decidim/accountability/results/_projects_aside.html.erb +40 -0
  71. data/app/views/decidim/accountability/results/_scope_filters.html.erb +27 -27
  72. data/app/views/decidim/accountability/results/_search.html.erb +15 -9
  73. data/app/views/decidim/accountability/results/_stats_box.html.erb +3 -3
  74. data/app/views/decidim/accountability/results/home.html.erb +34 -8
  75. data/app/views/decidim/accountability/results/index.html.erb +15 -15
  76. data/app/views/decidim/accountability/results/index.js.erb +3 -0
  77. data/app/views/decidim/accountability/results/show.html.erb +9 -10
  78. data/app/views/decidim/accountability/versions/show.html.erb +12 -9
  79. data/app/views/decidim/participatory_spaces/_result.html.erb +2 -2
  80. data/config/assets.rb +2 -2
  81. data/config/locales/ar.yml +22 -60
  82. data/config/locales/bg.yml +0 -36
  83. data/config/locales/ca.yml +53 -30
  84. data/config/locales/cs.yml +58 -29
  85. data/config/locales/da.yml +0 -36
  86. data/config/locales/de.yml +59 -36
  87. data/config/locales/el.yml +62 -29
  88. data/config/locales/en.yml +55 -31
  89. data/config/locales/es-MX.yml +52 -29
  90. data/config/locales/es-PY.yml +52 -29
  91. data/config/locales/es.yml +53 -30
  92. data/config/locales/eu.yml +53 -30
  93. data/config/locales/fi-plain.yml +51 -28
  94. data/config/locales/fi.yml +52 -29
  95. data/config/locales/fr-CA.yml +51 -28
  96. data/config/locales/fr.yml +52 -29
  97. data/config/locales/ga-IE.yml +0 -4
  98. data/config/locales/gl.yml +0 -41
  99. data/config/locales/hu.yml +41 -29
  100. data/config/locales/id-ID.yml +0 -30
  101. data/config/locales/is-IS.yml +0 -32
  102. data/config/locales/it.yml +0 -41
  103. data/config/locales/ja.yml +55 -39
  104. data/config/locales/kaa.yml +20 -1
  105. data/config/locales/ko.yml +0 -15
  106. data/config/locales/lb.yml +0 -41
  107. data/config/locales/lt.yml +60 -41
  108. data/config/locales/lv.yml +0 -36
  109. data/config/locales/nl.yml +0 -41
  110. data/config/locales/no.yml +8 -49
  111. data/config/locales/pl.yml +17 -40
  112. data/config/locales/pt-BR.yml +41 -29
  113. data/config/locales/pt.yml +0 -41
  114. data/config/locales/ro-RO.yml +14 -39
  115. data/config/locales/ru.yml +0 -30
  116. data/config/locales/si-LK.yml +0 -3
  117. data/config/locales/sk.yml +0 -40
  118. data/config/locales/sl.yml +0 -11
  119. data/config/locales/sq-AL.yml +82 -7
  120. data/config/locales/sr-CS.yml +0 -30
  121. data/config/locales/sv.yml +23 -38
  122. data/config/locales/tr-TR.yml +9 -62
  123. data/config/locales/uk.yml +0 -28
  124. data/config/locales/zh-CN.yml +0 -36
  125. data/config/locales/zh-TW.yml +52 -43
  126. data/lib/decidim/accountability/admin_engine.rb +3 -2
  127. data/lib/decidim/accountability/component.rb +4 -99
  128. data/lib/decidim/accountability/engine.rb +9 -1
  129. data/lib/decidim/accountability/result_serializer.rb +1 -1
  130. data/lib/decidim/accountability/seeds.rb +115 -0
  131. data/lib/decidim/accountability/test/factories.rb +3 -2
  132. data/lib/decidim/accountability/version.rb +1 -1
  133. metadata +61 -48
  134. data/app/cells/decidim/accountability/content_blocks/highlighted_results/elements.erb +0 -5
  135. data/app/cells/decidim/accountability/content_blocks/highlighted_results/heading.erb +0 -1
  136. data/app/cells/decidim/accountability/result_m/data.erb +0 -23
  137. data/app/cells/decidim/accountability/result_m/footer.erb +0 -22
  138. data/app/cells/decidim/accountability/result_m/tags.erb +0 -1
  139. data/app/cells/decidim/accountability/result_m_cell.rb +0 -37
  140. data/app/packs/stylesheets/decidim/accountability/_accountability.scss +0 -4
  141. data/app/packs/stylesheets/decidim/accountability/accountability/_cards.scss +0 -11
  142. data/app/packs/stylesheets/decidim/accountability/accountability/_categories.scss +0 -121
  143. data/app/packs/stylesheets/decidim/accountability/accountability/_lines_breadcrumb.scss +0 -37
  144. data/app/packs/stylesheets/decidim/accountability/accountability/_results.scss +0 -148
  145. data/app/views/decidim/accountability/admin/results/proposals_picker.html.erb +0 -1
  146. data/app/views/decidim/accountability/result_widgets/show.html.erb +0 -2
  147. data/app/views/decidim/accountability/results/_home_header.html.erb +0 -23
  148. data/app/views/decidim/accountability/results/_results_leaf.html.erb +0 -47
  149. data/app/views/decidim/accountability/results/_results_parent.html.erb +0 -32
  150. data/app/views/decidim/accountability/results/_show_leaf.html.erb +0 -81
  151. data/app/views/decidim/accountability/results/_show_parent.html.erb +0 -30
  152. data/app/views/decidim/accountability/results/_stats.html.erb +0 -15
  153. data/app/views/decidim/accountability/results/_timeline.html.erb +0 -30
  154. data/app/views/decidim/accountability/versions/index.html.erb +0 -12
  155. data/config/environment.rb +0 -3
@@ -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
14
  index: params[:id],
13
- versioned_resource: versioned_resource,
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">
5
+ <h4 class="card--list__heading">
6
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>
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")
@@ -8,6 +8,7 @@ ar:
8
8
  decidim_scope_id: نطاق
9
9
  description: وصف
10
10
  end_date: تاريخ الانتهاء
11
+ meetings_ids: الاجتماعات ذات الصلة
11
12
  progress: تقدم
12
13
  project_ids: المشاريع المدرجة
13
14
  proposals: المقترحات المدرجة
@@ -43,8 +44,6 @@ ar:
43
44
  confirm_destroy: هل أنت متأكد أنك تريد حذف هذا %{name}؟
44
45
  destroy: حذف
45
46
  edit: تعديل
46
- import_csv: استيراد CSV
47
- new: '%{name} جديد'
48
47
  preview: معاينة
49
48
  timeline_entries: تطور المشروع
50
49
  title: الإجراءات
@@ -56,43 +55,28 @@ ar:
56
55
  new:
57
56
  download_export: تحميل التصدير بصيغه CSV
58
57
  import: استيراد
59
- info: |
60
- <p>نحن ننصح باتباع هذه الخطوات:</p>
61
- <ol>
62
- <li>قم بإنشاء حالات النتائج التي تريد إضافتها (<a href="%{link_new_status}" target="_blank">الرابط</a>)</li>
63
- <li>قم بإنشاء نتيجة واحدة على الأقل يدويًا من خلال لوحة المدير هذه (<a href="%{link_new_result}" target="_blank">link</a>) قبل أستخدام الاستيراد, للحصول على فهم أفضل للتنسيق وما ستحتاج لملئه.</li>
64
- <li>قم بتنزيل التصدير بتنسيق CSV(%{link_export_csv})</li>
65
- <li>قم بإجراء التغييرات محليًا على جهازك. يمكنك فقط تغيير الأعمدة التالية من ملف CSV:</li>
66
- </ol>
67
- <ul>
68
- <li><b>category/id:</b>رقم مٌعرف للفئه</li>
69
- <li><b>scope/id:</b>رقم مٌعرف للمجال</li>
70
- <li><b>parent/id:</b> رقم مٌعرف بالأب (للنتائج ذات الصلة). اختياري</li>
71
- <li><b>title/I18N:</b> عنوان اللغه</li>
72
- <li><b>description/I18N:</b> وصف اللغه</li>
73
- <li><b>start_date:</b>التاريخ الذي يبدأ فيه تنفيذ النتيجة (التنسيق YYYY-MM-DD)</li>
74
- <li><b>end_date:</b> التاريخ الذي ينتهى فيه تنفيذ النتيجة (التنسيق YYYY-MM-DD</li>
75
- <li><b>status/id:</b> رقم مٌعرف لحالة النتيجة</li>
76
- <li><b>progress:</b> النسبة المئوية (من 0 الى 100) للتنفيذ</li>
77
- <li><b>proposals_ids:</b> رقم مُعرف داخلى للمقترحات ذات الصلة (مفصولاً بفاصلة). يتم تحويله تلقائيًا إلى <span class="attribute-name">رابط للمقترح</span></li>
78
- </ul>
79
- title: استيراد النتائج من ملف CSV
80
- imports:
81
- create:
82
- success: لقد بدأ استيراد الملف. سوف تتلقى رسالة بريد إلكتروني في غصون الدقائق القادمة مع نتيجة الاستيراد
83
58
  models:
84
59
  result:
85
60
  name: نتيجة
86
61
  status:
87
62
  name: الحالة
88
- timeline_entry:
89
- name: دخول الجدول الزمني
90
- results:
63
+ projects_import:
91
64
  create:
92
- invalid: كانت هناك مشكلة في إنشاء هذه النتيجة
93
- success: تم إنشاء النتيجة بنجاح
94
- destroy:
95
- success: تم حذف النتيجة بنجاح
65
+ invalid: كان هناك مشكله فى استيراد المشاريع إلى النتائج, يرجى اتباع التعليمات بعناية و التأكد من اختيار مشاريع للتنفيذ.
66
+ new:
67
+ create: استيراد
68
+ import_all_selected_projects: استيراد جميع المشاريع المحددة للتنفيذ
69
+ new_items:
70
+ zero: "%{count} مشروع محدد سوف يتم إستيراده"
71
+ one: مشروع واحد محدد سوف يتم إستيراده
72
+ two: "مشروع واحد محدد سوف يتم إستيراده"
73
+ few: "مشروع واحد محدد سوف يتم إستيراده"
74
+ many: "مشروع واحد محدد سوف يتم إستيراده"
75
+ other: "%{count} مشروع محدد سوف يتم إستيراده"
76
+ no_components: لا توجد أى مقومات فى الميزانيه فى هذا الحيز لتوريد المشاريع إلى نتائج.
77
+ origin_component_id: عنصر أساسى
78
+ select_component: اختيار المكون
79
+ results:
96
80
  edit:
97
81
  title: تحرير النتيجة
98
82
  update: تحديث النتيجة
@@ -101,18 +85,10 @@ ar:
101
85
  new:
102
86
  create: إنشاء نتيجة
103
87
  title: نتيجة جديدة
104
- update:
105
- invalid: حدثت مشكلة أثناء تحديث هذه النتيجة
106
- success: تم تحديث النتيجة بنجاح
107
88
  shared:
108
89
  subnav:
109
90
  statuses: الحالات
110
91
  statuses:
111
- create:
112
- invalid: كانت هناك مشكلة في إنشاء هذه الحالة
113
- success: تم إنشاء الحالة بنجاح
114
- destroy:
115
- success: تم حذف الحالة بنجاح
116
92
  edit:
117
93
  title: تحرير الحالة
118
94
  update: تحديث الحالة
@@ -121,15 +97,7 @@ ar:
121
97
  new:
122
98
  create: إنشاء الحالة
123
99
  title: حالة جديدة
124
- update:
125
- invalid: حدثت مشكلة أثناء تحديث هذه الحالة
126
- success: تم تحديث الحالة بنجاح
127
100
  timeline_entries:
128
- create:
129
- invalid: حدثت مشكلة أثناء إنشاء هذا الإدخال
130
- success: تم إنشاء الدخول بنجاح
131
- destroy:
132
- success: تم حذف الإدخال بنجاح
133
101
  edit:
134
102
  title: تحرير الإدخال
135
103
  update: تحديث الإدخال
@@ -138,9 +106,6 @@ ar:
138
106
  new:
139
107
  create: إنشاء الإدخال
140
108
  title: إدخال جديد
141
- update:
142
- invalid: حدثت مشكلة أثناء تحديث هذا الإدخال
143
- success: تم تحديث الإدخال بنجاح
144
109
  admin_log:
145
110
  result:
146
111
  create: "%{user_name} أنشأ النتيجة %{resource_name} في %{space_name}"
@@ -159,18 +124,19 @@ ar:
159
124
  not_found: 'لم يتم العثور على الأصل في قاعدة البيانات (الرقم-المُعرف: %{id})'
160
125
  content_blocks:
161
126
  highlighted_results:
162
- dates: التواريخ
163
127
  results: النتائج
164
- unspecified: غير محدد
165
128
  import_mailer:
166
129
  import:
167
130
  errors: أخطاء
168
- errors_present: حدثت مشكلة في استيراد النتائج
169
131
  row_number: الصف
170
132
  subject: استيراد النتائج بنجاح
171
133
  success: نجاح استيراد النتائج. يمكنك مراجعة النتائج في واجهة الإدارة.
134
+ import_projects_mailer:
135
+ import:
136
+ subject: استيراد المشاريع بنجاح
137
+ success: النتائج المستوردة إلى النتائج في مكون %{component_name}. يمكن معاينة النتائج في واجهة الإدارة.
172
138
  last_activity:
173
- new_result_at_html: "<span>نتيجة جديدة في %{link}</span>"
139
+ new_result: 'النتيجة الجديدة:'
174
140
  models:
175
141
  result:
176
142
  fields:
@@ -193,9 +159,6 @@ ar:
193
159
  fields:
194
160
  entry_date: تاريخ
195
161
  title: العنوان
196
- result_m:
197
- executed: تم التنفيذ
198
- view: عرض
199
162
  results:
200
163
  count:
201
164
  results_count:
@@ -207,7 +170,6 @@ ar:
207
170
  other: "%{count} النتائج"
208
171
  filters:
209
172
  all: الكل
210
- scopes: نطاقات
211
173
  home:
212
174
  categories_label: الفئات
213
175
  subcategories_label: الفئات الفرعية