decidim-accountability 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +46 -0
  3. data/Rakefile +3 -0
  4. data/app/assets/config/decidim_accountability_admin_manifest.js +1 -0
  5. data/app/assets/config/decidim_accountability_manifest.js +1 -0
  6. data/app/assets/images/decidim/accountability/icon.svg +1 -0
  7. data/app/assets/javascripts/decidim/accountability/accountability.js.es6 +10 -0
  8. data/app/assets/javascripts/decidim/accountability/admin/accountability_admin.js +8 -0
  9. data/app/assets/stylesheets/decidim/accountability/_accountability.scss +1 -0
  10. data/app/assets/stylesheets/decidim/accountability/accountability/_cards.scss +13 -0
  11. data/app/assets/stylesheets/decidim/accountability/accountability/_categories.scss +109 -0
  12. data/app/assets/stylesheets/decidim/accountability/accountability/_lines_breadcrumb.scss +29 -0
  13. data/app/assets/stylesheets/decidim/accountability/accountability/_results.scss +144 -0
  14. data/app/commands/decidim/accountability/admin/create_result.rb +72 -0
  15. data/app/commands/decidim/accountability/admin/create_status.rb +42 -0
  16. data/app/commands/decidim/accountability/admin/create_timeline_entry.rb +40 -0
  17. data/app/commands/decidim/accountability/admin/update_result.rb +80 -0
  18. data/app/commands/decidim/accountability/admin/update_status.rb +46 -0
  19. data/app/commands/decidim/accountability/admin/update_template_texts.rb +47 -0
  20. data/app/commands/decidim/accountability/admin/update_timeline_entry.rb +44 -0
  21. data/app/controllers/decidim/accountability/admin/application_controller.rb +15 -0
  22. data/app/controllers/decidim/accountability/admin/imports_controller.rb +30 -0
  23. data/app/controllers/decidim/accountability/admin/results_controller.rb +84 -0
  24. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +70 -0
  25. data/app/controllers/decidim/accountability/admin/template_texts_controller.rb +38 -0
  26. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +75 -0
  27. data/app/controllers/decidim/accountability/application_controller.rb +13 -0
  28. data/app/controllers/decidim/accountability/result_widgets_controller.rb +19 -0
  29. data/app/controllers/decidim/accountability/results_controller.rb +77 -0
  30. data/app/forms/decidim/accountability/admin/result_form.rb +74 -0
  31. data/app/forms/decidim/accountability/admin/status_form.rb +21 -0
  32. data/app/forms/decidim/accountability/admin/template_texts_form.rb +19 -0
  33. data/app/forms/decidim/accountability/admin/timeline_entry_form.rb +20 -0
  34. data/app/helpers/decidim/accountability/application_helper.rb +50 -0
  35. data/app/models/decidim/accountability/application_record.rb +10 -0
  36. data/app/models/decidim/accountability/result.rb +66 -0
  37. data/app/models/decidim/accountability/status.rb +18 -0
  38. data/app/models/decidim/accountability/template_texts.rb +17 -0
  39. data/app/models/decidim/accountability/timeline_entry.rb +11 -0
  40. data/app/services/decidim/accountability/csv_exporter.rb +77 -0
  41. data/app/services/decidim/accountability/csv_importer.rb +106 -0
  42. data/app/services/decidim/accountability/result_search.rb +40 -0
  43. data/app/services/decidim/accountability/result_stats_calculator.rb +52 -0
  44. data/app/services/decidim/accountability/results_calculator.rb +34 -0
  45. data/app/views/decidim/accountability/admin/imports/new.html.erb +47 -0
  46. data/app/views/decidim/accountability/admin/results/_form.html.erb +70 -0
  47. data/app/views/decidim/accountability/admin/results/edit.html.erb +9 -0
  48. data/app/views/decidim/accountability/admin/results/index.html.erb +52 -0
  49. data/app/views/decidim/accountability/admin/results/new.html.erb +9 -0
  50. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +3 -0
  51. data/app/views/decidim/accountability/admin/statuses/_form.html.erb +23 -0
  52. data/app/views/decidim/accountability/admin/statuses/edit.html.erb +8 -0
  53. data/app/views/decidim/accountability/admin/statuses/index.html.erb +45 -0
  54. data/app/views/decidim/accountability/admin/statuses/new.html.erb +8 -0
  55. data/app/views/decidim/accountability/admin/template_texts/_form.html.erb +30 -0
  56. data/app/views/decidim/accountability/admin/template_texts/edit.html.erb +8 -0
  57. data/app/views/decidim/accountability/admin/timeline_entries/_form.html.erb +15 -0
  58. data/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb +8 -0
  59. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +41 -0
  60. data/app/views/decidim/accountability/admin/timeline_entries/new.html.erb +8 -0
  61. data/app/views/decidim/accountability/result_widgets/show.html.erb +2 -0
  62. data/app/views/decidim/accountability/results/_home_categories.html.erb +73 -0
  63. data/app/views/decidim/accountability/results/_home_header.html.erb +24 -0
  64. data/app/views/decidim/accountability/results/_linked_results.html.erb +12 -0
  65. data/app/views/decidim/accountability/results/_nav_breadcrumb.html.erb +29 -0
  66. data/app/views/decidim/accountability/results/_results_leaf.html.erb +45 -0
  67. data/app/views/decidim/accountability/results/_results_parent.html.erb +32 -0
  68. data/app/views/decidim/accountability/results/_scope_filters.html.erb +14 -0
  69. data/app/views/decidim/accountability/results/_search.html.erb +12 -0
  70. data/app/views/decidim/accountability/results/_show_leaf.html.erb +79 -0
  71. data/app/views/decidim/accountability/results/_show_parent.html.erb +25 -0
  72. data/app/views/decidim/accountability/results/_stats.html.erb +11 -0
  73. data/app/views/decidim/accountability/results/_stats_box.html.erb +36 -0
  74. data/app/views/decidim/accountability/results/_tags.html.erb +10 -0
  75. data/app/views/decidim/accountability/results/_timeline.html.erb +24 -0
  76. data/app/views/decidim/accountability/results/home.html.erb +9 -0
  77. data/app/views/decidim/accountability/results/index.html.erb +19 -0
  78. data/app/views/decidim/accountability/results/index.js.erb +2 -0
  79. data/app/views/decidim/accountability/results/show.html.erb +14 -0
  80. data/config/i18n-tasks.yml +10 -0
  81. data/config/locales/ca.yml +190 -0
  82. data/config/locales/en.yml +190 -0
  83. data/config/locales/es.yml +190 -0
  84. data/config/locales/eu.yml +79 -0
  85. data/config/locales/fi.yml +77 -0
  86. data/db/migrate/20170425154712_create_accountability_statuses.rb +13 -0
  87. data/db/migrate/20170426104125_create_accountability_results.rb +22 -0
  88. data/db/migrate/20170508104902_add_description_and_progress_to_statuses.rb +6 -0
  89. data/db/migrate/20170508161109_create_template_texts.rb +14 -0
  90. data/db/migrate/20170606102902_add_index_to_accountability_results_on_external_id.rb +5 -0
  91. data/db/migrate/20170620154712_create_accountability_timeline_entries.rb +13 -0
  92. data/db/migrate/20170623094200_migrate_accountability_results_category.rb +13 -0
  93. data/db/migrate/20170623144902_add_children_counter_cache_to_results.rb +5 -0
  94. data/lib/decidim/accountability.rb +12 -0
  95. data/lib/decidim/accountability/admin.rb +10 -0
  96. data/lib/decidim/accountability/admin_engine.rb +32 -0
  97. data/lib/decidim/accountability/feature.rb +86 -0
  98. data/lib/decidim/accountability/list_engine.rb +27 -0
  99. data/lib/decidim/accountability/test/factories.rb +45 -0
  100. metadata +238 -0
