decidim-debates 0.14.4 → 0.15.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/decidim_debates_manifest.js +1 -0
- data/app/assets/images/decidim/gamification/badges/commented_debates.svg +78 -0
- data/app/cells/decidim/debates/debate_activity_cell.rb +15 -0
- data/app/commands/decidim/debates/admin/create_debate.rb +10 -4
- data/app/commands/decidim/debates/create_debate.rb +8 -1
- data/app/models/decidim/debates/debate.rb +1 -1
- data/app/permissions/decidim/debates/permissions.rb +1 -1
- data/app/presenters/decidim/debates/official_author_presenter.rb +4 -0
- data/app/services/decidim/debates/debate_search.rb +4 -5
- data/app/views/decidim/debates/debates/index.html.erb +1 -1
- data/app/views/decidim/debates/debates/new.html.erb +2 -2
- data/config/locales/ca.yml +14 -0
- data/config/locales/de.yml +14 -0
- data/config/locales/en.yml +14 -0
- data/config/locales/es-PY.yml +14 -0
- data/config/locales/es.yml +14 -0
- data/config/locales/eu.yml +14 -0
- data/config/locales/fi.yml +14 -0
- data/config/locales/fr.yml +14 -0
- data/config/locales/gl.yml +14 -0
- data/config/locales/hu.yml +14 -0
- data/config/locales/it.yml +14 -0
- data/config/locales/nl.yml +14 -0
- data/config/locales/pl.yml +14 -0
- data/config/locales/pt-BR.yml +14 -0
- data/config/locales/pt.yml +14 -0
- data/config/locales/sv.yml +14 -0
- data/db/migrate/20181003081235_fix_user_groups_ids_on_debates.rb +16 -0
- data/db/migrate/20181016132850_add_organization_as_author_to_debates.rb +31 -0
- data/lib/decidim/debates/component.rb +26 -4
- data/lib/decidim/debates/engine.rb +43 -0
- data/lib/decidim/debates/test/factories.rb +5 -4
- data/lib/decidim/debates/version.rb +1 -1
- metadata +16 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15fb23d5efef39f3bff5c41225a7da4adef6c23393a8cbab88aa101e81c08849
|
4
|
+
data.tar.gz: f570167203c560fb84ca0ce63bde45f2f776ad301792731adf8d04b92f10ca5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 232d5182b8b0b3be5d6e0333a8854e7cd2853a1a567ea8368317c0479635592fc0a4fa05945b35635fc69b58b8c8e2a0abc853fa580f60908816bb744af45fcd
|
7
|
+
data.tar.gz: 6878ba51bd7922474acf629612a99081c1f51b6fb947bdee528fc987e6ef214e6eb4560d420dca7019a8846223795873246f9a5bdd4a5bfdb8464dd32c5d99b2
|
@@ -0,0 +1 @@
|
|
1
|
+
//= link_tree ../images/decidim
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<svg version="1.1" id="debates-svg"
|
2
|
+
xmlns="http://www.w3.org/2000/svg"
|
3
|
+
xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
4
|
+
y="0px" width="1080px" height="1080px" viewBox="0 0 1080 1080" enable-background="new 0 0 1080 1080" xml:space="preserve">
|
5
|
+
<g id="debates" class="stroke-primary">
|
6
|
+
<g id="bubble">
|
7
|
+
<path fill="none" stroke="#31536E" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
|
8
|
+
M787.237,226.039H282.916c-21.99,0-39.815,17.825-39.815,39.815v18.882l-97.325,60.747h97.325
|
9
|
+
c0,21.989,17.826,39.815,39.815,39.815h504.321c21.989,0,39.814-17.826,39.814-39.815v-79.629
|
10
|
+
C827.052,243.864,809.227,226.039,787.237,226.039z"/>
|
11
|
+
<circle class="fill-primary" id="_x35_0-pct_17_" fill="#31536E" fill-opacity="0.5" cx="419.45" cy="304.983" r="28.217"/>
|
12
|
+
<circle class="fill-primary" id="_x35_0-pct_16_" fill="#31536E" fill-opacity="0.5" cx="525.623" cy="304.983" r="28.217"/>
|
13
|
+
<circle class="fill-primary" id="_x35_0-pct_15_" fill="#31536E" fill-opacity="0.5" cx="631.796" cy="304.983" r="28.217"/>
|
14
|
+
</g>
|
15
|
+
<g id="bubble_1_">
|
16
|
+
<path class="fill-primary" id="_x32_5-pct_16_" fill="#31536E" fill-opacity="0.25" d="M787.237,690.545H282.916c-25.857,0-46.894,21.036-46.894,46.894
|
17
|
+
v14.956l-93.995,58.67c-2.68,1.672-3.926,4.916-3.057,7.953c0.87,3.035,3.646,5.129,6.805,5.129h90.78
|
18
|
+
c3.422,22.511,22.908,39.814,46.36,39.814h504.321c25.856,0,46.892-21.036,46.892-46.894v-79.629
|
19
|
+
C834.129,711.581,813.094,690.545,787.237,690.545z"/>
|
20
|
+
<circle class="fill-primary" id="_x35_0-pct_12_" fill="#31536E" fill-opacity="0.5" cx="419.45" cy="776.567" r="28.217"/>
|
21
|
+
<circle class="fill-primary" id="_x35_0-pct_13_" fill="#31536E" fill-opacity="0.5" cx="525.623" cy="776.567" r="28.217"/>
|
22
|
+
<circle class="fill-primary" id="_x35_0-pct_14_" fill="#31536E" fill-opacity="0.5" cx="631.796" cy="776.567" r="28.217"/>
|
23
|
+
</g>
|
24
|
+
<g id="bubble_black">
|
25
|
+
<path class="fill-primary" fill="#31536E" d="M937.098,575.391l-101.198-66.172v-15.054c0-25.757-13.768-38.968-39.814-38.968H291.763
|
26
|
+
c-26.82,0-53.971,13.121-53.971,38.968v79.63c0,25.936,28.246,54.817,53.971,54.817h504.322c23.02,0,42.802-17.695,46.333-39.814
|
27
|
+
h90.806c3.131,0,5.89-2.26,6.784-5.26C940.902,580.536,939.719,577.104,937.098,575.391z"/>
|
28
|
+
<circle fill="#FFFFFF" fill-opacity="0.5" cx="641.854" cy="541.5" r="28.217"/>
|
29
|
+
<circle fill="#FFFFFF" fill-opacity="0.5" cx="535.682" cy="541.5" r="28.217"/>
|
30
|
+
<circle fill="#FFFFFF" fill-opacity="0.5" cx="429.509" cy="541.5" r="28.217"/>
|
31
|
+
</g>
|
32
|
+
<g id="stars_9" class="stars">
|
33
|
+
<path fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
|
34
|
+
M731.204,149.355c0-14.688-18.667-35.355-35.354-35.355c15.354,0,35.354-20.333,35.354-35.355
|
35
|
+
c0,15.022,16.666,35.355,35.354,35.355C747.537,114,731.204,134.667,731.204,149.355z"/>
|
36
|
+
<g>
|
37
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="937.586" cy="323.411" r="13.5"/>
|
38
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="921.087" y1="306.676" x2="899.874" y2="285.463"/>
|
39
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="955.028" y1="340.617" x2="976.241" y2="361.83"/>
|
40
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="954.321" y1="307.383" x2="975.534" y2="286.17"/>
|
41
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="921.087" y1="340.617" x2="899.874" y2="361.83"/>
|
42
|
+
</g>
|
43
|
+
<g>
|
44
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="169.816" y1="626.094" x2="143.654" y2="652.258"/>
|
45
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="134.462" y1="661.449" x2="108.299" y2="687.613"/>
|
46
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="169.109" y1="687.613" x2="142.946" y2="661.449"/>
|
47
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="133.755" y1="652.258" x2="107.592" y2="626.094"/>
|
48
|
+
</g>
|
49
|
+
<path fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" d="
|
50
|
+
M559.419,965.473c0,0-21.565,4.034-26.516,8.981c-4.948,4.948-8.982,26.517-8.982,26.517s-4.034-21.566-8.982-26.517
|
51
|
+
c-4.948-4.947-26.516-8.981-26.516-8.981s22.077-4.547,26.516-8.983c4.438-4.438,8.982-26.515,8.982-26.515
|
52
|
+
s4.034,21.564,8.982,26.515C537.852,961.438,559.419,965.473,559.419,965.473z"/>
|
53
|
+
<g>
|
54
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="949.705" cy="649.667" r="16.604"/>
|
55
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="913.805" cy="649.667" r="6.433"/>
|
56
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="949.705" cy="685.568" r="6.432"/>
|
57
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="985.605" cy="649.667" r="6.433"/>
|
58
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="949.705" cy="613.766" r="6.432"/>
|
59
|
+
</g>
|
60
|
+
<g>
|
61
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="314.95" y1="78.973" x2="369.854" y2="133.878"/>
|
62
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="369.854" y1="78.973" x2="314.95" y2="133.878"/>
|
63
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="324.204" y1="106" x2="297.204" y2="106"/>
|
64
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="362.204" y1="106" x2="389.204" y2="106"/>
|
65
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="343.204" y1="125" x2="343.204" y2="152"/>
|
66
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="343.204" y1="87" x2="343.204" y2="60"/>
|
67
|
+
</g>
|
68
|
+
<g>
|
69
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="106.204" y1="356" x2="106.204" y2="435"/>
|
70
|
+
<line fill="none" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" x1="145.204" y1="396" x2="66.204" y2="396"/>
|
71
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="86.204" cy="415.5" r="7.039"/>
|
72
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="86.204" cy="375.5" r="7.039"/>
|
73
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="126.204" cy="415.5" r="7.039"/>
|
74
|
+
<circle fill="#FFD92B" stroke="#31536E" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" cx="126.204" cy="375.5" r="7.039"/>
|
75
|
+
</g>
|
76
|
+
</g>
|
77
|
+
</g>
|
78
|
+
</svg>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Debates
|
5
|
+
# A cell to display when Debate has been created.
|
6
|
+
class DebateActivityCell < ActivityCell
|
7
|
+
def title
|
8
|
+
I18n.t(
|
9
|
+
"decidim.debates.last_activity.new_debate_at_html",
|
10
|
+
link: participatory_space_link
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -28,9 +28,7 @@ module Decidim
|
|
28
28
|
attr_reader :debate, :form
|
29
29
|
|
30
30
|
def create_debate
|
31
|
-
|
32
|
-
Debate,
|
33
|
-
form.current_user,
|
31
|
+
params = {
|
34
32
|
category: form.category,
|
35
33
|
title: form.title,
|
36
34
|
description: form.description,
|
@@ -38,7 +36,15 @@ module Decidim
|
|
38
36
|
instructions: form.instructions,
|
39
37
|
end_time: form.end_time,
|
40
38
|
start_time: form.start_time,
|
41
|
-
component: form.current_component
|
39
|
+
component: form.current_component,
|
40
|
+
author: form.current_organization
|
41
|
+
}
|
42
|
+
|
43
|
+
@debate = Decidim.traceability.create!(
|
44
|
+
Debate,
|
45
|
+
form.current_user,
|
46
|
+
params,
|
47
|
+
visibility: "all"
|
42
48
|
)
|
43
49
|
end
|
44
50
|
|
@@ -37,13 +37,20 @@ module Decidim
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def create_debate
|
40
|
-
|
40
|
+
params = {
|
41
41
|
author: form.current_user,
|
42
42
|
decidim_user_group_id: form.user_group_id,
|
43
43
|
category: form.category,
|
44
44
|
title: i18n_field(form.title),
|
45
45
|
description: i18n_field(form.description),
|
46
46
|
component: form.current_component
|
47
|
+
}
|
48
|
+
|
49
|
+
@debate = Decidim.traceability.create!(
|
50
|
+
Debate,
|
51
|
+
form.current_user,
|
52
|
+
params,
|
53
|
+
visibility: "public-only"
|
47
54
|
)
|
48
55
|
end
|
49
56
|
|
@@ -18,17 +18,16 @@ module Decidim
|
|
18
18
|
# into a `text` type so that we can search.
|
19
19
|
def search_search_text
|
20
20
|
query
|
21
|
-
.where("title::text ILIKE ?", "%#{search_text}%")
|
22
|
-
.or(query.where("description::text ILIKE ?", "%#{search_text}%"))
|
21
|
+
.where("decidim_debates_debates.title::text ILIKE ?", "%#{search_text}%")
|
22
|
+
.or(query.where("decidim_debates_debates.description::text ILIKE ?", "%#{search_text}%"))
|
23
23
|
end
|
24
24
|
|
25
25
|
# Handle the origin filter
|
26
|
-
# The 'official' debates don't have an author ID
|
27
26
|
def search_origin
|
28
27
|
if origin == "official"
|
29
|
-
query.where(
|
28
|
+
query.where(author: component.organization)
|
30
29
|
elsif origin == "citizens"
|
31
|
-
query.where.not(
|
30
|
+
query.where.not(decidim_author_type: "Decidim::Organization")
|
32
31
|
else # Assume 'all'
|
33
32
|
query
|
34
33
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<h2 id="debates-count" class="title-action__title section-heading">
|
6
6
|
<%= render partial: "count" %>
|
7
7
|
</h2>
|
8
|
-
<% if current_settings.creation_enabled? %>
|
8
|
+
<% if current_settings.creation_enabled? && current_component.participatory_space.can_participate?(current_user) %>
|
9
9
|
<%= action_authorized_link_to :create, new_debate_path, class: "title-action__action button small hollow", data: { "redirect_url" => new_debate_path } do %>
|
10
10
|
<%= t(".new_debate") %>
|
11
11
|
<%= icon "plus" %>
|
@@ -25,9 +25,9 @@
|
|
25
25
|
</div>
|
26
26
|
<% end %>
|
27
27
|
|
28
|
-
<% if current_user.
|
28
|
+
<% if Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? %>
|
29
29
|
<div class="field">
|
30
|
-
<%= form.select :user_group_id, current_user.
|
30
|
+
<%= form.select :user_group_id, Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.map{|g| [g.name, g.id]}, prompt: current_user.name %>
|
31
31
|
</div>
|
32
32
|
<% end %>
|
33
33
|
|
data/config/locales/ca.yml
CHANGED
@@ -100,6 +100,8 @@ ca:
|
|
100
100
|
close_window: Tanca la finestra
|
101
101
|
share: Compartir
|
102
102
|
share_link: Comparteix l'enllaç
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Nou debat a %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ ca:
|
|
132
134
|
email_outro: Has rebut aquesta notificació perquè estàs seguint %{participatory_space_title}. Pots deixar de rebre notificacions seguint l'enllaç anterior.
|
133
135
|
email_subject: Els debats ja estan disponibles a %{participatory_space_title}
|
134
136
|
notification_title: Ja pots començar <a href="%{resource_path}">nous debats</a> a <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Tria un debat obert per participar
|
142
|
+
description: Aquest distintiu es desbloqueja quan participes activament en els diferents debats deixant els teus comentaris.
|
143
|
+
description_another: Aquest usuari ha participat en %{score} debats.
|
144
|
+
description_own: Has participat en %{score} debats.
|
145
|
+
name: Debats
|
146
|
+
next_level_in: Participa en %{score} debats més per arribar al següent nivell!
|
147
|
+
unearned_another: Aquest usuari encara no ha participat en cap debat.
|
148
|
+
unearned_own: No has participat a cap debat encara.
|
data/config/locales/de.yml
CHANGED
@@ -100,6 +100,8 @@ de:
|
|
100
100
|
close_window: Fenster schließen
|
101
101
|
share: Aktie
|
102
102
|
share_link: Einen Link teilen
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Neue Debatte bei %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -134,3 +136,15 @@ de:
|
|
134
136
|
email_outro: Sie haben diese Benachrichtigung erhalten, weil Sie %{participatory_space_title}. Sie können nach dem vorherigen Link keine Benachrichtigungen mehr erhalten.
|
135
137
|
email_subject: Debatten jetzt in %{participatory_space_title}verfügbar
|
136
138
|
notification_title: Sie können jetzt <a href="%{resource_path}">neue Debatten</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a>starten
|
139
|
+
gamification:
|
140
|
+
badges:
|
141
|
+
commented_debates:
|
142
|
+
conditions:
|
143
|
+
- Wählen Sie eine offene Debatte, an der Sie teilnehmen können
|
144
|
+
description: Dieses Abzeichen wird gewährt, wenn Sie aktiv an den verschiedenen Debatten teilnehmen, indem Sie Ihre Kommentare hinterlassen.
|
145
|
+
description_another: Dieser Benutzer hat an %{score} Debatten teilgenommen.
|
146
|
+
description_own: Sie haben an %{score} Debatten teilgenommen.
|
147
|
+
name: Debatten
|
148
|
+
next_level_in: Nimm an %{score} weiteren Debatten teil, um das nächste Level zu erreichen!
|
149
|
+
unearned_another: Dieser Benutzer hat noch keine Diskussionen geführt.
|
150
|
+
unearned_own: Sie haben bereits an Debatten teilgenommen.
|
data/config/locales/en.yml
CHANGED
@@ -101,6 +101,8 @@ en:
|
|
101
101
|
close_window: Close window
|
102
102
|
share: Share
|
103
103
|
share_link: Share link
|
104
|
+
last_activity:
|
105
|
+
new_debate_at_html: "<span>New debate at %{link}</span>"
|
104
106
|
models:
|
105
107
|
debate:
|
106
108
|
fields:
|
@@ -135,3 +137,15 @@ en:
|
|
135
137
|
email_outro: You have received this notification because you are following %{participatory_space_title}. You can stop receiving notifications following the previous link.
|
136
138
|
email_subject: Debates now available in %{participatory_space_title}
|
137
139
|
notification_title: You can now start <a href="%{resource_path}">new debates</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
140
|
+
gamification:
|
141
|
+
badges:
|
142
|
+
commented_debates:
|
143
|
+
conditions:
|
144
|
+
- Choose an open debate to take part in
|
145
|
+
description: This badge is granted when you actively participate in the different debates by leaving your comments.
|
146
|
+
description_another: This user has participated in %{score} debates.
|
147
|
+
description_own: You have participated in %{score} debates.
|
148
|
+
name: Debates
|
149
|
+
next_level_in: Participate in %{score} more debates to reach the next level!
|
150
|
+
unearned_another: This user hasn't participated in any debate yet.
|
151
|
+
unearned_own: You haven't participated in any debates yet.
|
data/config/locales/es-PY.yml
CHANGED
@@ -100,6 +100,8 @@ es-PY:
|
|
100
100
|
close_window: Cerrar ventana
|
101
101
|
share: Compartir
|
102
102
|
share_link: Compartir enlace
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Nuevo debate en %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ es-PY:
|
|
132
134
|
email_outro: Has recibido esta notificación porque estás siguiendo %{participatory_space_title}. Puedes dejar de recibir notificaciones siguiendo el enlace anterior.
|
133
135
|
email_subject: Debates ahora disponibles en %{participatory_space_title}
|
134
136
|
notification_title: Ahora puedes crear <a href="%{resource_path}">nuevos debates</a> en <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Elige un debate abierto para participar.
|
142
|
+
description: Este distintivo se otorga cuando usted participa activamente en los diferentes debates dejando sus comentarios.
|
143
|
+
description_another: Este usuario ha participado en %{score} debates.
|
144
|
+
description_own: Usted ha participado en %{score} debates.
|
145
|
+
name: Debates
|
146
|
+
next_level_in: '¡Participe en %{score} debates más para alcanzar el siguiente nivel!'
|
147
|
+
unearned_another: Este usuario aún no ha participado en ningún debate.
|
148
|
+
unearned_own: Has participado en cualquier debate aún.
|
data/config/locales/es.yml
CHANGED
@@ -100,6 +100,8 @@ es:
|
|
100
100
|
close_window: Cerrar ventana
|
101
101
|
share: Compartir
|
102
102
|
share_link: Compartir enlace
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Nuevo debate en %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ es:
|
|
132
134
|
email_outro: Has recibido esta notificación porque estás siguiendo %{participatory_space_title}. Puedes dejar de recibir notificaciones siguiendo el enlace anterior.
|
133
135
|
email_subject: Debates ahora disponibles en %{participatory_space_title}
|
134
136
|
notification_title: Ahora puedes crear <a href="%{resource_path}">nuevos debates</a> en <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Elige un debate abierto para participar
|
142
|
+
description: Este distintivo se otorga cuando participes activamente en los diferentes debates dejando tus comentarios.
|
143
|
+
description_another: Este usuario ha participado en %{score} debates.
|
144
|
+
description_own: Has participado en %{score} debates.
|
145
|
+
name: Debates
|
146
|
+
next_level_in: '¡Participa en %{score} debates más para alcanzar el siguiente nivel!'
|
147
|
+
unearned_another: Este usuario aún no ha participado en ningún debate.
|
148
|
+
unearned_own: Aún no has participado en ningún debate.
|
data/config/locales/eu.yml
CHANGED
@@ -100,6 +100,8 @@ eu:
|
|
100
100
|
close_window: Itxi leihoa
|
101
101
|
share: Share
|
102
102
|
share_link: Partekatu esteka
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span> %{link}</span>eztabaida berria"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ eu:
|
|
132
134
|
email_outro: Jakinarazpena jaso duzu %{participatory_space_title}jarraituz gero. Aurreko esteka jarraituz jakinarazpenak jasotzeari uztea erabaki dezakezu.
|
133
135
|
email_subject: Debates orain eskuragarri %{participatory_space_title}
|
134
136
|
notification_title: Orain <a href="%{resource_path}">eztabaida berriak hasi ditzakezu</a> <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Aukeratu eztabaida irekia parte hartzeko
|
142
|
+
description: Txartel hau debekuei parte hartzeko modu aktiboan parte hartuz ematen da, zure iruzkinak utziz.
|
143
|
+
description_another: Erabiltzaile honek %{score} eztabaidatan parte hartu du.
|
144
|
+
description_own: '%{score} eztabaidetan parte hartu duzu.'
|
145
|
+
name: eztabaidak
|
146
|
+
next_level_in: Parte hartu %{score} eztabaidagai gehiago hurrengo mailara iristeko!
|
147
|
+
unearned_another: Erabiltzaile honek eztabaida batean parte hartu du oraindik.
|
148
|
+
unearned_own: Oraindik eztabaidetan parte hartu duzu.
|
data/config/locales/fi.yml
CHANGED
@@ -100,6 +100,8 @@ fi:
|
|
100
100
|
close_window: Sulje ikkuna
|
101
101
|
share: Jaa
|
102
102
|
share_link: Jaa linkki
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Uusi keskustelu osoitteessa %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -133,3 +135,15 @@ fi:
|
|
133
135
|
email_outro: Tämä ilmoitus on lähetetty sinulle, koska seuraat %{participatory_space_title}. Voit lopettaa ilmoitusten vastaanottamisen edellä esitetyn linkin kautta.
|
134
136
|
email_subject: Keskusteluja nyt käyettävissä kohdassa %{participatory_space_title}
|
135
137
|
notification_title: Voit nyt aloittaa <a href="%{resource_path}">uusia keskusteluja</a> kohteessa <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
138
|
+
gamification:
|
139
|
+
badges:
|
140
|
+
commented_debates:
|
141
|
+
conditions:
|
142
|
+
- Valitse avoin keskustelu ja osallistu siihen
|
143
|
+
description: Tämä kunniamerkki myönnetään, kun osallistut aktiivisesti eri keskusteluihin.
|
144
|
+
description_another: Tämä käyttäjä on osallistunut %{score} keskusteluun.
|
145
|
+
description_own: Olet osallistunut %{score} keskusteluun.
|
146
|
+
name: Keskustelut
|
147
|
+
next_level_in: Osallistu vielä %{score} keskusteluun päästäksesi seuraavalle tasolle!
|
148
|
+
unearned_another: Tämä käyttäjä ei ole vielä osallistunut yhteenkään keskusteluun.
|
149
|
+
unearned_own: Et ole vielä osallistunut yhteenkään keskusteluun.
|
data/config/locales/fr.yml
CHANGED
@@ -100,6 +100,8 @@ fr:
|
|
100
100
|
close_window: Fermer la fenêtre
|
101
101
|
share: Partager
|
102
102
|
share_link: Lien de partage
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Nouveau débat à %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ fr:
|
|
132
134
|
email_outro: Vous avez reçu cette notification, car vous suivez %{participatory_space_title}. Vous pouvez arrêter de recevoir des notifications à partir du lien précédent.
|
133
135
|
email_subject: Débats maintenant disponibles sur %{participatory_space_title}
|
134
136
|
notification_title: Vous pouvez maintenant initier <a href="%{resource_path}">nouveaux débats</a> dans <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Choisissez un débat ouvert pour participer à
|
142
|
+
description: Ce badge est attribué lorsque vous participez activement aux différents débats en laissant vos commentaires.
|
143
|
+
description_another: Cet utilisateur a participé à %{score} débats.
|
144
|
+
description_own: Vous avez participé à %{score} débats.
|
145
|
+
name: Des débats
|
146
|
+
next_level_in: Participez à %{score} autres débats pour atteindre le prochain niveau!
|
147
|
+
unearned_another: Cet utilisateur n'a encore participé à aucun débat.
|
148
|
+
unearned_own: Vous avez déjà participé à des débats.
|
data/config/locales/gl.yml
CHANGED
@@ -100,6 +100,8 @@ gl:
|
|
100
100
|
close_window: Pechar ventá
|
101
101
|
share: Comparte
|
102
102
|
share_link: Compartir a ligazón
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Novo debate en %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ gl:
|
|
132
134
|
email_outro: Recibiches esta notificación porque estás seguindo %{participatory_space_title}. Podes deixar de recibir notificacións seguindo a ligazón anterior.
|
133
135
|
email_subject: Os debates agora están dispoñibles en %{participatory_space_title}
|
134
136
|
notification_title: Agora podes comezar <a href="%{resource_path}">novos debates</a> en <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Escolle un debate aberto para participar
|
142
|
+
description: Este distintivo é concedido cando participas activamente nos diferentes debates deixando os teus comentarios.
|
143
|
+
description_another: Este usuario participou en %{score} debates.
|
144
|
+
description_own: Participaches en %{score} debates.
|
145
|
+
name: Debates
|
146
|
+
next_level_in: '¡Participa en %{score} debates máis para alcanzar o seguinte nivel!'
|
147
|
+
unearned_another: Este usuario aínda non participou en ningún debate.
|
148
|
+
unearned_own: Participaches nos debates aínda.
|
data/config/locales/hu.yml
CHANGED
@@ -100,6 +100,8 @@ hu:
|
|
100
100
|
close_window: Ablak bezárása
|
101
101
|
share: Megosztás
|
102
102
|
share_link: Link megosztása
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Új vita %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -133,3 +135,15 @@ hu:
|
|
133
135
|
email_outro: 'Ezt az értesítést azért kaptad, mert ezt követed: "%{participatory_space_title}". Az értesítéseket a következő linkre kattintva kapcsolhatod ki.'
|
134
136
|
email_subject: 'Viták létrehozása lehetséges itt: %{participatory_space_title}'
|
135
137
|
notification_title: a href="%{resource_path}">Kezd új vitát</a> a(z) <a href="%{participatory_space_url}">%{participatory_space_title}</a> helyen
|
138
|
+
gamification:
|
139
|
+
badges:
|
140
|
+
commented_debates:
|
141
|
+
conditions:
|
142
|
+
- Válasszon nyílt vitát, hogy részt vegyen
|
143
|
+
description: Ezt a jelvényt akkor kapja meg, ha a különböző vitákban aktívan részt vesz az észrevételeinek elhagyásával.
|
144
|
+
description_another: Ez a felhasználó %{score} vitában vett részt.
|
145
|
+
description_own: Vettél részt %{score} vitában.
|
146
|
+
name: viták
|
147
|
+
next_level_in: Vegyen részt még %{score} vitában, hogy elérje a következő szintet!
|
148
|
+
unearned_another: Ez a felhasználó még nem vett részt vitában.
|
149
|
+
unearned_own: Vannak résztvevők a vitákban.
|
data/config/locales/it.yml
CHANGED
@@ -100,6 +100,8 @@ it:
|
|
100
100
|
close_window: Chiudi la finestra
|
101
101
|
share: Condividere
|
102
102
|
share_link: Condividi il link
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Nuovo dibattito al %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ it:
|
|
132
134
|
email_outro: Hai ricevuto questa notifica perché stai seguendo %{participatory_space_title}. È possibile interrompere la ricezione di notifiche seguendo il collegamento precedente.
|
133
135
|
email_subject: Discussioni ora disponibili in %{participatory_space_title}
|
134
136
|
notification_title: Ora puoi iniziare <a href="%{resource_path}">nuovi dibattiti</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Scegli un dibattito aperto a cui partecipare
|
142
|
+
description: Questo badge è concesso quando partecipi attivamente ai diversi dibattiti lasciando i tuoi commenti.
|
143
|
+
description_another: Questo utente ha partecipato a %{score} dibattiti.
|
144
|
+
description_own: Hai partecipato a %{score} dibattiti.
|
145
|
+
name: dibattiti
|
146
|
+
next_level_in: Partecipa a %{score} altri dibattiti per raggiungere il livello successivo!
|
147
|
+
unearned_another: Questo utente non ha ancora partecipato a nessun dibattito.
|
148
|
+
unearned_own: Hai partecipato a qualche dibattito ancora.
|
data/config/locales/nl.yml
CHANGED
@@ -100,6 +100,8 @@ nl:
|
|
100
100
|
close_window: Sluit venster
|
101
101
|
share: Delen
|
102
102
|
share_link: Link delen
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Nieuw debat op %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -133,3 +135,15 @@ nl:
|
|
133
135
|
email_outro: Je hebt deze melding ontvangen omdat je %{participatory_space_title} volgt. Je kan de meldingen uitschakelen door te klikken op de voorgaande link.
|
134
136
|
email_subject: Debatten zijn nu beschikbaar in %{participatory_space_title}
|
135
137
|
notification_title: Je kan nu beginnen met <a href="%{resource_path}">nieuwe debatten</a> in <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
138
|
+
gamification:
|
139
|
+
badges:
|
140
|
+
commented_debates:
|
141
|
+
conditions:
|
142
|
+
- Kies een open debat om deel te nemen
|
143
|
+
description: Deze badge wordt toegekend wanneer u actief deelneemt aan de verschillende debatten door uw opmerkingen achter te laten.
|
144
|
+
description_another: Deze gebruiker heeft deelgenomen aan %{score} debatten.
|
145
|
+
description_own: Je hebt deelgenomen aan %{score} debatten.
|
146
|
+
name: debatten
|
147
|
+
next_level_in: Neem deel aan %{score} meer debatten om het volgende niveau te bereiken!
|
148
|
+
unearned_another: Deze gebruiker heeft nog geen deelgenomen aan een debat.
|
149
|
+
unearned_own: Je hebt nog deelgenomen aan debatten.
|
data/config/locales/pl.yml
CHANGED
@@ -104,6 +104,8 @@ pl:
|
|
104
104
|
close_window: Zamknij okno
|
105
105
|
share: Dzielić
|
106
106
|
share_link: Udostępnij link
|
107
|
+
last_activity:
|
108
|
+
new_debate_at_html: "<span>Nowa debata na %{link}</span>"
|
107
109
|
models:
|
108
110
|
debate:
|
109
111
|
fields:
|
@@ -136,3 +138,15 @@ pl:
|
|
136
138
|
email_outro: Otrzymałeś to powiadomienie, ponieważ obserwujesz %{participatory_space_title}. Możesz przestać otrzymywać powiadomienia po poprzednim linku.
|
137
139
|
email_subject: Debaty są teraz dostępne w %{participatory_space_title}
|
138
140
|
notification_title: Możesz teraz uruchomić <a href="%{resource_path}">nowych debat</a> w <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
141
|
+
gamification:
|
142
|
+
badges:
|
143
|
+
commented_debates:
|
144
|
+
conditions:
|
145
|
+
- Wybierz otwartą debatę, w której możesz wziąć udział
|
146
|
+
description: Ta odznaka jest przyznawana, gdy aktywnie uczestniczysz w różnych debatach, pozostawiając komentarze.
|
147
|
+
description_another: Ten użytkownik uczestniczył w %{score} debatach.
|
148
|
+
description_own: Brałeś udział w %{score} debatach.
|
149
|
+
name: Debaty
|
150
|
+
next_level_in: Weź udział w %{score} kolejnych debatach, aby przejść do następnego poziomu!
|
151
|
+
unearned_another: Ten użytkownik nie uczestniczył jeszcze w żadnej debacie.
|
152
|
+
unearned_own: Brałeś już udział w jakichkolwiek debatach.
|
data/config/locales/pt-BR.yml
CHANGED
@@ -100,6 +100,8 @@ pt-BR:
|
|
100
100
|
close_window: Fechar janela
|
101
101
|
share: Compartilhar
|
102
102
|
share_link: Compartilhar link
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Novo debate em %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ pt-BR:
|
|
132
134
|
email_outro: Você recebeu esta notificação porque está seguindo %{participatory_space_title}. Você pode parar de receber notificações após o link anterior.
|
133
135
|
email_subject: Debates agora disponíveis em %{participatory_space_title}
|
134
136
|
notification_title: Agora você pode começar <a href="%{resource_path}">novos debates</a> em <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Escolha um debate aberto para participar
|
142
|
+
description: Este emblema é concedido quando você participa ativamente nos debates diferentes deixando seus comentários.
|
143
|
+
description_another: Este usuário participou em %{score} debates.
|
144
|
+
description_own: Você participou de %{score} debates.
|
145
|
+
name: Debates
|
146
|
+
next_level_in: Participe em mais %{score} debates para alcançar o próximo nível!
|
147
|
+
unearned_another: Este usuário ainda não participou de nenhum debate.
|
148
|
+
unearned_own: Você participou de algum debate ainda.
|
data/config/locales/pt.yml
CHANGED
@@ -100,6 +100,8 @@ pt:
|
|
100
100
|
close_window: Janela fechada
|
101
101
|
share: Compartilhar
|
102
102
|
share_link: Compartilhar link
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Novo debate em %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ pt:
|
|
132
134
|
email_outro: Você recebeu esta notificação porque está seguindo %{participatory_space_title}. Você pode parar de receber notificações após o link anterior.
|
133
135
|
email_subject: Debates agora disponíveis em %{participatory_space_title}
|
134
136
|
notification_title: Agora você pode começar <a href="%{resource_path}">novos debates</a> em <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Escolha um debate aberto para participar
|
142
|
+
description: Este crachá é concedido quando você participa ativamente dos diferentes debates deixando seus comentários.
|
143
|
+
description_another: Este usuário participou em %{score} debates.
|
144
|
+
description_own: Você participou de %{score} debates.
|
145
|
+
name: Debates
|
146
|
+
next_level_in: Participe em mais %{score} debates para alcançar o próximo nível!
|
147
|
+
unearned_another: Este usuário ainda não participou de nenhum debate.
|
148
|
+
unearned_own: Você participou de algum debate ainda.
|
data/config/locales/sv.yml
CHANGED
@@ -100,6 +100,8 @@ sv:
|
|
100
100
|
close_window: Stäng fönstret
|
101
101
|
share: Dela
|
102
102
|
share_link: Dela länk
|
103
|
+
last_activity:
|
104
|
+
new_debate_at_html: "<span>Ny debatt på %{link}</span>"
|
103
105
|
models:
|
104
106
|
debate:
|
105
107
|
fields:
|
@@ -132,3 +134,15 @@ sv:
|
|
132
134
|
email_outro: Du har fått den här notisen eftersom du följer %{participatory_space_title}. Du kan sluta ta emot notiser på föregående länk.
|
133
135
|
email_subject: Debatter finns nu i %{participatory_space_title}
|
134
136
|
notification_title: Nu kan du starta <a href="%{resource_path}">nya debatter</a> i <a href="%{participatory_space_url}">%{participatory_space_title}</a>
|
137
|
+
gamification:
|
138
|
+
badges:
|
139
|
+
commented_debates:
|
140
|
+
conditions:
|
141
|
+
- Välj en öppen debatt att delta i
|
142
|
+
description: Detta märke beviljas när du aktivt deltar i de olika debatterna genom att lämna dina kommentarer.
|
143
|
+
description_another: Den här användaren har deltagit i %{score} debatter.
|
144
|
+
description_own: Du har deltagit i %{score} debatter.
|
145
|
+
name: debatter
|
146
|
+
next_level_in: Delta i %{score} fler debatter för att nå nästa nivå!
|
147
|
+
unearned_another: Den här användaren har inte deltagit i någon debatt än.
|
148
|
+
unearned_own: Du har inte deltagit i några debatter än.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class FixUserGroupsIdsOnDebates < ActiveRecord::Migration[5.2]
|
4
|
+
# rubocop:disable Rails/SkipsModelValidations
|
5
|
+
def change
|
6
|
+
Decidim::UserGroup.find_each do |group|
|
7
|
+
old_id = group.extended_data["old_user_group_id"]
|
8
|
+
next unless old_id
|
9
|
+
|
10
|
+
Decidim::Debates::Debate
|
11
|
+
.where(decidim_user_group_id: old_id)
|
12
|
+
.update_all(decidim_user_group_id: group.id)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
# rubocop:enable Rails/SkipsModelValidations
|
16
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddOrganizationAsAuthorToDebates < ActiveRecord::Migration[5.2]
|
4
|
+
class Debate < ApplicationRecord
|
5
|
+
self.table_name = :decidim_debates_debates
|
6
|
+
include Decidim::HasComponent
|
7
|
+
end
|
8
|
+
class User < ApplicationRecord
|
9
|
+
self.table_name = :decidim_users
|
10
|
+
end
|
11
|
+
def change
|
12
|
+
add_column :decidim_debates_debates, :decidim_author_type, :string
|
13
|
+
|
14
|
+
Debate.reset_column_information
|
15
|
+
Debate.find_each do |debate|
|
16
|
+
if debate.decidim_author_id.present?
|
17
|
+
debate.decidim_author_type = "Decidim::UserBaseEntity"
|
18
|
+
else
|
19
|
+
debate.decidim_author_id = debate.organization.id
|
20
|
+
debate.decidim_author_type = "Decidim::Organization"
|
21
|
+
end
|
22
|
+
debate.save!
|
23
|
+
end
|
24
|
+
|
25
|
+
add_index :decidim_debates_debates,
|
26
|
+
[:decidim_author_id, :decidim_author_type],
|
27
|
+
name: "index_decidim_debates_debates_on_decidim_author"
|
28
|
+
change_column_null :decidim_debates_debates, :decidim_author_id, false
|
29
|
+
change_column_null :decidim_debates_debates, :decidim_author_type, false
|
30
|
+
end
|
31
|
+
end
|
@@ -37,15 +37,29 @@ Decidim.register_component(:debates) do |component|
|
|
37
37
|
component.actions = %w(create)
|
38
38
|
|
39
39
|
component.seeds do |participatory_space|
|
40
|
-
|
40
|
+
admin_user = Decidim::User.find_by(
|
41
|
+
organization: participatory_space.organization,
|
42
|
+
email: "admin@example.org"
|
43
|
+
)
|
44
|
+
|
45
|
+
params = {
|
41
46
|
name: Decidim::Components::Namer.new(participatory_space.organization.available_locales, :debates).i18n_name,
|
42
47
|
manifest_name: :debates,
|
43
48
|
published_at: Time.current,
|
44
49
|
participatory_space: participatory_space
|
45
|
-
|
50
|
+
}
|
51
|
+
|
52
|
+
component = Decidim.traceability.perform_action!(
|
53
|
+
"publish",
|
54
|
+
Decidim::Component,
|
55
|
+
admin_user,
|
56
|
+
visibility: "all"
|
57
|
+
) do
|
58
|
+
Decidim::Component.create!(params)
|
59
|
+
end
|
46
60
|
|
47
61
|
3.times do
|
48
|
-
|
62
|
+
params = {
|
49
63
|
component: component,
|
50
64
|
category: participatory_space.categories.sample,
|
51
65
|
title: Decidim::Faker::Localized.sentence(2),
|
@@ -56,7 +70,15 @@ Decidim.register_component(:debates) do |component|
|
|
56
70
|
Decidim::Faker::Localized.paragraph(3)
|
57
71
|
end,
|
58
72
|
start_time: 3.weeks.from_now,
|
59
|
-
end_time: 3.weeks.from_now + 4.hours
|
73
|
+
end_time: 3.weeks.from_now + 4.hours,
|
74
|
+
author: component.organization
|
75
|
+
}
|
76
|
+
|
77
|
+
debate = Decidim.traceability.create!(
|
78
|
+
Decidim::Debates::Debate,
|
79
|
+
admin_user,
|
80
|
+
params,
|
81
|
+
visibility: "all"
|
60
82
|
)
|
61
83
|
|
62
84
|
Decidim::Comments::Seed.comments_for(debate)
|
@@ -30,6 +30,49 @@ module Decidim
|
|
30
30
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Debates::Engine.root}/app/cells")
|
31
31
|
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Debates::Engine.root}/app/views") # for partials
|
32
32
|
end
|
33
|
+
|
34
|
+
initializer "decidim_debates.assets" do |app|
|
35
|
+
app.config.assets.precompile += %w(decidim_debates_manifest.js)
|
36
|
+
end
|
37
|
+
|
38
|
+
initializer "decidim.debates.commented_debates_badge" do
|
39
|
+
Decidim::Gamification.register_badge(:commented_debates) do |badge|
|
40
|
+
badge.levels = [1, 5, 10, 30, 50]
|
41
|
+
|
42
|
+
badge.valid_for = [:user, :user_group]
|
43
|
+
|
44
|
+
badge.reset = lambda do |user|
|
45
|
+
debates = Decidim::Comments::Comment.where(
|
46
|
+
author: user,
|
47
|
+
decidim_root_commentable_type: "Decidim::Debates::Debate"\
|
48
|
+
)
|
49
|
+
debates.pluck(:decidim_root_commentable_id).uniq.count
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
Decidim::Comments::CommentCreation.subscribe do |data|
|
54
|
+
comment = Decidim::Comments::Comment.find(data[:comment_id])
|
55
|
+
next unless comment.decidim_root_commentable_type == "Decidim::Debates::Debate"
|
56
|
+
|
57
|
+
if comment.user_group.present?
|
58
|
+
comments = Decidim::Comments::Comment.where(
|
59
|
+
decidim_root_commentable_id: comment.decidim_root_commentable_id,
|
60
|
+
decidim_root_commentable_type: comment.decidim_root_commentable_type,
|
61
|
+
user_group: comment.user_group
|
62
|
+
)
|
63
|
+
|
64
|
+
Decidim::Gamification.increment_score(comment.user_group, :commented_debates) if comments.count == 1
|
65
|
+
elsif comment.author.present?
|
66
|
+
comments = Decidim::Comments::Comment.where(
|
67
|
+
decidim_root_commentable_id: comment.decidim_root_commentable_id,
|
68
|
+
decidim_root_commentable_type: comment.decidim_root_commentable_type,
|
69
|
+
author: comment.author
|
70
|
+
)
|
71
|
+
|
72
|
+
Decidim::Gamification.increment_score(comment.author, :commented_debates) if comments.count == 1
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
33
76
|
end
|
34
77
|
end
|
35
78
|
end
|
@@ -2,13 +2,14 @@
|
|
2
2
|
|
3
3
|
FactoryBot.define do
|
4
4
|
factory :debate, class: "Decidim::Debates::Debate" do
|
5
|
-
title {
|
6
|
-
description { Decidim::Faker::Localized.wrapped("<p>", "</p>") {
|
7
|
-
information_updates { Decidim::Faker::Localized.wrapped("<p>", "</p>") {
|
8
|
-
instructions { Decidim::Faker::Localized.wrapped("<p>", "</p>") {
|
5
|
+
title { generate_localized_title }
|
6
|
+
description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
7
|
+
information_updates { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
8
|
+
instructions { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
|
9
9
|
start_time { 1.day.from_now }
|
10
10
|
end_time { start_time.advance(hours: 2) }
|
11
11
|
component { build(:component, manifest_name: "debates") }
|
12
|
+
author { component.try(:organization) }
|
12
13
|
|
13
14
|
trait :open_ama do
|
14
15
|
start_time { 1.day.ago }
|
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.15.0
|
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: 2018-
|
14
|
+
date: 2018-11-12 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: decidim-comments
|
@@ -19,28 +19,28 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.15.0
|
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.15.0
|
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.15.0
|
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.15.0
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: kaminari
|
46
46
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,28 +75,28 @@ dependencies:
|
|
75
75
|
requirements:
|
76
76
|
- - '='
|
77
77
|
- !ruby/object:Gem::Version
|
78
|
-
version: 0.
|
78
|
+
version: 0.15.0
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
81
|
version_requirements: !ruby/object:Gem::Requirement
|
82
82
|
requirements:
|
83
83
|
- - '='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.
|
85
|
+
version: 0.15.0
|
86
86
|
- !ruby/object:Gem::Dependency
|
87
87
|
name: decidim-dev
|
88
88
|
requirement: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
90
|
- - '='
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: 0.
|
92
|
+
version: 0.15.0
|
93
93
|
type: :development
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - '='
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: 0.
|
99
|
+
version: 0.15.0
|
100
100
|
description: A debates component for decidim's participatory spaces.
|
101
101
|
email:
|
102
102
|
- josepjaume@gmail.com
|
@@ -109,7 +109,10 @@ extra_rdoc_files: []
|
|
109
109
|
files:
|
110
110
|
- README.md
|
111
111
|
- Rakefile
|
112
|
+
- app/assets/config/decidim_debates_manifest.js
|
112
113
|
- app/assets/images/decidim/debates/icon.svg
|
114
|
+
- app/assets/images/decidim/gamification/badges/commented_debates.svg
|
115
|
+
- app/cells/decidim/debates/debate_activity_cell.rb
|
113
116
|
- app/cells/decidim/debates/debate_cell.rb
|
114
117
|
- app/cells/decidim/debates/debate_m/footer.erb
|
115
118
|
- app/cells/decidim/debates/debate_m/tags.erb
|
@@ -177,6 +180,8 @@ files:
|
|
177
180
|
- db/migrate/20180122090505_add_user_group_author_to_debates.rb
|
178
181
|
- db/migrate/20180305092347_drop_category_id_column.rb
|
179
182
|
- db/migrate/20180305133556_rename_features_to_components_at_debates.rb
|
183
|
+
- db/migrate/20181003081235_fix_user_groups_ids_on_debates.rb
|
184
|
+
- db/migrate/20181016132850_add_organization_as_author_to_debates.rb
|
180
185
|
- lib/decidim/debates.rb
|
181
186
|
- lib/decidim/debates/admin.rb
|
182
187
|
- lib/decidim/debates/admin_engine.rb
|
@@ -204,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
209
|
version: '0'
|
205
210
|
requirements: []
|
206
211
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.7.
|
212
|
+
rubygems_version: 2.7.6
|
208
213
|
signing_key:
|
209
214
|
specification_version: 4
|
210
215
|
summary: Decidim debates module
|