decidim-accountability 0.23.5 → 0.24.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/decidim/accountability/accountability/_categories.scss +5 -4
  3. data/app/cells/decidim/accountability/content_blocks/highlighted_results/elements.erb +5 -0
  4. data/app/cells/decidim/accountability/content_blocks/highlighted_results/heading.erb +1 -0
  5. data/app/cells/decidim/accountability/content_blocks/highlighted_results_cell.rb +18 -0
  6. data/app/cells/decidim/accountability/result_cell.rb +21 -0
  7. data/app/cells/decidim/accountability/result_m/data.erb +23 -0
  8. data/app/cells/decidim/accountability/result_m/footer.erb +22 -0
  9. data/app/cells/decidim/accountability/result_m/tags.erb +1 -0
  10. data/app/cells/decidim/accountability/result_m_cell.rb +37 -0
  11. data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +59 -0
  12. data/app/controllers/decidim/accountability/admin/attachment_collections_controller.rb +32 -0
  13. data/app/controllers/decidim/accountability/admin/attachments_controller.rb +32 -0
  14. data/app/controllers/decidim/accountability/admin/results_controller.rb +7 -2
  15. data/app/helpers/decidim/accountability/admin/filterable_helper.rb +10 -0
  16. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +3 -1
  17. data/app/models/decidim/accountability/result.rb +15 -2
  18. data/app/models/decidim/accountability/status.rb +5 -0
  19. data/app/views/decidim/accountability/admin/results/index.html.erb +52 -2
  20. data/app/views/decidim/accountability/results/_show_leaf.html.erb +2 -0
  21. data/app/views/decidim/accountability/results/_show_parent.html.erb +2 -0
  22. data/config/locales/ar.yml +0 -4
  23. data/config/locales/bg.yml +0 -4
  24. data/config/locales/ca.yml +24 -4
  25. data/config/locales/cs.yml +24 -4
  26. data/config/locales/da.yml +0 -4
  27. data/config/locales/de.yml +24 -4
  28. data/config/locales/el.yml +0 -4
  29. data/config/locales/en.yml +24 -4
  30. data/config/locales/es-MX.yml +24 -4
  31. data/config/locales/es-PY.yml +24 -4
  32. data/config/locales/es.yml +24 -4
  33. data/config/locales/eu.yml +0 -4
  34. data/config/locales/fi-plain.yml +24 -4
  35. data/config/locales/fi.yml +24 -4
  36. data/config/locales/fr-CA.yml +24 -4
  37. data/config/locales/fr.yml +24 -4
  38. data/config/locales/gl.yml +24 -4
  39. data/config/locales/hu.yml +0 -4
  40. data/config/locales/id-ID.yml +0 -4
  41. data/config/locales/is-IS.yml +24 -4
  42. data/config/locales/it.yml +24 -4
  43. data/config/locales/ja.yml +24 -4
  44. data/config/locales/lv.yml +0 -4
  45. data/config/locales/nl.yml +24 -4
  46. data/config/locales/no.yml +21 -4
  47. data/config/locales/pl.yml +24 -4
  48. data/config/locales/pt-BR.yml +0 -4
  49. data/config/locales/pt.yml +0 -4
  50. data/config/locales/ro-RO.yml +24 -4
  51. data/config/locales/ru.yml +0 -4
  52. data/config/locales/si-LK.yml +3 -0
  53. data/config/locales/sk.yml +7 -4
  54. data/config/locales/sl.yml +0 -4
  55. data/config/locales/sr-CS.yml +0 -4
  56. data/config/locales/sv.yml +27 -7
  57. data/config/locales/tr-TR.yml +22 -4
  58. data/config/locales/uk.yml +0 -4
  59. data/config/locales/zh-CN.yml +0 -4
  60. data/lib/decidim/accountability.rb +1 -0
  61. data/lib/decidim/accountability/admin_engine.rb +2 -0
  62. data/lib/decidim/accountability/api.rb +10 -0
  63. data/lib/decidim/accountability/component.rb +20 -8
  64. data/lib/decidim/accountability/engine.rb +0 -17
  65. data/lib/decidim/accountability/version.rb +1 -1
  66. data/lib/decidim/api/accountability_type.rb +26 -0
  67. data/lib/decidim/api/result_type.rb +32 -0
  68. data/lib/decidim/api/status_type.rb +19 -0
  69. data/lib/decidim/api/timeline_entry_type.rb +17 -0
  70. metadata +39 -28
  71. data/app/types/decidim/accountability/accountability_type.rb +0 -32
  72. data/app/types/decidim/accountability/result_type.rb +0 -35
  73. data/app/types/decidim/accountability/status_type.rb +0 -20
  74. data/app/types/decidim/accountability/timeline_entry_type.rb +0 -18
  75. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_results.html.erb +0 -12
  76. data/app/views/decidim/participatory_processes/participatory_process_groups/_result.html.erb +0 -32
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- AccountabilityType = GraphQL::ObjectType.define do
6
- interfaces [-> { Decidim::Core::ComponentInterface }]
7
-
8
- name "Accountability"
9
- description "An accountability component of a participatory space."
10
-
11
- connection :results, ResultType.connection_type do
12
- resolve ->(component, _args, _ctx) {
13
- ResultTypeHelper.base_scope(component).includes(:component)
14
- }
15
- end
16
-
17
- field(:result, ResultType) do
18
- argument :id, !types.ID
19
-
20
- resolve ->(component, args, _ctx) {
21
- ResultTypeHelper.base_scope(component).find_by(id: args[:id])
22
- }
23
- end
24
- end
25
-
26
- module ResultTypeHelper
27
- def self.base_scope(component)
28
- Result.where(component: component)
29
- end
30
- end
31
- end
32
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- ResultType = GraphQL::ObjectType.define do
6
- interfaces [
7
- -> { Decidim::Core::ComponentInterface },
8
- -> { Decidim::Core::CategorizableInterface },
9
- -> { Decidim::Comments::CommentableInterface },
10
- -> { Decidim::Core::ScopableInterface }
11
- ]
12
-
13
- name "Result"
14
- description "A result"
15
-
16
- field :id, !types.ID, "The internal ID for this result"
17
- field :title, Decidim::Core::TranslatedFieldType, "The title for this result"
18
- field :description, Decidim::Core::TranslatedFieldType, "The description for this result"
19
- field :reference, types.String, "The reference for this result"
20
- field :startDate, Decidim::Core::DateType, "The start date for this result", property: :start_date
21
- field :endDate, Decidim::Core::DateType, "The end date for this result", property: :end_date
22
- field :progress, types.Float, "The progress for this result"
23
- field :createdAt, Decidim::Core::DateTimeType, "When this result was created", property: :created_at
24
- field :updatedAt, Decidim::Core::DateTimeType, "When this result was updated", property: :updated_at
25
- field :childrenCount, types.Int, "The number of children results", property: :children_count
26
- field :weight, !types.Int, "The order of this result"
27
- field :externalId, types.String, "The external ID for this result", property: :external_id
28
-
29
- field :children, types[Decidim::Accountability::ResultType], "The childrens results"
30
- field :parent, Decidim::Accountability::ResultType, "The parent result"
31
- field :status, Decidim::Accountability::StatusType, "The status for this result"
32
- field :timelineEntries, types[Decidim::Accountability::TimelineEntryType], "The timeline entries for this result", property: :timeline_entries
33
- end
34
- end
35
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- StatusType = GraphQL::ObjectType.define do
6
- name "Status"
7
- description "A status"
8
-
9
- field :id, !types.ID, "The internal ID for this status"
10
- field :key, types.String, "The key for this status"
11
- field :name, Decidim::Core::TranslatedFieldType, "The name for this status"
12
- field :createdAt, Decidim::Core::DateType, "When this status was created", property: :created_at
13
- field :updatedAt, Decidim::Core::DateType, "When this status was updated", property: :updated_at
14
- field :description, Decidim::Core::TranslatedFieldType, "The description for this status"
15
- field :progress, types.Int, "The progress for this status"
16
-
17
- field :results, types[Decidim::Accountability::ResultType], "The results for this status"
18
- end
19
- end
20
- end
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Decidim
4
- module Accountability
5
- TimelineEntryType = GraphQL::ObjectType.define do
6
- name "TimelineEntry"
7
- description "A Timeline Entry"
8
-
9
- field :id, !types.ID, "The internal ID for this timeline entry"
10
- field :entryDate, Decidim::Core::DateType, "The entry date for this timeline entry", property: :entry_date
11
- field :description, Decidim::Core::TranslatedFieldType, "The description for this timeline entry"
12
- field :createdAt, Decidim::Core::DateTimeType, "When this timeline entry was created", property: :created_at
13
- field :updatedAt, Decidim::Core::DateTimeType, "When this timeline entry was updated", property: :updated_at
14
-
15
- field :result, Decidim::Accountability::ResultType, "The result for this timeline entry"
16
- end
17
- end
18
- end
@@ -1,12 +0,0 @@
1
- <% if results.any? %>
2
- <section class="section row collapse highlighted_results">
3
- <h2 class="section-heading"><%= t(".results") %></h2>
4
- <div class="row">
5
- <div class="columns accountability">
6
- <div class="card card--action card--list">
7
- <%= render partial: "decidim/participatory_processes/participatory_process_groups/result", collection: results %>
8
- </div>
9
- </div>
10
- </div>
11
- </section>
12
- <% end %>
@@ -1,32 +0,0 @@
1
- <div class="card--list__item">
2
- <%= icon "actions", class: "card--list__icon", remove_icon_class: true %>
3
-
4
- <%= link_to resource_locator(result).path, class: "card--list__text card__link card__link--block" do %>
5
- <h5 class="card--list__heading">
6
- <%= translated_attribute(result.title) %>
7
- </h5>
8
-
9
- <div class="text-small card--meta">
10
- <% if result.start_date %>
11
- <strong><%= t("models.result.fields.start_date", scope: "decidim.accountability") %></strong>
12
- <span><%= result.start_date %></span>
13
- <% end %>
14
-
15
- <% if result.end_date %>
16
- <strong><%= t("models.result.fields.end_date", scope: "decidim.accountability") %></strong>
17
- <span><%= result.end_date %></span>
18
- <% end %>
19
-
20
- <% if result.status %>
21
- <strong><%= t("models.result.fields.status", scope: "decidim.accountability") %></strong>
22
- <span><%= translated_attribute(result.status.name) %></span>
23
- <% end %>
24
- </div>
25
- <% end %>
26
-
27
- <% if result.progress.present? %>
28
- <div class="card--list__data">
29
- <span class="card--list__data__number"><%= display_percentage result.progress %></span>
30
- </div>
31
- <% end %>
32
- </div>