@@ -0,0 +1,9 @@
1
+ <%= decidim_form_for(@form, html: { class: "form edit_result" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".update") %>
6
+ </div>
7
+ <% end %>
8
+
9
+ <%= javascript_include_tag "decidim/accountability/admin/accountability_admin" %>
@@ -0,0 +1,52 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= link_to "#{translated_attribute(parent_result.title)} > ", edit_result_path(parent_result) if parent_result %>
5
+ <%= t(".title") %>
6
+ <%= link_to t("actions.new", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")), new_result_path(parent_id: parent_result), class: 'button tiny button--title' if can? :manage, current_feature %>
7
+ <%= render partial: "decidim/accountability/admin/shared/subnav" unless parent_result %>
8
+ </h2>
9
+ </div>
10
+
11
+ <div class="card-section">
12
+ <div class="table-scroll">
13
+ <table class="table-list">
14
+ <thead>
15
+ <tr>
16
+ <th><%= t("models.result.fields.title", scope: "decidim.accountability") %></th>
17
+ <th class="actions"><%= t("actions.title", scope: "decidim.accountability") %></th>
18
+ </tr>
19
+ </thead>
20
+ <tbody>
21
+ <% results.each do |result| %>
22
+ <tr data-id="<%= result.id %>">
23
+ <td>
24
+ <%= link_to translated_attribute(result.title), results_path(parent_id: result.id) %><br />
25
+ </td>
26
+ <td class="table-list__actions">
27
+ <%= icon_link_to "eye", resource_locator(result).path, t("actions.preview", scope: "decidim.accountability"), class: "action-icon--preview", target: :blank %>
28
+
29
+ <% if can? :update, current_feature %>
30
+ <%= icon_link_to "plus", results_path(parent_id: result.id), t("actions.new", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")), class: "action-icon--plus" %>
31
+ <% end %>
32
+
33
+ <% if can? :update, current_feature %>
34
+ <%= icon_link_to "clock", result_timeline_entries_path(result), t("actions.timeline_entries", scope: "decidim.accountability"), class: "action-icon--clock" %>
35
+ <% end %>
36
+
37
+ <% if can? :update, current_feature %>
38
+ <%= icon_link_to "pencil", edit_result_path(result), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %>
39
+ <% end %>
40
+
41
+ <% if can? :destroy, current_feature %>
42
+ <%= icon_link_to "circle-x", result_path(result), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability", name: t("models.result.name", scope: "decidim.accountability.admin")) } %>
43
+ <% end %>
44
+ </td>
45
+ </tr>
46
+ <% end %>
47
+ </tbody>
48
+ </table>
49
+ <%= paginate results, theme: "decidim" %>
50
+ </div>
51
+ </div>
52
+ </div>
@@ -0,0 +1,9 @@
1
+ <%= decidim_form_for(@form, html: { class: "form new_result" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".create") %>
6
+ </div>
7
+ <% end %>
8
+
9
+ <%= javascript_include_tag "decidim/accountability/admin/accountability_admin" %>
@@ -0,0 +1,3 @@
1
+ <%= link_to t(".import_csv"), new_import_path, class: 'button tiny button--title' %>
2
+ <%= link_to t(".statuses"), statuses_path, class: 'button tiny button--title' %>
3
+ <%= link_to t(".template_texts"), edit_template_texts_path, class: 'button tiny button--title' %>
@@ -0,0 +1,23 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= title %></h2>
4
+ </div>
5
+
6
+ <div class="card-section">
7
+ <div class="row column">
8
+ <%= form.text_field :key, autofocus: true %>
9
+ </div>
10
+
11
+ <div class="row column">
12
+ <%= form.translated :text_field, :name %>
13
+ </div>
14
+
15
+ <div class="row column">
16
+ <%= form.translated :text_area, :description %>
17
+ </div>
18
+
19
+ <div class="row column">
20
+ <%= form.number_field :progress %>
21
+ </div>
22
+ </div>
23
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= decidim_form_for(@form, html: { class: "form edit_status" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".update") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,45 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t(".title") %>
5
+ <%= link_to t("actions.new", scope: "decidim.accountability", name: t("models.status.name", scope: "decidim.accountability.admin")), new_status_path, class: 'button tiny button--title' if can? :manage, current_feature %>
6
+ <%= render partial: "decidim/accountability/admin/shared/subnav" %>
7
+ </h2>
8
+ </div>
9
+
10
+ <div class="card-section">
11
+ <div class="table-scroll">
12
+ <table class="table-list">
13
+ <thead>
14
+ <tr>
15
+ <th><%= t("models.status.fields.key", scope: "decidim.accountability") %></th>
16
+ <th><%= t("models.status.fields.name", scope: "decidim.accountability") %></th>
17
+ <th><%= t("models.status.fields.description", scope: "decidim.accountability") %></th>
18
+ <th><%= t("models.status.fields.progress", scope: "decidim.accountability") %></th>
19
+ <th class="actions"><%= t("actions.title", scope: "decidim.accountability") %></th>
20
+ </tr>
21
+ </thead>
22
+ <tbody>
23
+ <% statuses.each do |status| %>
24
+ <tr data-id="<%= status.id %>">
25
+ <td><%= status.key %><br /></td>
26
+ <td><%= translated_attribute(status.name) %></td>
27
+ <td><%= truncate translated_attribute(status.description), lenght: 50 %></td>
28
+ <td><%= status.progress %></td>
29
+ <td class="table-list__actions">
30
+ <% if can? :update, current_feature %>
31
+ <%= icon_link_to "pencil", edit_status_path(status), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %>
32
+ <% end %>
33
+
34
+ <% if can? :destroy, current_feature %>
35
+ <%= icon_link_to "circle-x", status_path(status), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability", name: t("models.status.name", scope: "decidim.accountability.admin")) } %>
36
+ <% end %>
37
+ </td>
38
+ </tr>
39
+ <% end %>
40
+ </tbody>
41
+ </table>
42
+ <%= paginate statuses, theme: "decidim" %>
43
+ </div>
44
+ </div>
45
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= decidim_form_for(@form, html: { class: "form new_status" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".create") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,30 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= t(".title") %>
5
+ <%= render partial: "decidim/accountability/admin/shared/subnav" %>
6
+ </h2>
7
+ </div>
8
+
9
+ <div class="card-section">
10
+ <div class="row column">
11
+ <%= form.translated :editor, :intro, autofocus: true %>
12
+ </div>
13
+
14
+ <div class="row column">
15
+ <%= form.translated :text_field, :categories_label %>
16
+ </div>
17
+
18
+ <div class="row column">
19
+ <%= form.translated :text_field, :subcategories_label %>
20
+ </div>
21
+
22
+ <div class="row column">
23
+ <%= form.translated :text_field, :heading_parent_level_results %>
24
+ </div>
25
+
26
+ <div class="row column">
27
+ <%= form.translated :text_field, :heading_leaf_level_results %>
28
+ </div>
29
+ </div>
30
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= decidim_form_for(@form, url: template_texts_path, html: { class: "form edit_template_texts" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".update") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,15 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= title %></h2>
4
+ </div>
5
+
6
+ <div class="card-section">
7
+ <div class="row column">
8
+ <%= form.date_field :entry_date %>
9
+ </div>
10
+
11
+ <div class="row column">
12
+ <%= form.translated :text_field, :description %>
13
+ </div>
14
+ </div>
15
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= decidim_form_for([result, @form], html: { class: "form edit_timeline_entry" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".update") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,41 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
4
+ <%= link_to "#{translated_attribute(result.title)} > ", edit_result_path(result)%>
5
+ <%= t(".title") %>
6
+ <%= link_to t("actions.new", scope: "decidim.accountability", name: t("models.timeline_entry.name", scope: "decidim.accountability.admin")), new_result_timeline_entry_path(result), class: 'button tiny button--title' if can? :manage, current_feature %>
7
+ </h2>
8
+ </div>
9
+
10
+ <div class="card-section">
11
+ <div class="table-scroll">
12
+ <table class="table-list">
13
+ <thead>
14
+ <tr>
15
+ <th><%= t("models.timeline_entry.fields.entry_date", scope: "decidim.accountability") %></th>
16
+ <th><%= t("models.timeline_entry.fields.description", scope: "decidim.accountability") %></th>
17
+ <th class="actions"><%= t("actions.title", scope: "decidim.accountability") %></th>
18
+ </tr>
19
+ </thead>
20
+ <tbody>
21
+ <% timeline_entries.each do |timeline_entry| %>
22
+ <tr data-id="<%= timeline_entry.id %>">
23
+ <td><%= timeline_entry.entry_date %><br /></td>
24
+ <td><%= translated_attribute(timeline_entry.description) %></td>
25
+ <td class="table-list__actions">
26
+ <% if can? :update, current_feature %>
27
+ <%= icon_link_to "pencil", edit_result_timeline_entry_path(timeline_entry.result, timeline_entry), t("actions.edit", scope: "decidim.accountability"), class: "action-icon--edit" %>
28
+ <% end %>
29
+
30
+ <% if can? :destroy, current_feature %>
31
+ <%= icon_link_to "circle-x", result_timeline_entry_path(timeline_entry.result, timeline_entry), t("actions.destroy", scope: "decidim.accountability"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.accountability") } %>
32
+ <% end %>
33
+ </td>
34
+ </tr>
35
+ <% end %>
36
+ </tbody>
37
+ </table>
38
+ <%= paginate timeline_entries, theme: "decidim" %>
39
+ </div>
40
+ </div>
41
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= decidim_form_for([result, @form], html: { class: "form new_timeline_entry" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3
+
4
+ <div class="button--double form-general-submit">
5
+ <%= f.submit t(".create") %>
6
+ </div>
7
+ <% end %>
8
+
@@ -0,0 +1,2 @@
1
+ <% content_for(:title, translated_attribute(model.title)) %>
2
+ <%== translated_attribute model.description %>
@@ -0,0 +1,73 @@
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>
17
+ </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: { category_id: category, scope_id: current_scope }) %></p>
30
+
31
+ <div class="progress">
32
+ <div class="progress-meter" style="width:<%= progress_calculator(current_scope, category.id) %>%"></div>
33
+ </div>
34
+
35
+ <div class="progress-info">
36
+ <div class="progress-figure heading3">
37
+ <%= display_percentage progress_calculator(current_scope, category.id) %>
38
+ </div>
39
+ <div class="category--count">
40
+ <%= display_count(category_results_count) if category_results_count && category_results_count > 0 %>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+ <div class="category--elements show-for-medium medium-8 columns">
47
+ <div class="row">
48
+ <% category.subcategories.each do |subcategory| %>
49
+ <% if (subcategory_results_count = count_calculator(current_scope, subcategory.id)) > 0 %>
50
+ <%= link_to results_path(filter: { category_id: subcategory, scope_id: current_scope }), class: "medium-4 columns end card__link card__link--block" do %>
51
+ <div class="category--line">
52
+ <strong><%= translated_attribute(subcategory.name) %></strong>
53
+
54
+ <div class="progress-figure heading3">
55
+ <%= display_percentage progress_calculator(current_scope, subcategory.id) %>
56
+ </div>
57
+
58
+ <div class="category--count">
59
+ <%= display_count subcategory_results_count %>
60
+ </div>
61
+ </div>
62
+ <% end %>
63
+ <% end %>
64
+ <% end %>
65
+
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <% end %>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ </div>
@@ -0,0 +1,24 @@
1
+ <div class="intro section">
2
+ <div class="row">
3
+ <div class="small-12 medium-7 columns">
4
+ <%== translated_attribute template_texts.intro %>
5
+ </div>
6
+
7
+ <div class="small-12 medium-5 columns">
8
+ <div class="progress-level">
9
+ <p><%= t(".global_status") %></p>
10
+
11
+ <div class="progress">
12
+ <div class="progress-meter" style="width:<%= progress_calculator(current_scope, nil) %>%"></div>
13
+ </div>
14
+
15
+ <div class="progress-figure">
16
+ <%= display_percentage progress_calculator(current_scope, nil) %>
17
+ </div>
18
+
19
+ <%= link_to t(".csv_download"), csv_path %>
20
+ </div>
21
+ </div>
22
+
23
+ </div>
24
+ </div>
@@ -0,0 +1,12 @@
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", remove_icon_class: true %>
5
+ <%= link_to decidim_resource_path(result), 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>
@@ -0,0 +1,29 @@
1
+ <div class="lines-breadcrumb">
2
+ <%= link_to t(".global"), root_path %>
3
+ <span class="percentage"><%= display_percentage progress_calculator(current_scope, nil) %></span>
4
+
5
+ <% if category.present? && category.parent.present? %>
6
+ <span class="breadcrumb--separator">></span>
7
+ <div>
8
+ <%= link_to translated_attribute(category.parent.name), results_path(filter: { category_id: category.parent_id }) %>
9
+ <span class="percentage"><%= display_percentage progress_calculator(current_scope, category.parent_id) %></span>
10
+ </div>
11
+ <% end %>
12
+
13
+ <% if category.present? %>
14
+ <span class="breadcrumb--separator">></span>
15
+ <div>
16
+ <%= link_to translated_attribute(category.name), results_path(filter: { category_id: category.id }) %>
17
+ <span class="percentage"><%= display_percentage progress_calculator(current_scope, category.id) %></span>
18
+ </div>
19
+ <% end %>
20
+
21
+ <% if result && result.parent.present? %>
22
+ <span class="breadcrumb--separator">></span>
23
+ <div>
24
+ <%= link_to translated_attribute(result.parent.title), result_path(result.parent) %>
25
+ <span class="percentage"><%= display_percentage result.parent.progress %></span>
26
+ </div>
27
+ <% end %>
28
+
29
+ </div>
@@ -0,0 +1,45 @@
1
+ <div class="title-action">
2
+ <h2 id="results-count" class="title-action__title section-heading">
3
+ <%= heading_leaf_level_results(total_count) %>
4
+ </h2>
5
+ </div>
6
+
7
+ <div class="row">
8
+ <div id="results" class="columns">
9
+ <div class="card card--action card--list">
10
+ <% results.each do |result| %>
11
+ <div class="card--list__item">
12
+ <%= icon "actions", class: "card--list__icon", remove_icon_class: true %>
13
+
14
+ <%= link_to result_path(result), class: "card--list__text card__link card__link--block" do %>
15
+ <h5 class="card--list__heading">
16
+ <%= translated_attribute(result.title) %>
17
+ </h5>
18
+
19
+ <div class="text-small card--meta">
20
+ <% if result.start_date %>
21
+ <strong><%= t("models.result.fields.start_date", scope: "decidim.accountability") %></strong>
22
+ <span><%= result.start_date %></span>
23
+ <% end %>
24
+
25
+ <% if result.end_date %>
26
+ <strong><%= t("models.result.fields.end_date", scope: "decidim.accountability") %></strong>
27
+ <span><%= result.end_date %></span>
28
+ <% end %>
29
+
30
+ <% if result.status %>
31
+ <strong><%= t("models.result.fields.status", scope: "decidim.accountability") %></strong>
32
+ <span><%= translated_attribute(result.status.name) %></span>
33
+ <% end %>
34
+ </div>
35
+ <% end %>
36
+
37
+ <div class="card--list__data">
38
+ <span class="card--list__data__number"><%= display_percentage result.progress %></span>
39
+ </div>
40
+ </div>
41
+ <% end %>
42
+ </div>
43
+ <%= decidim_paginate results, order_start_time: params[:order_start_time], scope_id: params[:scope_id] %>
44
+ </div>
45
+ </div>