decidim-budgets 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7766da6e89e17216f16e9e047f574d40cad89d7
4
- data.tar.gz: 3c5ff65d104acc8497d606a3509a167bfb50db74
3
+ metadata.gz: 902043b0a9c7128da152aea0f90fcb3b36b81eb9
4
+ data.tar.gz: 1679b08f948a9976585d0a067329c4716dfc2c98
5
5
  SHA512:
6
- metadata.gz: '09db086aeced3510495a2315772a461d49b56b90afff8bc25dc0f6f782910adf649269b9329ebeffa5bc50f90b7fab8c09bf39e2e6e13e8f58c2df6356781bed'
7
- data.tar.gz: 40500928db556a0869d9b275b4b62f6195f81e9852e4caaf5f1b51caf6be6ad390a73e4f4e5529be9d66e5a7f6ac07b33a9bce6dc4f14082c4f8b5273a6a03b1
6
+ metadata.gz: 46807e1aab8ca99f335df5640e53b8a7d34326590c7c8a08f2e84c430e61ebdb87bf2fac239fc67491eb59cbf1305257fa87607277a509996411006afcfd2540
7
+ data.tar.gz: 8fcbf00d7f4fb3045e44c839c99859a64aae86c0b7569c5acd4e9479090f6189ff943ee8546384097464e2097dd7802250afb97df21c38ca60174e6df2eb3651
@@ -5,7 +5,7 @@ module Decidim
5
5
  # This controller is the abstract class from which all other controllers of
6
6
  # this engine inherit.
7
7
  #
8
- # Note that it inherits from `Decidim::Components::BaseController`, which
8
+ # Note that it inherits from `Decidim::Features::BaseController`, which
9
9
  # override its layout and provide all kinds of useful methods.
10
10
  class ApplicationController < Decidim::Features::BaseController
11
11
  end
@@ -8,8 +8,7 @@ module Decidim
8
8
  belongs_to :order, class_name: "Decidim::Budgets::Order", foreign_key: "decidim_order_id"
9
9
  belongs_to :project, class_name: "Decidim::Budgets::Project", foreign_key: "decidim_project_id"
10
10
 
11
- validates :order, presence: true, uniqueness: { scope: :project }
12
- validates :project, presence: true
11
+ validates :order, uniqueness: { scope: :project }
13
12
  validate :same_feature
14
13
 
15
14
  def same_feature
@@ -11,10 +11,10 @@ module Decidim
11
11
 
12
12
  belongs_to :user, class_name: "Decidim::User", foreign_key: "decidim_user_id"
13
13
 
14
- has_many :projects, through: :line_items, class_name: "Decidim::Budgets::Project", foreign_key: "decidim_project_id"
15
14
  has_many :line_items, class_name: "Decidim::Budgets::LineItem", foreign_key: "decidim_order_id", dependent: :destroy
15
+ has_many :projects, through: :line_items, class_name: "Decidim::Budgets::Project", foreign_key: "decidim_project_id"
16
16
 
17
- validates :user, presence: true, uniqueness: { scope: :feature }
17
+ validates :user, uniqueness: { scope: :feature }
18
18
  validate :user_belongs_to_organization
19
19
 
