decidim-debates 0.23.2 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/admin/decidim_debates_manifest.js +1 -0
- data/app/assets/javascripts/decidim/debates/admin/debates.js.es6 +25 -0
- data/app/cells/decidim/debates/debate_activity_cell.rb +13 -5
- data/app/cells/decidim/debates/debate_m/open_date.erb +7 -0
- data/app/cells/decidim/debates/debate_m_cell.rb +1 -1
- data/app/cells/decidim/debates/reported_content/show.erb +4 -0
- data/app/cells/decidim/debates/reported_content_cell.rb +13 -0
- data/app/commands/decidim/debates/admin/create_debate.rb +3 -2
- data/app/commands/decidim/debates/admin/update_debate.rb +2 -1
- data/app/commands/decidim/debates/create_debate.rb +1 -0
- data/app/commands/decidim/debates/update_debate.rb +2 -1
- data/app/controllers/decidim/debates/debates_controller.rb +1 -5
- data/app/forms/decidim/debates/admin/close_debate_form.rb +1 -1
- data/app/forms/decidim/debates/admin/debate_form.rb +30 -2
- data/app/forms/decidim/debates/close_debate_form.rb +1 -1
- data/app/forms/decidim/debates/debate_form.rb +17 -0
- data/app/models/decidim/debates/debate.rb +11 -1
- data/app/permissions/decidim/debates/admin/permissions.rb +8 -1
- data/app/views/decidim/debates/admin/debates/_form.html.erb +15 -2
- data/app/views/decidim/debates/admin/debates/index.html.erb +10 -2
- data/app/views/decidim/debates/debates/_filters.html.erb +1 -1
- data/app/views/decidim/debates/debates/_filters_small_view.html.erb +1 -1
- data/app/views/decidim/debates/debates/_form.html.erb +6 -0
- data/app/views/decidim/debates/debates/show.html.erb +5 -21
- data/config/locales/ca.yml +18 -4
- data/config/locales/cs.yml +18 -4
- data/config/locales/de.yml +18 -4
- data/config/locales/en.yml +18 -4
- data/config/locales/es-MX.yml +17 -4
- data/config/locales/es-PY.yml +17 -4
- data/config/locales/es.yml +17 -4
- data/config/locales/fi-plain.yml +18 -4
- data/config/locales/fi.yml +18 -4
- data/config/locales/fr-CA.yml +18 -4
- data/config/locales/fr.yml +18 -4
- data/config/locales/gl.yml +10 -4
- data/config/locales/ja.yml +10 -4
- data/config/locales/nl.yml +18 -4
- data/config/locales/no.yml +10 -4
- data/config/locales/pl.yml +37 -6
- data/config/locales/ro-RO.yml +64 -0
- data/config/locales/sv.yml +10 -4
- data/config/locales/tr-TR.yml +17 -4
- data/config/locales/zh-CN.yml +10 -4
- data/db/migrate/20200930145546_add_scope_to_debates_debate.rb +7 -0
- data/db/migrate/20201126112752_archive_debates.rb +8 -0
- data/db/migrate/20210125101735_revert_archive_debates.rb +8 -0
- data/db/migrate/20210310120652_add_followable_counter_cache_to_debates.rb +16 -0
- data/lib/decidim/api/debate_type.rb +26 -0
- data/lib/decidim/api/debates_type.rb +26 -0
- data/lib/decidim/debates.rb +1 -0
- data/lib/decidim/debates/admin_engine.rb +4 -0
- data/lib/decidim/debates/api.rb +8 -0
- data/lib/decidim/debates/component.rb +22 -10
- data/lib/decidim/debates/test/factories.rb +1 -1
- data/lib/decidim/debates/version.rb +1 -1
- metadata +24 -14
- data/app/types/decidim/debates/debate_type.rb +0 -28
- data/app/types/decidim/debates/debates_type.rb +0 -32
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Debates
|
5
|
-
DebateType = GraphQL::ObjectType.define do
|
6
|
-
interfaces [
|
7
|
-
-> { Decidim::Core::CategorizableInterface },
|
8
|
-
-> { Decidim::Comments::CommentableInterface },
|
9
|
-
-> { Decidim::Core::AuthorableInterface }
|
10
|
-
]
|
11
|
-
|
12
|
-
name "Debate"
|
13
|
-
description "A debate"
|
14
|
-
|
15
|
-
field :id, !types.ID, "The internal ID for this debate"
|
16
|
-
field :title, Decidim::Core::TranslatedFieldType, "The title for this debate"
|
17
|
-
field :description, Decidim::Core::TranslatedFieldType, "The description for this debate"
|
18
|
-
field :instructions, Decidim::Core::TranslatedFieldType, "The instructions for this debate"
|
19
|
-
field :startTime, Decidim::Core::DateTimeType, "The start time for this debate", property: :start_time
|
20
|
-
field :endTime, Decidim::Core::DateTimeType, "The end time for this debate", property: :end_time
|
21
|
-
field :image, types.String, "The image of this debate"
|
22
|
-
field :createdAt, Decidim::Core::DateTimeType, "When this debate was created", property: :created_at
|
23
|
-
field :updatedAt, Decidim::Core::DateTimeType, "When this debate was updated", property: :updated_at
|
24
|
-
field :informationUpdates, Decidim::Core::TranslatedFieldType, "The information updates for this debate", property: :information_updates
|
25
|
-
field :reference, types.String, "The reference for this debate"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Debates
|
5
|
-
DebatesType = GraphQL::ObjectType.define do
|
6
|
-
interfaces [-> { Decidim::Core::ComponentInterface }]
|
7
|
-
|
8
|
-
name "Debates"
|
9
|
-
description "A debates component of a participatory space."
|
10
|
-
|
11
|
-
connection :debates, DebateType.connection_type do
|
12
|
-
resolve ->(component, _args, _ctx) {
|
13
|
-
DebatesTypeHelper.base_scope(component).includes(:component)
|
14
|
-
}
|
15
|
-
end
|
16
|
-
|
17
|
-
field(:debate, DebateType) do
|
18
|
-
argument :id, !types.ID
|
19
|
-
|
20
|
-
resolve ->(component, args, _ctx) {
|
21
|
-
DebatesTypeHelper.base_scope(component).find_by(id: args[:id])
|
22
|
-
}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
module DebatesTypeHelper
|
27
|
-
def self.base_scope(component)
|
28
|
-
Debate.where(component: component)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|