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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/proposals/coauthorships_cell.rb +40 -0
  3. data/app/cells/decidim/proposals/proposal_m_cell.rb +5 -0
  4. data/app/commands/decidim/proposals/admin/import_proposals.rb +3 -0
  5. data/app/commands/decidim/proposals/admin/update_proposal_category.rb +2 -2
  6. data/app/commands/decidim/proposals/create_proposal.rb +3 -4
  7. data/app/commands/decidim/proposals/destroy_proposal.rb +1 -1
  8. data/app/commands/decidim/proposals/publish_proposal.rb +12 -4
  9. data/app/commands/decidim/proposals/update_proposal.rb +4 -4
  10. data/app/controllers/decidim/proposals/proposals_controller.rb +1 -2
  11. data/app/events/decidim/proposals/publish_proposal_event.rb +1 -1
  12. data/app/forms/decidim/proposals/proposal_form.rb +1 -1
  13. data/app/helpers/decidim/proposals/application_helper.rb +4 -0
  14. data/app/helpers/decidim/proposals/proposal_endorsements_helper.rb +16 -10
  15. data/app/jobs/decidim/proposals/notify_proposals_mentioned_job.rb +2 -2
  16. data/app/models/decidim/proposals/proposal.rb +19 -2
  17. data/app/permissions/decidim/proposals/permissions.rb +1 -1
  18. data/app/presenters/decidim/proposals/proposal_presenter.rb +6 -3
  19. data/app/services/decidim/proposals/proposal_search.rb +2 -2
  20. data/app/views/decidim/proposals/admin/proposals/_bulk-actions.html.erb +1 -1
  21. data/app/views/decidim/proposals/admin/proposals/index.html.erb +1 -1
  22. data/app/views/decidim/proposals/proposal_endorsements/update_buttons_and_counters.js.erb +1 -1
  23. data/app/views/decidim/proposals/proposals/_endorsements_card_row.html.erb +1 -1
  24. data/app/views/decidim/proposals/proposals/_proposal_similar.html.erb +1 -1
  25. data/app/views/decidim/proposals/proposals/show.html.erb +1 -1
  26. data/config/locales/ca.yml +6 -6
  27. data/config/locales/en.yml +6 -6
  28. data/config/locales/es-PY.yml +6 -6
  29. data/config/locales/es.yml +6 -6
  30. data/config/locales/eu.yml +6 -6
  31. data/config/locales/fi.yml +6 -6
  32. data/config/locales/fr.yml +76 -76
  33. data/config/locales/gl.yml +6 -6
  34. data/config/locales/it.yml +6 -6
  35. data/config/locales/nl.yml +5 -5
  36. data/config/locales/pl.yml +6 -6
  37. data/config/locales/pt-BR.yml +6 -6
  38. data/config/locales/pt.yml +6 -6
  39. data/config/locales/ru.yml +1 -2
  40. data/config/locales/sv.yml +6 -6
  41. data/config/locales/uk.yml +3 -3
  42. data/db/migrate/20180529101323_add_counter_cache_coauthorships_to_proposals.rb +8 -0
  43. data/db/migrate/20180529110230_move_authorships_to_coauthorships.rb +28 -0
  44. data/db/migrate/20180529110830_remove_authorships_from_proposals.rb +8 -0
  45. data/lib/decidim/proposals/component.rb +3 -2
  46. data/lib/decidim/proposals/proposal_serializer.rb +1 -1
  47. data/lib/decidim/proposals/test/factories.rb +17 -3
  48. data/lib/decidim/proposals/version.rb +1 -1
  49. metadata +40 -37
  50. 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
- created_at: @proposal.created_at,
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
- author do
147
- create(:user, organization: component.organization) if component
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
- author nil
163
+ after :build do |proposal|
164
+ proposal.coauthorships.clear
165
+ end
152
166
  end
153
167
 
154
168
  trait :evaluating do
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-proposals version.
5
5
  module Proposals
6
6
  def self.version
7
- "0.12.2"
7
+ "0.13.0.pre1"
8
8
  end
9
9
  end
10
10
  end
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.12.2
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-07-11 00:00:00.000000000 Z
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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.12.2
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: '0'
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 %>