20
20
  validates :total_budget, numericality: {
@@ -2,7 +2,7 @@
2
2
  <% resources.each do |project| %>
3
3
  <div class="card--list__item">
4
4
  <%= icon "actions", class: "card--list__icon", remove_icon_class: true %>
5
- <%= link_to decidim_resource_path(project), class: "card--list__text card__link card__link--block" do %>
5
+ <%= link_to resource_locator(project).path, class: "card--list__text card__link card__link--block" do %>
6
6
  <h5 class="card--list__heading">
7
7
  <%= translated_attribute(project.title) %>
8
8
  </h5>
@@ -0,0 +1,126 @@
1
+ it:
2
+ activemodel:
3
+ attributes:
4
+ project:
5
+ decidim_category_id: Categoria
6
+ decidim_scope_id: Visibilità/ambito
7
+ description: Descrizione
8
+ proposal_ids: Proposte correlate
9
+ title: Titolo
10
+ decidim:
11
+ budgets:
12
+ actions:
13
+ attachments: Allegati
14
+ confirm_destroy: Sei certo di voler cancellare questo progetto?
15
+ destroy: Cancella
16
+ edit: Modifica
17
+ new: Nuovo
18
+ preview: Anteprima
19
+ title: Azioni
20
+ admin:
21
+ models:
22
+ project:
23
+ name: Progetto
24
+ projects:
25
+ create:
26
+ invalid: C'è stato un problema durante la creazione di questo progetto.
27
+ success: OK, progetto creato.
28
+ destroy:
29
+ success: OK, progetto eliminato.
30
+ edit:
31
+ title: Modifica il progetto
32
+ update: Aggiorna
33
+ index:
34
+ finished_orders: Ordini terminati.
35
+ pending_orders: Ordini pendenti.
36
+ title: Progetti
37
+ new:
38
+ create: Crea
39
+ title: Nuovo risultato
40
+ update:
41
+ invalid: C'è stato un problema durante l'aggiornamento di questo progetto.
42
+ success: OK, progetto aggiornato.
43
+ models:
44
+ project:
45
+ fields:
46
+ title: Titolo
47
+ projects:
48
+ budget_confirm:
49
+ are_you_sure: Sei d'accordo? Dopo che avrai confermato il tuo voto non potrai più modificarlo
50
+ cancel: Annulla
51
+ confirm: Conferma
52
+ description: Questi sono i progetti per i quali hai scelto di partecipare al budget.
53
+ title: Conferma il voto
54
+ budget_excess:
55
+ close: Chiudi
56
+ description: Questo progetto supera il budget e non può essere aggiunto. Se vuoi puoi cancellare un progetto che hai già scelto di aggiungere, oppure votare in base alle tue preferenze.
57
+ title: Budget superato
58
+ budget_summary:
59
+ are_you_sure: Sei certo di voler cancellare il tuo voto?
60
+ assigned: 'Assegnato:'
61
+ cancel_order: Cancella il tuo voto e ricomincia.
62
+ checked_out:
63
+ description: Hai già votato per il budget. Se hai cambiato idea puoi %{cancel_link}.
64
+ title: Voto di budget completato.
65
+ description: Per quali progetti pensi che dovremmo allocare del budget? Indica un budget minimo di %{minimum_budget} ai progetti che vuoi votare e vota con le tue preferenze per definire il budget.
66
+ title: Tu decidi il budget
67
+ count:
68
+ projects_count:
69
+ one: 1 progetto
70
+ other: "%{count} progetti"
71
+ filters:
72
+ category: Categoria
73
+ category_prompt: Scegli una categoria
74
+ scopes: Visibilità/ambito
75
+ search: Cerca
76
+ filters_small_view:
77
+ close_modal: Chiudi modalità
78
+ filter: Filtra
79
+ filter_by: Filtra per
80
+ unfold: Espandi
81
+ order_progress:
82
+ vote: Vota
83
+ order_selected_projects:
84
+ remove: Rimuovi
85
+ selected_projects:
86
+ one: Progetto scelto
87
+ other: Progetti scelti
88
+ view: Visualizza
89
+ project:
90
+ add: Aggiungi
91
+ count:
92
+ one: 1 supporto/voto
93
+ other: "%{count} supportati/voti"
94
+ remove: Elimina
95
+ project_budget_button:
96
+ add: Aggiungi
97
+ added: Aggiunto
98
+ show:
99
+ view_all_projects: Visualizza tutti i progetti
100
+ features:
101
+ budgets:
102
+ actions:
103
+ vote: Votazione
104
+ name: Investimenti
105
+ settings:
106
+ global:
107
+ comments_enabled: Commenti abilitati
108
+ total_budget: Budget totale
109
+ vote_threshold_percent: Soglia voti (percentuale)
110
+ step:
111
+ comments_blocked: Commenti bloccati
112
+ show_votes: Visualizza voti
113
+ votes_enabled: Voti abilitati
114
+ orders:
115
+ checkout:
116
+ error: C'è stato un errore durante l'acquisizione del voto.
117
+ success: OK, il tuo voto è stato acquisito.
118
+ destroy:
119
+ error: C'è stato un errore durante la cancellazione del voto.
120
+ success: OK, il tuo voto è stato cancellato.
121
+ resource_links:
122
+ included_proposals:
123
+ project_proposals: 'Proposte incluse in questo progetto:'
124
+ index:
125
+ confirmed_orders_count: Conteggio ordini
126
+ total_budget: Budget totale
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateProjects < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  create_table :decidim_budgets_projects do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateOrders < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  create_table :decidim_budgets_orders do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateLineItems < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  create_table :decidim_budgets_line_items do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class RemoveShortDescriptionFromDecidimProjects < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  remove_column :decidim_budgets_projects, :short_description
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddReferenceToProjects < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  add_column :decidim_budgets_projects, :reference, :string
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class RemoveNotNullReferenceBudgets < ActiveRecord::Migration[5.0]
2
4
  def change
3
5
  change_column_null :decidim_budgets_projects, :reference, true
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MigrateProjectsCategory < ActiveRecord::Migration[5.1]
4
+ def change
5
+ # Create categorizations ensuring database integrity
6
+ execute('
7
+ INSERT INTO decidim_categorizations(decidim_category_id, categorizable_id, categorizable_type, created_at, updated_at)
8
+ SELECT decidim_category_id, decidim_budgets_projects.id, \'Decidim::Budgets::Project\', NOW(), NOW()
9
+ FROM decidim_budgets_projects
10
+ INNER JOIN decidim_categories ON decidim_categories.id = decidim_budgets_projects.decidim_category_id
11
+ ')
12
+ # Remove unused column
13
+ remove_column :decidim_budgets_projects, :decidim_category_id
14
+ end
15
+ end
@@ -65,13 +65,13 @@ Decidim.register_feature(:budgets) do |feature|
65
65
  Decidim::Attachment.create!(
66
66
  title: Decidim::Faker::Localized.sentence(2),
67
67
  description: Decidim::Faker::Localized.sentence(5),
68
- file: File.new(File.join(File.dirname(__FILE__), "seeds", "city.jpeg")),
68
+ file: File.new(File.join(__dir__, "seeds", "city.jpeg")),
69
69
  attached_to: project
70
70
  )
71
71
  Decidim::Attachment.create!(
72
72
  title: Decidim::Faker::Localized.sentence(2),
73
73
  description: Decidim::Faker::Localized.sentence(5),
74
- file: File.new(File.join(File.dirname(__FILE__), "seeds", "Exampledocument.pdf")),
74
+ file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")),
75
75
  attached_to: project
76
76
  )
77
77
  Decidim::Comments::Seed.comments_for(project)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-budgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
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: 2017-06-02 00:00:00.000000000 Z
13
+ date: 2017-06-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.2.0
21
+ version: 0.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.2.0
28
+ version: 0.3.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-comments
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.2.0
35
+ version: 0.3.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.2.0
42
+ version: 0.3.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rectify
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -88,42 +88,42 @@ dependencies:
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.2.0
91
+ version: 0.3.0
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.2.0
98
+ version: 0.3.0
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-proposals
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.2.0
105
+ version: 0.3.0
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.2.0
112
+ version: 0.3.0
113
113
  - !ruby/object:Gem::Dependency
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.2.0
119
+ version: 0.3.0
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.2.0
126
+ version: 0.3.0
127
127
  description: A budgets component for decidim's participatory processes.
128
128
  email:
129
129
  - josepjaume@gmail.com
@@ -195,6 +195,7 @@ files:
195
195
  - config/locales/eu.yml
196
196
  - config/locales/fi.yml
197
197
  - config/locales/fr.yml
198
+ - config/locales/it.yml
198
199
  - config/locales/nl.yml
199
200
  - db/migrate/20170127114122_create_projects.rb
200
201
  - db/migrate/20170130095615_create_orders.rb
@@ -202,6 +203,7 @@ files:
202
203
  - db/migrate/20170207101750_remove_short_description_from_decidim_projects.rb
203
204
  - db/migrate/20170215132708_add_reference_to_projects.rb
204
205
  - db/migrate/20170410074214_remove_not_null_reference_budgets.rb
206
+ - db/migrate/20170612101846_migrate_projects_category.rb
205
207
  - lib/decidim/budgets.rb
206
208
  - lib/decidim/budgets/admin.rb
207
209
  - lib/decidim/budgets/admin_engine.rb