decidim-debates 0.27.8 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/debates/debate_activity_cell.rb +1 -12
- data/app/cells/decidim/debates/debate_card_metadata_cell.rb +43 -0
- data/app/cells/decidim/debates/debate_cell.rb +6 -1
- data/app/cells/decidim/debates/debate_l_cell.rb +49 -0
- data/app/cells/decidim/debates/debate_s_cell.rb +21 -0
- data/app/commands/decidim/debates/admin/close_debate.rb +1 -1
- data/app/commands/decidim/debates/close_debate.rb +1 -1
- data/app/commands/decidim/debates/create_debate.rb +13 -4
- data/app/commands/decidim/debates/update_debate.rb +15 -2
- data/app/controllers/decidim/debates/admin/debate_closes_controller.rb +2 -2
- data/app/controllers/decidim/debates/admin/debates_controller.rb +5 -5
- data/app/controllers/decidim/debates/debates_controller.rb +7 -9
- data/app/events/decidim/debates/close_debate_event.rb +1 -1
- data/app/events/decidim/debates/create_debate_event.rb +15 -1
- data/app/forms/decidim/debates/admin/close_debate_form.rb +1 -1
- data/app/forms/decidim/debates/close_debate_form.rb +2 -2
- data/app/forms/decidim/debates/debate_form.rb +2 -2
- data/app/helpers/decidim/debates/application_helper.rb +42 -17
- data/app/jobs/decidim/debates/hide_all_created_by_author_job.rb +13 -0
- data/app/jobs/decidim/debates/settings_change_job.rb +2 -2
- data/app/models/decidim/debates/debate.rb +4 -10
- data/app/packs/entrypoints/decidim_debates.js +2 -0
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_commented_debates.svg +42 -1
- data/app/permissions/decidim/debates/permissions.rb +0 -6
- data/app/presenters/decidim/debates/admin_log/debate_presenter.rb +6 -2
- data/app/presenters/decidim/debates/admin_log/value_types/debate_title_description_presenter.rb +1 -1
- data/app/presenters/decidim/debates/log/resource_presenter.rb +18 -0
- data/app/views/decidim/debates/admin/debate_closes/edit.html.erb +26 -14
- data/app/views/decidim/debates/admin/debates/_form.html.erb +40 -39
- data/app/views/decidim/debates/admin/debates/edit.html.erb +16 -6
- data/app/views/decidim/debates/admin/debates/index.html.erb +60 -58
- data/app/views/decidim/debates/admin/debates/new.html.erb +16 -6
- data/app/views/decidim/debates/debates/_close_debate_modal.html.erb +22 -11
- data/app/views/decidim/debates/debates/_debates.html.erb +5 -6
- data/app/views/decidim/debates/debates/_form.html.erb +10 -19
- data/app/views/decidim/debates/debates/edit.html.erb +16 -20
- data/app/views/decidim/debates/debates/index.html.erb +19 -23
- data/app/views/decidim/debates/debates/index.js.erb +3 -4
- data/app/views/decidim/debates/debates/new.html.erb +16 -20
- data/app/views/decidim/debates/debates/show.html.erb +106 -109
- data/app/views/decidim/debates/versions/show.html.erb +15 -6
- data/config/locales/ar.yml +7 -17
- data/config/locales/bg.yml +0 -231
- data/config/locales/ca.yml +14 -35
- data/config/locales/cs.yml +13 -34
- data/config/locales/de.yml +14 -35
- data/config/locales/el.yml +10 -28
- data/config/locales/en.yml +13 -34
- data/config/locales/es-MX.yml +12 -33
- data/config/locales/es-PY.yml +13 -34
- data/config/locales/es.yml +15 -36
- data/config/locales/eu.yml +16 -37
- data/config/locales/fi-plain.yml +12 -33
- data/config/locales/fi.yml +12 -33
- data/config/locales/fr-CA.yml +14 -35
- data/config/locales/fr.yml +14 -35
- data/config/locales/ga-IE.yml +0 -15
- data/config/locales/gl.yml +7 -16
- data/config/locales/hu.yml +13 -32
- data/config/locales/id-ID.yml +7 -15
- data/config/locales/is-IS.yml +3 -9
- data/config/locales/it.yml +7 -31
- data/config/locales/ja.yml +13 -37
- data/config/locales/lb.yml +7 -25
- data/config/locales/lt.yml +14 -29
- data/config/locales/lv.yml +6 -17
- data/config/locales/nl.yml +7 -28
- data/config/locales/no.yml +7 -31
- data/config/locales/pl.yml +12 -38
- data/config/locales/pt-BR.yml +7 -39
- data/config/locales/pt.yml +7 -31
- data/config/locales/ro-RO.yml +10 -29
- data/config/locales/ru.yml +3 -12
- data/config/locales/sk.yml +6 -17
- data/config/locales/sl.yml +0 -3
- data/config/locales/sr-CS.yml +0 -6
- data/config/locales/sv.yml +11 -31
- data/config/locales/tr-TR.yml +6 -38
- data/config/locales/uk.yml +3 -12
- data/config/locales/zh-CN.yml +7 -29
- data/config/locales/zh-TW.yml +9 -28
- data/lib/decidim/debates/component.rb +4 -88
- data/lib/decidim/debates/engine.rb +29 -7
- data/lib/decidim/debates/seeds.rb +104 -0
- data/lib/decidim/debates/test/factories.rb +19 -14
- data/lib/decidim/debates/version.rb +1 -1
- metadata +29 -30
- data/app/cells/decidim/debates/debate_m/data.erb +0 -10
- data/app/cells/decidim/debates/debate_m/footer.erb +0 -10
- data/app/cells/decidim/debates/debate_m/multiple_dates.erb +0 -17
- data/app/cells/decidim/debates/debate_m/open_date.erb +0 -7
- data/app/cells/decidim/debates/debate_m/single_date.erb +0 -9
- data/app/cells/decidim/debates/debate_m/tags.erb +0 -1
- data/app/cells/decidim/debates/debate_m_cell.rb +0 -86
- data/app/controllers/decidim/debates/widgets_controller.rb +0 -29
- data/app/views/decidim/debates/debates/_count.html.erb +0 -1
- data/app/views/decidim/debates/debates/_filters.html.erb +0 -34
- data/app/views/decidim/debates/debates/_filters_small_view.html.erb +0 -18
- data/config/locales/he-IL.yml +0 -1
- data/decidim-debates.gemspec +0 -32
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "decidim/components/namer"
|
4
|
+
|
3
5
|
def generate_localized_debate_title
|
4
6
|
Decidim::Faker::Localized.localized { "<script>alert(\"TITLE\");</script> #{generate(:title)}" }
|
5
7
|
end
|
@@ -10,11 +12,17 @@ FactoryBot.define do
|
|
10
12
|
skip_injection { false }
|
11
13
|
end
|
12
14
|
|
13
|
-
title
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
title do
|
16
|
+
if skip_injection
|
17
|
+
Decidim::Faker::Localized.localized { generate(:title) }
|
18
|
+
else
|
19
|
+
Decidim::Faker::Localized.localized { "<script>alert(\"TITLE\");</script> #{generate(:title)}" }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_debate_title } }
|
23
|
+
information_updates { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_debate_title } }
|
24
|
+
instructions { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_debate_title } }
|
25
|
+
component { build(:debates_component) }
|
18
26
|
author { component.try(:organization) }
|
19
27
|
|
20
28
|
trait :open_ama do
|
@@ -26,7 +34,7 @@ FactoryBot.define do
|
|
26
34
|
start_time { nil }
|
27
35
|
end_time { nil }
|
28
36
|
author do
|
29
|
-
build(:user, organization: component.organization
|
37
|
+
build(:user, organization: component.organization) if component
|
30
38
|
end
|
31
39
|
end
|
32
40
|
|
@@ -36,17 +44,17 @@ FactoryBot.define do
|
|
36
44
|
|
37
45
|
trait :user_group_author do
|
38
46
|
author do
|
39
|
-
create(:user, organization: component.organization
|
47
|
+
create(:user, organization: component.organization) if component
|
40
48
|
end
|
41
49
|
|
42
50
|
user_group do
|
43
|
-
create(:user_group, :verified, organization: component.organization, users: [author]
|
51
|
+
create(:user_group, :verified, organization: component.organization, users: [author]) if component
|
44
52
|
end
|
45
53
|
end
|
46
54
|
|
47
55
|
trait :closed do
|
48
56
|
closed_at { Time.current }
|
49
|
-
conclusions {
|
57
|
+
conclusions { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_debate_title } }
|
50
58
|
end
|
51
59
|
|
52
60
|
after(:build) do |debate|
|
@@ -56,12 +64,9 @@ FactoryBot.define do
|
|
56
64
|
end
|
57
65
|
|
58
66
|
factory :debates_component, parent: :component do
|
59
|
-
|
60
|
-
skip_injection { false }
|
61
|
-
end
|
62
|
-
name { generate_component_name(participatory_space.organization.available_locales, :debates, skip_injection: skip_injection) }
|
67
|
+
name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :debates).i18n_name }
|
63
68
|
manifest_name { :debates }
|
64
|
-
participatory_space { create(:participatory_process, :with_steps, organization:
|
69
|
+
participatory_space { create(:participatory_process, :with_steps, organization:) }
|
65
70
|
settings do
|
66
71
|
{
|
67
72
|
comments_enabled: true,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-debates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: decidim-comments
|
@@ -19,56 +19,56 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.28.0.rc4
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.28.0.rc4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: decidim-core
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
34
|
- - '='
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 0.
|
36
|
+
version: 0.28.0.rc4
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - '='
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.28.0.rc4
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: decidim-admin
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
48
|
- - '='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.28.0.rc4
|
51
51
|
type: :development
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - '='
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 0.
|
57
|
+
version: 0.28.0.rc4
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: decidim-dev
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - '='
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 0.
|
64
|
+
version: 0.28.0.rc4
|
65
65
|
type: :development
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - '='
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 0.
|
71
|
+
version: 0.28.0.rc4
|
72
72
|
description: A debates component for decidim's participatory spaces.
|
73
73
|
email:
|
74
74
|
- josepjaume@gmail.com
|
@@ -82,14 +82,10 @@ files:
|
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
84
|
- app/cells/decidim/debates/debate_activity_cell.rb
|
85
|
+
- app/cells/decidim/debates/debate_card_metadata_cell.rb
|
85
86
|
- app/cells/decidim/debates/debate_cell.rb
|
86
|
-
- app/cells/decidim/debates/
|
87
|
-
- app/cells/decidim/debates/
|
88
|
-
- app/cells/decidim/debates/debate_m/multiple_dates.erb
|
89
|
-
- app/cells/decidim/debates/debate_m/open_date.erb
|
90
|
-
- app/cells/decidim/debates/debate_m/single_date.erb
|
91
|
-
- app/cells/decidim/debates/debate_m/tags.erb
|
92
|
-
- app/cells/decidim/debates/debate_m_cell.rb
|
87
|
+
- app/cells/decidim/debates/debate_l_cell.rb
|
88
|
+
- app/cells/decidim/debates/debate_s_cell.rb
|
93
89
|
- app/cells/decidim/debates/reported_content/show.erb
|
94
90
|
- app/cells/decidim/debates/reported_content_cell.rb
|
95
91
|
- app/commands/decidim/debates/admin/close_debate.rb
|
@@ -105,7 +101,6 @@ files:
|
|
105
101
|
- app/controllers/decidim/debates/debates_controller.rb
|
106
102
|
- app/controllers/decidim/debates/orderable.rb
|
107
103
|
- app/controllers/decidim/debates/versions_controller.rb
|
108
|
-
- app/controllers/decidim/debates/widgets_controller.rb
|
109
104
|
- app/events/decidim/debates/close_debate_event.rb
|
110
105
|
- app/events/decidim/debates/create_debate_event.rb
|
111
106
|
- app/events/decidim/debates/creation_disabled_event.rb
|
@@ -117,9 +112,11 @@ files:
|
|
117
112
|
- app/helpers/decidim/debates/admin/application_helper.rb
|
118
113
|
- app/helpers/decidim/debates/application_helper.rb
|
119
114
|
- app/helpers/decidim/debates/debate_cells_helper.rb
|
115
|
+
- app/jobs/decidim/debates/hide_all_created_by_author_job.rb
|
120
116
|
- app/jobs/decidim/debates/settings_change_job.rb
|
121
117
|
- app/models/decidim/debates/application_record.rb
|
122
118
|
- app/models/decidim/debates/debate.rb
|
119
|
+
- app/packs/entrypoints/decidim_debates.js
|
123
120
|
- app/packs/entrypoints/decidim_debates_admin.js
|
124
121
|
- app/packs/images/decidim/debates/decidim_debates.svg
|
125
122
|
- app/packs/images/decidim/gamification/badges/decidim_gamification_badges_commented_debates.svg
|
@@ -129,6 +126,7 @@ files:
|
|
129
126
|
- app/presenters/decidim/debates/admin_log/debate_presenter.rb
|
130
127
|
- app/presenters/decidim/debates/admin_log/value_types/debate_title_description_presenter.rb
|
131
128
|
- app/presenters/decidim/debates/debate_presenter.rb
|
129
|
+
- app/presenters/decidim/debates/log/resource_presenter.rb
|
132
130
|
- app/presenters/decidim/debates/official_author_presenter.rb
|
133
131
|
- app/queries/decidim/debates/metrics/debate_followers_metric_measure.rb
|
134
132
|
- app/queries/decidim/debates/metrics/debate_participants_metric_measure.rb
|
@@ -142,11 +140,8 @@ files:
|
|
142
140
|
- app/views/decidim/debates/admin/debates/index.html.erb
|
143
141
|
- app/views/decidim/debates/admin/debates/new.html.erb
|
144
142
|
- app/views/decidim/debates/debates/_close_debate_modal.html.erb
|
145
|
-
- app/views/decidim/debates/debates/_count.html.erb
|
146
143
|
- app/views/decidim/debates/debates/_debate.html.erb
|
147
144
|
- app/views/decidim/debates/debates/_debates.html.erb
|
148
|
-
- app/views/decidim/debates/debates/_filters.html.erb
|
149
|
-
- app/views/decidim/debates/debates/_filters_small_view.html.erb
|
150
145
|
- app/views/decidim/debates/debates/_form.html.erb
|
151
146
|
- app/views/decidim/debates/debates/edit.html.erb
|
152
147
|
- app/views/decidim/debates/debates/index.html.erb
|
@@ -188,7 +183,6 @@ files:
|
|
188
183
|
- config/locales/ga-IE.yml
|
189
184
|
- config/locales/gl.yml
|
190
185
|
- config/locales/gn-PY.yml
|
191
|
-
- config/locales/he-IL.yml
|
192
186
|
- config/locales/hr-HR.yml
|
193
187
|
- config/locales/hr.yml
|
194
188
|
- config/locales/hu.yml
|
@@ -256,7 +250,6 @@ files:
|
|
256
250
|
- db/migrate/20210125101735_revert_archive_debates.rb
|
257
251
|
- db/migrate/20210310120652_add_followable_counter_cache_to_debates.rb
|
258
252
|
- db/migrate/20210519201932_add_comments_availability_columns_to_debates_table.rb
|
259
|
-
- decidim-debates.gemspec
|
260
253
|
- lib/decidim/api/debate_type.rb
|
261
254
|
- lib/decidim/api/debates_type.rb
|
262
255
|
- lib/decidim/debates.rb
|
@@ -265,28 +258,34 @@ files:
|
|
265
258
|
- lib/decidim/debates/api.rb
|
266
259
|
- lib/decidim/debates/component.rb
|
267
260
|
- lib/decidim/debates/engine.rb
|
261
|
+
- lib/decidim/debates/seeds.rb
|
268
262
|
- lib/decidim/debates/test/factories.rb
|
269
263
|
- lib/decidim/debates/version.rb
|
270
|
-
homepage: https://
|
264
|
+
homepage: https://decidim.org
|
271
265
|
licenses:
|
272
266
|
- AGPL-3.0
|
273
|
-
metadata:
|
267
|
+
metadata:
|
268
|
+
bug_tracker_uri: https://github.com/decidim/decidim/issues
|
269
|
+
documentation_uri: https://docs.decidim.org/
|
270
|
+
funding_uri: https://opencollective.com/decidim
|
271
|
+
homepage_uri: https://decidim.org
|
272
|
+
source_code_uri: https://github.com/decidim/decidim
|
274
273
|
post_install_message:
|
275
274
|
rdoc_options: []
|
276
275
|
require_paths:
|
277
276
|
- lib
|
278
277
|
required_ruby_version: !ruby/object:Gem::Requirement
|
279
278
|
requirements:
|
280
|
-
- - "
|
279
|
+
- - ">="
|
281
280
|
- !ruby/object:Gem::Version
|
282
|
-
version: 3.
|
281
|
+
version: '3.1'
|
283
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
284
283
|
requirements:
|
285
|
-
- - "
|
284
|
+
- - ">"
|
286
285
|
- !ruby/object:Gem::Version
|
287
|
-
version:
|
286
|
+
version: 1.3.1
|
288
287
|
requirements: []
|
289
|
-
rubygems_version: 3.
|
288
|
+
rubygems_version: 3.4.20
|
290
289
|
signing_key:
|
291
290
|
specification_version: 4
|
292
291
|
summary: Decidim debates module
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<% if debate_date.present? %>
|
2
|
-
<div class="card__icondata">
|
3
|
-
<ul class="card-data">
|
4
|
-
<li class="card-data__item">
|
5
|
-
<%= icon "datetime", class: "icon--big", role: "img", aria_label: t("decidim.debates.debates.show.date") %>
|
6
|
-
</li>
|
7
|
-
<%= debate_date %>
|
8
|
-
</ul>
|
9
|
-
</div>
|
10
|
-
<% end %>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<div class="card__footer">
|
2
|
-
<div class="card__support">
|
3
|
-
<% if presenter.last_comment_by %>
|
4
|
-
<% author = presenter.last_comment_by %>
|
5
|
-
<%= cell "decidim/author", author, from: model, author_name_text: t(".commented_time_ago", time: presenter.last_comment_at), context: { extra_classes: ["author-data--small"] } %>
|
6
|
-
<% end %>
|
7
|
-
|
8
|
-
<%= link_to t("participate", scope: "decidim.debates.debates.debate"), resource_path, class: "card__button button button--sc small" %>
|
9
|
-
</div>
|
10
|
-
</div>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<li class="card-data__item">
|
2
|
-
<div class="card-data__item--multiple">
|
3
|
-
<div>
|
4
|
-
<strong>
|
5
|
-
<%= l start_date, format: :decidim_with_month_name %>
|
6
|
-
</strong>
|
7
|
-
<%= formatted_start_time %>
|
8
|
-
</div>
|
9
|
-
<%= icon "arrow-thin-right", class: "icon--big muted", role: "img", "aria-hidden": true %>
|
10
|
-
<div>
|
11
|
-
<strong>
|
12
|
-
<%= l end_date, format: :decidim_with_month_name %>
|
13
|
-
</strong>
|
14
|
-
<%= formatted_end_time %>
|
15
|
-
</div>
|
16
|
-
</div>
|
17
|
-
</li>
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= render partial: "decidim/shared/tags.html", locals: { resource: model, tags_class_extra: "tags--debate" } %>
|
@@ -1,86 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Debates
|
5
|
-
# This cell renders the Medium (:m) debate card
|
6
|
-
# for an given instance of a Debate
|
7
|
-
class DebateMCell < Decidim::CardMCell
|
8
|
-
include DebateCellsHelper
|
9
|
-
|
10
|
-
def date
|
11
|
-
render
|
12
|
-
end
|
13
|
-
|
14
|
-
def has_state?
|
15
|
-
model.closed?
|
16
|
-
end
|
17
|
-
|
18
|
-
def badge_name
|
19
|
-
I18n.t("decidim.debates.debates.closed") if model.closed?
|
20
|
-
end
|
21
|
-
|
22
|
-
def state_classes
|
23
|
-
return ["muted"] if model.closed?
|
24
|
-
|
25
|
-
super
|
26
|
-
end
|
27
|
-
|
28
|
-
def presenter
|
29
|
-
present(model)
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def title
|
35
|
-
presenter.title(html_escape: true)
|
36
|
-
end
|
37
|
-
|
38
|
-
def body
|
39
|
-
decidim_sanitize_editor(present(model).description)
|
40
|
-
end
|
41
|
-
|
42
|
-
def description
|
43
|
-
strip_tags(body).truncate(200, separator: /\s/)
|
44
|
-
end
|
45
|
-
|
46
|
-
def resource_icon
|
47
|
-
icon "debates", class: "icon--big"
|
48
|
-
end
|
49
|
-
|
50
|
-
def spans_multiple_dates?
|
51
|
-
start_date != end_date
|
52
|
-
end
|
53
|
-
|
54
|
-
def has_actions?
|
55
|
-
false
|
56
|
-
end
|
57
|
-
|
58
|
-
def debate_date
|
59
|
-
return render(:open_date) unless start_date && end_date
|
60
|
-
return render(:multiple_dates) if spans_multiple_dates?
|
61
|
-
|
62
|
-
render(:single_date)
|
63
|
-
end
|
64
|
-
|
65
|
-
def formatted_start_time
|
66
|
-
model.start_time.strftime("%H:%M")
|
67
|
-
end
|
68
|
-
|
69
|
-
def formatted_end_time
|
70
|
-
model.end_time.strftime("%H:%M")
|
71
|
-
end
|
72
|
-
|
73
|
-
def start_date
|
74
|
-
return unless model.start_time
|
75
|
-
|
76
|
-
model.start_time.to_date
|
77
|
-
end
|
78
|
-
|
79
|
-
def end_date
|
80
|
-
return unless model.end_time
|
81
|
-
|
82
|
-
model.end_time.to_date
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Decidim
|
4
|
-
module Debates
|
5
|
-
class WidgetsController < Decidim::WidgetsController
|
6
|
-
helper Debates::ApplicationHelper
|
7
|
-
|
8
|
-
def show
|
9
|
-
enforce_permission_to :embed, :debate, debate: model if model
|
10
|
-
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def model
|
17
|
-
@model ||= Debate.not_hidden.where(component: current_component).find(params[:debate_id])
|
18
|
-
end
|
19
|
-
|
20
|
-
def iframe_url
|
21
|
-
@iframe_url ||= debate_widget_url(model)
|
22
|
-
end
|
23
|
-
|
24
|
-
def permission_class_chain
|
25
|
-
[Decidim::Debates::Permissions]
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= t(".debates_count", count: paginated_debates.total_count) %>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<%= render partial: "decidim/shared/filter_form_help", locals: { skip_to_id: "debates" } %>
|
2
|
-
|
3
|
-
<%= filter_form_for filter do |form| %>
|
4
|
-
<div class="filters__section">
|
5
|
-
<div class="filters__search">
|
6
|
-
<div class="input-group">
|
7
|
-
<%= form.search_field :search_text_cont, label: false, class: "input-group-field", placeholder: t(".search"), title: t(".search"), "aria-label": t(".search"), data: { disable_dynamic_change: true } %>
|
8
|
-
<div class="input-group-button">
|
9
|
-
<button type="submit" class="button" aria-controls="debates">
|
10
|
-
<%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
|
11
|
-
</button>
|
12
|
-
</div>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
</div>
|
16
|
-
|
17
|
-
<%= form.check_boxes_tree :with_any_state, filter_debates_state_values, legend_title: t(".state"), "aria-controls": "debates" %>
|
18
|
-
|
19
|
-
<% if current_component.has_subscopes? %>
|
20
|
-
<%= form.check_boxes_tree :with_any_scope, filter_scopes_values, legend_title: t(".scope"), "aria-controls": "debates" %>
|
21
|
-
<% end %>
|
22
|
-
|
23
|
-
<% if current_participatory_space.categories.any? %>
|
24
|
-
<%= form.check_boxes_tree :with_any_category, filter_categories_values, legend_title: t(".category"), "aria-controls": "debates" %>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<%= form.check_boxes_tree :with_any_origin, filter_origin_values, legend_title: t(".origin"), "aria-controls": "debates" %>
|
28
|
-
|
29
|
-
<% if current_user %>
|
30
|
-
<%= form.collection_radio_buttons :activity, activity_filter_values, :first, :last, { legend_title: t(".activity") }, "aria-controls": "debates" %>
|
31
|
-
<% end %>
|
32
|
-
|
33
|
-
<%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
|
34
|
-
<% end %>
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<div class="filters-controls hide-for-mediumlarge">
|
2
|
-
<button data-open="filter-box" class="filters-controls__trigger" aria-controls="filter-box" aria-haspopup="dialog">
|
3
|
-
<%= t ".filter" %>
|
4
|
-
<%= icon "caret-bottom", class: "icon--small float-right", aria_label: t(".unfold"), role: "img" %>
|
5
|
-
</button>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<div class="reveal" id="filter-box" data-reveal role="dialog" aria-modal="true" aria-labelledby="filter-box-label">
|
9
|
-
<div class="reveal__header">
|
10
|
-
<h3 id="filter-box-label" class="reveal__title"><%= t ".filter_by" %>:</h3>
|
11
|
-
<button class="close-button" data-close aria-label="<%= t(".close_modal") %>" type="button">
|
12
|
-
<span aria-hidden="true">×</span>
|
13
|
-
</button>
|
14
|
-
</div>
|
15
|
-
<div class="filters">
|
16
|
-
<%= render partial: "filters", locals: { type: :small } %>
|
17
|
-
</div>
|
18
|
-
</div>
|
data/config/locales/he-IL.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
he:
|
data/decidim-debates.gemspec
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
$LOAD_PATH.push File.expand_path("lib", __dir__)
|
4
|
-
|
5
|
-
require "decidim/debates/version"
|
6
|
-
|
7
|
-
# Describe your gem and declare its dependencies:
|
8
|
-
Gem::Specification.new do |s|
|
9
|
-
s.version = Decidim::Debates.version
|
10
|
-
s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva", "Genis Matutes Pujol"]
|
11
|
-
s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com", "genis.matutes@gmail.com"]
|
12
|
-
s.license = "AGPL-3.0"
|
13
|
-
s.homepage = "https://github.com/decidim/decidim"
|
14
|
-
s.required_ruby_version = "~> 3.0.0"
|
15
|
-
|
16
|
-
s.name = "decidim-debates"
|
17
|
-
s.summary = "Decidim debates module"
|
18
|
-
s.description = "A debates component for decidim's participatory spaces."
|
19
|
-
|
20
|
-
s.files = Dir.chdir(__dir__) do
|
21
|
-
`git ls-files -z`.split("\x0").select do |f|
|
22
|
-
(File.expand_path(f) == __FILE__) ||
|
23
|
-
f.start_with?(*%w(app/ config/ db/ lib/ Rakefile README.md))
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
s.add_dependency "decidim-comments", Decidim::Debates.version
|
28
|
-
s.add_dependency "decidim-core", Decidim::Debates.version
|
29
|
-
|
30
|
-
s.add_development_dependency "decidim-admin", Decidim::Debates.version
|
31
|
-
s.add_development_dependency "decidim-dev", Decidim::Debates.version
|
32
|
-
end
|