decidim-budgets 0.9.3 → 0.10.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/javascripts/decidim/budgets/progressFixed.js.es6 +2 -2
- data/app/commands/decidim/budgets/admin/update_project.rb +1 -1
- data/app/controllers/decidim/budgets/admin/attachment_collections_controller.rb +29 -0
- data/app/forms/decidim/budgets/admin/project_form.rb +9 -2
- data/app/models/decidim/budgets/order.rb +2 -0
- data/app/models/decidim/budgets/project.rb +2 -1
- data/app/services/decidim/budgets/project_search.rb +1 -1
- data/app/views/decidim/budgets/admin/projects/index.html.erb +4 -0
- data/app/views/decidim/budgets/projects/show.html.erb +1 -1
- data/config/locales/ca.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/eu.yml +1 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/fr.yml +1 -0
- data/config/locales/gl.yml +1 -0
- data/config/locales/it.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/config/locales/pl.yml +1 -13
- data/config/locales/pt-BR.yml +1 -0
- data/config/locales/pt.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/uk.yml +3 -2
- data/lib/decidim/budgets/admin_engine.rb +1 -0
- data/lib/decidim/budgets/feature.rb +14 -0
- data/lib/decidim/budgets/version.rb +1 -1
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26b0f42475f4913d1bd2e6b08236aa7b13164d9930e2ba11a1223ce23db47f17
|
4
|
+
data.tar.gz: 99d67d115391105cfb7bf1d2c14c06afb530386dbbce84dfa048920ff5fd6c11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e5247cb648cc220aca7725588e0b3e1441b2813b3baae6d470f8ce2bacf875718c54874847177a9f80b304a143189de8d893e52e1217d17de4f1d989858830
|
7
|
+
data.tar.gz: 79e7482532f355825685c77ca2244279c2eaba14b2930dd5ae601507595ab3ce55f8de52194c3c560c89bceb36a9dbc51dab94a3f37599dcc82317082d33098c
|
@@ -1,8 +1,8 @@
|
|
1
1
|
$(() => {
|
2
2
|
const checkProgressPosition = () => {
|
3
3
|
let progressFix = document.querySelector("[data-progressbox-fixed]"),
|
4
|
-
|
5
|
-
|
4
|
+
progressRef = document.querySelector("[data-progress-reference]"),
|
5
|
+
progressVisibleClass = "is-progressbox-visible";
|
6
6
|
|
7
7
|
if (!progressRef) {
|
8
8
|
return;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Budgets
|
5
|
+
module Admin
|
6
|
+
# Controller that allows managing all the attachment collections for a budget.
|
7
|
+
#
|
8
|
+
class AttachmentCollectionsController < Admin::ApplicationController
|
9
|
+
include Decidim::Admin::Concerns::HasAttachmentCollections
|
10
|
+
|
11
|
+
def after_destroy_path
|
12
|
+
project_attachment_collections_path(project, project.feature, current_participatory_space)
|
13
|
+
end
|
14
|
+
|
15
|
+
def collection_for
|
16
|
+
project
|
17
|
+
end
|
18
|
+
|
19
|
+
def project
|
20
|
+
@project ||= projects.find(params[:project_id])
|
21
|
+
end
|
22
|
+
|
23
|
+
def authorization_object
|
24
|
+
project.feature
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -22,7 +22,8 @@ module Decidim
|
|
22
22
|
|
23
23
|
validates :category, presence: true, if: ->(form) { form.decidim_category_id.present? }
|
24
24
|
validates :scope, presence: true, if: ->(form) { form.decidim_scope_id.present? }
|
25
|
-
|
25
|
+
|
26
|
+
validate :scope_belongs_to_participatory_space_scope
|
26
27
|
|
27
28
|
delegate :categories, to: :current_feature
|
28
29
|
|
@@ -49,7 +50,7 @@ module Decidim
|
|
49
50
|
#
|
50
51
|
# Returns a Decidim::Scope
|
51
52
|
def scope
|
52
|
-
@scope ||= @decidim_scope_id ?
|
53
|
+
@scope ||= @decidim_scope_id ? current_participatory_space.scopes.find_by(id: @decidim_scope_id) : current_participatory_space.scope
|
53
54
|
end
|
54
55
|
|
55
56
|
# Scope identifier
|
@@ -58,6 +59,12 @@ module Decidim
|
|
58
59
|
def decidim_scope_id
|
59
60
|
@decidim_scope_id || scope&.id
|
60
61
|
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def scope_belongs_to_participatory_space_scope
|
66
|
+
errors.add(:decidim_scope_id, :invalid) if current_participatory_space.out_of_scope?(scope)
|
67
|
+
end
|
61
68
|
end
|
62
69
|
end
|
63
70
|
end
|
@@ -7,9 +7,10 @@ module Decidim
|
|
7
7
|
class Project < Budgets::ApplicationRecord
|
8
8
|
include Decidim::Resourceable
|
9
9
|
include Decidim::HasFeature
|
10
|
-
include Decidim::
|
10
|
+
include Decidim::ScopableFeature
|
11
11
|
include Decidim::HasCategory
|
12
12
|
include Decidim::HasAttachments
|
13
|
+
include Decidim::HasAttachmentCollections
|
13
14
|
include Decidim::HasReference
|
14
15
|
include Decidim::Followable
|
15
16
|
include Decidim::Comments::Commentable
|
@@ -22,7 +22,7 @@ module Decidim
|
|
22
22
|
|
23
23
|
# Returns the random projects for the current page.
|
24
24
|
def results
|
25
|
-
@
|
25
|
+
@results ||= Project.transaction do
|
26
26
|
Project.connection.execute("SELECT setseed(#{Project.connection.quote(random_seed)})")
|
27
27
|
super.reorder("RANDOM()").load
|
28
28
|
end
|
@@ -32,6 +32,10 @@
|
|
32
32
|
<%= icon_link_to "pencil", edit_project_path(project), t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
33
33
|
<% end %>
|
34
34
|
|
35
|
+
<% if can? :update, current_feature %>
|
36
|
+
<%= icon_link_to "folder", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
|
37
|
+
<% end %>
|
38
|
+
|
35
39
|
<% if can? :update, current_feature %>
|
36
40
|
<%= icon_link_to "paperclip", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
|
37
41
|
<% end %>
|
@@ -33,7 +33,7 @@
|
|
33
33
|
<%= render partial: "decidim/shared/follow_button", locals: { followable: project } %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
|
-
<%=
|
36
|
+
<%= resource_reference(project) %>
|
37
37
|
</div>
|
38
38
|
<div class="columns mediumlarge-8 mediumlarge-pull-4">
|
39
39
|
<div class="section">
|
data/config/locales/ca.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/eu.yml
CHANGED
data/config/locales/fi.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/gl.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/pl.yml
CHANGED
@@ -11,6 +11,7 @@ pl:
|
|
11
11
|
decidim:
|
12
12
|
budgets:
|
13
13
|
actions:
|
14
|
+
attachment_collections: Kolekcje
|
14
15
|
attachments: Załączniki
|
15
16
|
confirm_destroy: Czy na pewno chcesz usunąć ten projekt?
|
16
17
|
destroy: Kasować
|
@@ -66,11 +67,6 @@ pl:
|
|
66
67
|
title: Ukończono budżet budżetowy
|
67
68
|
description: Jakie projekty myślisz, powinniśmy przeznaczyć budżet? Przyznaj co najmniej %{minimum_budget} projekty, które chcesz i głosuj zgodnie z Twoimi preferencjami, aby określić budżet.
|
68
69
|
title: Ty decydujesz budżet
|
69
|
-
count:
|
70
|
-
projects_count:
|
71
|
-
one: 1 projekt
|
72
|
-
few: "%{count} projektów"
|
73
|
-
other: "%{count} projektów"
|
74
70
|
filters:
|
75
71
|
category: Kategoria
|
76
72
|
category_prompt: Wybierz kategorię
|
@@ -84,17 +80,9 @@ pl:
|
|
84
80
|
vote: Głosować
|
85
81
|
order_selected_projects:
|
86
82
|
remove: Usunąć
|
87
|
-
selected_projects:
|
88
|
-
one: Wybrany projekt
|
89
|
-
few: Wybranych projektów
|
90
|
-
other: Wybranych projektów
|
91
83
|
view: Widok
|
92
84
|
project:
|
93
85
|
add: Dodaj
|
94
|
-
count:
|
95
|
-
one: 1
|
96
|
-
few: "%{count} obsługuje"
|
97
|
-
other: "%{count} obsługuje"
|
98
86
|
remove: Usunąć
|
99
87
|
project_budget_button:
|
100
88
|
add: Dodaj
|
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/pt.yml
CHANGED
data/config/locales/sv.yml
CHANGED
data/config/locales/uk.yml
CHANGED
@@ -7,10 +7,11 @@ uk:
|
|
7
7
|
decidim_scope_id: Терен
|
8
8
|
description: Опис
|
9
9
|
proposal_ids: Супутні пропозиції
|
10
|
-
title:
|
10
|
+
title: Заголовок
|
11
11
|
decidim:
|
12
12
|
budgets:
|
13
13
|
actions:
|
14
|
+
attachment_collections: Збірки
|
14
15
|
attachments: Вкладені файли
|
15
16
|
confirm_destroy: Ви дійсно бажаєте видалити цей проект?
|
16
17
|
destroy: Видалити
|
@@ -44,7 +45,7 @@ uk:
|
|
44
45
|
models:
|
45
46
|
project:
|
46
47
|
fields:
|
47
|
-
title:
|
48
|
+
title: Заголовок
|
48
49
|
projects:
|
49
50
|
budget_confirm:
|
50
51
|
are_you_sure: Чи ви згодні? Підтвердивши свій голос, ви не зможете його потім змінити.
|
@@ -68,6 +68,20 @@ Decidim.register_feature(:budgets) do |feature|
|
|
68
68
|
end,
|
69
69
|
budget: Faker::Number.number(8)
|
70
70
|
)
|
71
|
+
|
72
|
+
attachment_collection = Decidim::AttachmentCollection.create!(
|
73
|
+
name: Decidim::Faker::Localized.word,
|
74
|
+
description: Decidim::Faker::Localized.sentence(5),
|
75
|
+
collection_for: project
|
76
|
+
)
|
77
|
+
|
78
|
+
Decidim::Attachment.create!(
|
79
|
+
title: Decidim::Faker::Localized.sentence(2),
|
80
|
+
description: Decidim::Faker::Localized.sentence(5),
|
81
|
+
file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")),
|
82
|
+
attachment_collection: attachment_collection,
|
83
|
+
attached_to: project
|
84
|
+
)
|
71
85
|
Decidim::Attachment.create!(
|
72
86
|
title: Decidim::Faker::Localized.sentence(2),
|
73
87
|
description: Decidim::Faker::Localized.sentence(5),
|
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.
|
4
|
+
version: 0.10.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: 2018-
|
13
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-comments
|
@@ -18,28 +18,28 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.10.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.
|
28
|
+
version: 0.10.0
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: decidim-core
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - '='
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
35
|
+
version: 0.10.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.
|
42
|
+
version: 0.10.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: kaminari
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,42 +74,42 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - '='
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version: 0.
|
77
|
+
version: 0.10.0
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
82
|
- - '='
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
version: 0.
|
84
|
+
version: 0.10.0
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: decidim-dev
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - '='
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: 0.
|
91
|
+
version: 0.10.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.
|
98
|
+
version: 0.10.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.
|
105
|
+
version: 0.10.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.
|
112
|
+
version: 0.10.0
|
113
113
|
description: A budgets component for decidim's participatory spaces.
|
114
114
|
email:
|
115
115
|
- josepjaume@gmail.com
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- app/commands/decidim/budgets/remove_line_item.rb
|
138
138
|
- app/controllers/concerns/decidim/budgets/needs_current_order.rb
|
139
139
|
- app/controllers/decidim/budgets/admin/application_controller.rb
|
140
|
+
- app/controllers/decidim/budgets/admin/attachment_collections_controller.rb
|
140
141
|
- app/controllers/decidim/budgets/admin/attachments_controller.rb
|
141
142
|
- app/controllers/decidim/budgets/admin/projects_controller.rb
|
142
143
|
- app/controllers/decidim/budgets/application_controller.rb
|
@@ -224,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
225
|
version: '0'
|
225
226
|
requirements: []
|
226
227
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.7.
|
228
|
+
rubygems_version: 2.7.6
|
228
229
|
signing_key:
|
229
230
|
specification_version: 4
|
230
231
|
summary: Decidim budgets module
|