decidim-accountability 0.23.1 → 0.24.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) 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 +34 -14
  25. data/config/locales/cs.yml +41 -21
  26. data/config/locales/da.yml +197 -0
  27. data/config/locales/de.yml +42 -22
  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 +33 -13
  33. data/config/locales/eu.yml +8 -12
  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 +48 -5
  39. data/config/locales/hu.yml +0 -4
  40. data/config/locales/id-ID.yml +0 -4
  41. data/config/locales/is-IS.yml +53 -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 +33 -13
  46. data/config/locales/no.yml +22 -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 +33 -9
  51. data/config/locales/ru.yml +0 -4
  52. data/config/locales/si-LK.yml +31 -0
  53. data/config/locales/sk.yml +23 -4
  54. data/config/locales/sl.yml +0 -4
  55. data/config/locales/sr-CS.yml +0 -4
  56. data/config/locales/sv.yml +24 -4
  57. data/config/locales/sw-KE.yml +1 -0
  58. data/config/locales/tr-TR.yml +59 -18
  59. data/config/locales/uk.yml +0 -4
  60. data/config/locales/zh-CN.yml +0 -4
  61. data/lib/decidim/accountability.rb +1 -0
  62. data/lib/decidim/accountability/admin_engine.rb +2 -0
  63. data/lib/decidim/accountability/api.rb +10 -0
  64. data/lib/decidim/accountability/component.rb +20 -8
  65. data/lib/decidim/accountability/engine.rb +0 -17
  66. data/lib/decidim/accountability/version.rb +1 -1
  67. data/lib/decidim/api/accountability_type.rb +26 -0
  68. data/lib/decidim/api/result_type.rb +32 -0
  69. data/lib/decidim/api/status_type.rb +19 -0
  70. data/lib/decidim/api/timeline_entry_type.rb +17 -0
  71. metadata +46 -33
  72. data/app/types/decidim/accountability/accountability_type.rb +0 -32
  73. data/app/types/decidim/accountability/result_type.rb +0 -35
  74. data/app/types/decidim/accountability/status_type.rb +0 -20
  75. data/app/types/decidim/accountability/timeline_entry_type.rb +0 -18
  76. data/app/views/decidim/participatory_processes/participatory_process_groups/_highlighted_results.html.erb +0 -12
  77. 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>