decidim-proposals 0.12.2 → 0.13.0.pre1
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/proposals/coauthorships_cell.rb +40 -0
- data/app/cells/decidim/proposals/proposal_m_cell.rb +5 -0
- data/app/commands/decidim/proposals/admin/import_proposals.rb +3 -0
- data/app/commands/decidim/proposals/admin/update_proposal_category.rb +2 -2
- data/app/commands/decidim/proposals/create_proposal.rb +3 -4
- data/app/commands/decidim/proposals/destroy_proposal.rb +1 -1
- data/app/commands/decidim/proposals/publish_proposal.rb +12 -4
- data/app/commands/decidim/proposals/update_proposal.rb +4 -4
- data/app/controllers/decidim/proposals/proposals_controller.rb +1 -2
- data/app/events/decidim/proposals/publish_proposal_event.rb +1 -1
- data/app/forms/decidim/proposals/proposal_form.rb +1 -1
- data/app/helpers/decidim/proposals/application_helper.rb +4 -0
- data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +16 -10
- data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +2 -2
- data/app/models/decidim/proposals/proposal.rb +19 -2
- data/app/permissions/decidim/proposals/permissions.rb +1 -1
- data/app/presenters/decidim/proposals/proposal_presenter.rb +6 -3
- data/app/services/decidim/proposals/proposal_search.rb +2 -2
- data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +1 -1
- data/app/views/decidim/proposals/admin/proposals/index.html.erb +1 -1
- data/app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb +1 -1
- data/app/views/decidim/proposals/proposals/_endorsements_card_row.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/_proposal_similar.html.erb +1 -1
- data/app/views/decidim/proposals/proposals/show.html.erb +1 -1
- data/config/locales/ca.yml +6 -6
- data/config/locales/en.yml +6 -6
- data/config/locales/es-PY.yml +6 -6
- data/config/locales/es.yml +6 -6
- data/config/locales/eu.yml +6 -6
- data/config/locales/fi.yml +6 -6
- data/config/locales/fr.yml +76 -76
- data/config/locales/gl.yml +6 -6
- data/config/locales/it.yml +6 -6
- data/config/locales/nl.yml +5 -5
- data/config/locales/pl.yml +6 -6
- data/config/locales/pt-BR.yml +6 -6
- data/config/locales/pt.yml +6 -6
- data/config/locales/ru.yml +1 -2
- data/config/locales/sv.yml +6 -6
- data/config/locales/uk.yml +3 -3
- data/db/migrate/20180529101323_add_counter_cache_coauthorships_to_proposals.rb +8 -0
- data/db/migrate/20180529110230_move_authorships_to_coauthorships.rb +28 -0
- data/db/migrate/20180529110830_remove_authorships_from_proposals.rb +8 -0
- data/lib/decidim/proposals/component.rb +3 -2
- data/lib/decidim/proposals/proposal_serializer.rb +1 -1
- data/lib/decidim/proposals/test/factories.rb +17 -3
- data/lib/decidim/proposals/version.rb +1 -1
- metadata +40 -37
- data/app/views/decidim/proposals/proposals/_endorsements_count.html.erb +0 -5
@@ -28,7 +28,7 @@ module Decidim
|
|
28
28
|
body: @proposal.body,
|
29
29
|
votes: @proposal.proposal_votes_count,
|
30
30
|
comments: @proposal.comments.count,
|
31
|
-
|
31
|
+
published_at: @proposal.published_at,
|
32
32
|
url: url,
|
33
33
|
component: { id: component.id },
|
34
34
|
meeting_urls: meetings
|
@@ -137,18 +137,32 @@ FactoryBot.define do
|
|
137
137
|
end
|
138
138
|
|
139
139
|
factory :proposal, class: "Decidim::Proposals::Proposal" do
|
140
|
+
transient do
|
141
|
+
users nil
|
142
|
+
# user_groups correspondence to users is by sorting order
|
143
|
+
user_groups []
|
144
|
+
end
|
145
|
+
|
140
146
|
title { Faker::Lorem.sentence }
|
141
147
|
body { Faker::Lorem.sentences(3).join("\n") }
|
142
148
|
component { create(:proposal_component) }
|
143
149
|
published_at { Time.current }
|
144
150
|
address { "#{Faker::Address.street_name}, #{Faker::Address.city}" }
|
145
151
|
|
146
|
-
|
147
|
-
|
152
|
+
after(:build) do |proposal, evaluator|
|
153
|
+
if proposal.component
|
154
|
+
users = evaluator.users || [create(:user, organization: proposal.component.participatory_space.organization)]
|
155
|
+
users.each_with_index do |user, idx|
|
156
|
+
user_group = evaluator.user_groups[idx]
|
157
|
+
Decidim::Coauthorship.create(author: user, user_group: user_group, coauthorable: proposal)
|
158
|
+
end
|
159
|
+
end
|
148
160
|
end
|
149
161
|
|
150
162
|
trait :official do
|
151
|
-
|
163
|
+
after :build do |proposal|
|
164
|
+
proposal.coauthorships.clear
|
165
|
+
end
|
152
166
|
end
|
153
167
|
|
154
168
|
trait :evaluating do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-proposals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cells-erb
|
@@ -44,30 +44,30 @@ dependencies:
|
|
44
44
|
name: decidim-comments
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.13.a
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.13.a
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: decidim-core
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.
|
63
|
+
version: 0.13.a
|
64
64
|
type: :runtime
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.
|
70
|
+
version: 0.13.a
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: kaminari
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,86 +114,86 @@ dependencies:
|
|
114
114
|
name: decidim-admin
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - "~>"
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.
|
119
|
+
version: 0.13.a
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
|
-
- -
|
124
|
+
- - "~>"
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.
|
126
|
+
version: 0.13.a
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
128
|
name: decidim-assemblies
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
|
-
- -
|
131
|
+
- - "~>"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
133
|
+
version: 0.13.a
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
|
-
- -
|
138
|
+
- - "~>"
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 0.
|
140
|
+
version: 0.13.a
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
142
|
name: decidim-budgets
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
|
-
- -
|
145
|
+
- - "~>"
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: 0.
|
147
|
+
version: 0.13.a
|
148
148
|
type: :development
|
149
149
|
prerelease: false
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
|
-
- -
|
152
|
+
- - "~>"
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: 0.
|
154
|
+
version: 0.13.a
|
155
155
|
- !ruby/object:Gem::Dependency
|
156
156
|
name: decidim-dev
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
|
-
- -
|
159
|
+
- - "~>"
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version: 0.
|
161
|
+
version: 0.13.a
|
162
162
|
type: :development
|
163
163
|
prerelease: false
|
164
164
|
version_requirements: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
|
-
- -
|
166
|
+
- - "~>"
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version: 0.
|
168
|
+
version: 0.13.a
|
169
169
|
- !ruby/object:Gem::Dependency
|
170
170
|
name: decidim-meetings
|
171
171
|
requirement: !ruby/object:Gem::Requirement
|
172
172
|
requirements:
|
173
|
-
- -
|
173
|
+
- - "~>"
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: 0.
|
175
|
+
version: 0.13.a
|
176
176
|
type: :development
|
177
177
|
prerelease: false
|
178
178
|
version_requirements: !ruby/object:Gem::Requirement
|
179
179
|
requirements:
|
180
|
-
- -
|
180
|
+
- - "~>"
|
181
181
|
- !ruby/object:Gem::Version
|
182
|
-
version: 0.
|
182
|
+
version: 0.13.a
|
183
183
|
- !ruby/object:Gem::Dependency
|
184
184
|
name: decidim-participatory_processes
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- -
|
187
|
+
- - "~>"
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 0.
|
189
|
+
version: 0.13.a
|
190
190
|
type: :development
|
191
191
|
prerelease: false
|
192
192
|
version_requirements: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- -
|
194
|
+
- - "~>"
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version: 0.
|
196
|
+
version: 0.13.a
|
197
197
|
description: A proposals component for decidim's participatory spaces.
|
198
198
|
email:
|
199
199
|
- josepjaume@gmail.com
|
@@ -215,6 +215,7 @@ files:
|
|
215
215
|
- app/assets/javascripts/decidim/proposals/social_share.js
|
216
216
|
- app/assets/javascripts/decidim/proposals/utils.js.es6
|
217
217
|
- app/assets/stylesheets/decidim/proposals/social_share.css.scss
|
218
|
+
- app/cells/decidim/proposals/coauthorships_cell.rb
|
218
219
|
- app/cells/decidim/proposals/endorsers_list/show.erb
|
219
220
|
- app/cells/decidim/proposals/endorsers_list_cell.rb
|
220
221
|
- app/cells/decidim/proposals/proposal_cell.rb
|
@@ -315,7 +316,6 @@ files:
|
|
315
316
|
- app/views/decidim/proposals/proposals/_endorsement_button.html.erb
|
316
317
|
- app/views/decidim/proposals/proposals/_endorsement_identities_cabin.html.erb
|
317
318
|
- app/views/decidim/proposals/proposals/_endorsements_card_row.html.erb
|
318
|
-
- app/views/decidim/proposals/proposals/_endorsements_count.html.erb
|
319
319
|
- app/views/decidim/proposals/proposals/_filters.html.erb
|
320
320
|
- app/views/decidim/proposals/proposals/_filters_small_view.html.erb
|
321
321
|
- app/views/decidim/proposals/proposals/_linked_proposals.html.erb
|
@@ -379,6 +379,9 @@ files:
|
|
379
379
|
- db/migrate/20180115155220_add_index_created_at_proposal_notes.rb
|
380
380
|
- db/migrate/20180305133811_rename_features_to_components_at_proposals.rb
|
381
381
|
- db/migrate/20180413135249_fix_nil_threshold_per_proposal.rb
|
382
|
+
- db/migrate/20180529101323_add_counter_cache_coauthorships_to_proposals.rb
|
383
|
+
- db/migrate/20180529110230_move_authorships_to_coauthorships.rb
|
384
|
+
- db/migrate/20180529110830_remove_authorships_from_proposals.rb
|
382
385
|
- lib/decidim/content_parsers/proposal_parser.rb
|
383
386
|
- lib/decidim/content_renderers/proposal_renderer.rb
|
384
387
|
- lib/decidim/proposals.rb
|
@@ -405,9 +408,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
405
408
|
version: '2.3'
|
406
409
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
407
410
|
requirements:
|
408
|
-
- - "
|
411
|
+
- - ">"
|
409
412
|
- !ruby/object:Gem::Version
|
410
|
-
version:
|
413
|
+
version: 1.3.1
|
411
414
|
requirements: []
|
412
415
|
rubyforge_project:
|
413
416
|
rubygems_version: 2.7.6
|
@@ -1,5 +0,0 @@
|
|
1
|
-
<%= link_to "#list-of-endorsements", id: "proposal-#{proposal.id}-endorsements-count", class: "button small compact light button--sc button--shadow #{fully_endorsed ? 'success' : 'secondary'}" do %>
|
2
|
-
<%= icon "bullhorn", class: "icon--small", aria_label: "Endorsements", role: "img" %>
|
3
|
-
<%= proposal.proposal_endorsements_count %>
|
4
|
-
</button>
|
5
|
-
<% end %>
|