decidim-budgets 0.11.2 → 0.12.0.pre
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 +4 -4
- data/app/cells/decidim/budgets/project_cell.rb +21 -0
- data/app/cells/decidim/budgets/project_m/data.erb +12 -0
- data/app/cells/decidim/budgets/project_m/footer.erb +5 -0
- data/app/cells/decidim/budgets/project_m_cell.rb +18 -0
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +10 -0
- data/app/permissions/decidim/budgets/admin/permissions.rb +31 -0
- data/app/permissions/decidim/budgets/permissions.rb +24 -0
- data/app/services/decidim/budgets/project_search.rb +1 -1
- data/app/views/decidim/budgets/admin/projects/index.html.erb +8 -8
- data/app/views/decidim/budgets/projects/_linked_projects.html.erb +0 -1
- data/app/views/decidim/budgets/projects/_project.html.erb +3 -3
- data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +2 -2
- data/app/views/decidim/budgets/projects/index.html.erb +1 -1
- data/app/views/decidim/budgets/projects/show.html.erb +2 -2
- data/config/locales/ca.yml +7 -1
- data/config/locales/en.yml +7 -1
- data/config/locales/es.yml +7 -1
- data/config/locales/eu.yml +7 -1
- data/config/locales/fi.yml +7 -1
- data/config/locales/fr.yml +7 -1
- data/config/locales/gl.yml +7 -1
- data/config/locales/it.yml +7 -1
- data/config/locales/nl.yml +7 -1
- data/config/locales/pl.yml +9 -1
- data/config/locales/pt-BR.yml +7 -1
- data/config/locales/pt.yml +7 -1
- data/config/locales/ru.yml +9 -1
- data/config/locales/sv.yml +7 -1
- data/config/locales/uk.yml +9 -1
- data/lib/decidim/budgets/component.rb +3 -1
- data/lib/decidim/budgets/engine.rb +5 -0
- data/lib/decidim/budgets/version.rb +1 -1
- metadata +20 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4970b83c1695c6003e2600e17edf7fc231367bbdda7079a750a6db4b802e1571
|
4
|
+
data.tar.gz: 91afeb74692b32d8ee0a1a30636097ed4d0cee0a8fcf6e6c310c641d84c6efe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6755ade0e52f7ca459dcfdb00703ca6383c57679cce602ea3652913150c2bce63e5f25dfead35d84e5f4940850b18ed033f5e3f81927e9ac5b8fe4b2552ac2a5
|
7
|
+
data.tar.gz: 9f928f3f3ea5e83d95ee253a6e03a650d091801f3096a01920055605f9be26945fde2abba3be727262d5f3936cac93d29214dff05ec45871758e024a3a590dce
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Budgets
|
5
|
+
# This cell renders the budget project card for an instance of a project
|
6
|
+
# the default size is the Medium Card (:m)
|
7
|
+
class ProjectCell < Decidim::ViewModel
|
8
|
+
include Cell::ViewModel::Partial
|
9
|
+
|
10
|
+
def show
|
11
|
+
cell card_size, model
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def card_size
|
17
|
+
"decidim/budgets/project_m"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="card__icondata">
|
2
|
+
<ul class="card-data">
|
3
|
+
<li class="card-data__item">
|
4
|
+
<%= icon "euro-outline", class: "icon--big" %>
|
5
|
+
</li>
|
6
|
+
<li class="card-data__item">
|
7
|
+
<div class="text-left text-uppercase">
|
8
|
+
<strong class="heading4"><%= budget_to_currency model.budget %></strong>
|
9
|
+
</div>
|
10
|
+
</li>
|
11
|
+
</ul>
|
12
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Budgets
|
5
|
+
# This cell renders the Medium (:m) project card
|
6
|
+
# for an given instance of a Project
|
7
|
+
class ProjectMCell < Decidim::CardMCell
|
8
|
+
include ActiveSupport::NumberHelper
|
9
|
+
include Decidim::Budgets::ProjectsHelper
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def resource_icon
|
14
|
+
icon "projects", class: "icon--big"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -8,10 +8,14 @@ module Decidim
|
|
8
8
|
helper_method :projects, :finished_orders, :pending_orders
|
9
9
|
|
10
10
|
def new
|
11
|
+
enforce_permission_to :create, :project
|
12
|
+
|
11
13
|
@form = form(ProjectForm).instance
|
12
14
|
end
|
13
15
|
|
14
16
|
def create
|
17
|
+
enforce_permission_to :create, :project
|
18
|
+
|
15
19
|
@form = form(ProjectForm).from_params(params)
|
16
20
|
|
17
21
|
CreateProject.call(@form) do
|
@@ -28,10 +32,14 @@ module Decidim
|
|
28
32
|
end
|
29
33
|
|
30
34
|
def edit
|
35
|
+
enforce_permission_to :update, :project, project: project
|
36
|
+
|
31
37
|
@form = form(ProjectForm).from_model(project)
|
32
38
|
end
|
33
39
|
|
34
40
|
def update
|
41
|
+
enforce_permission_to :update, :project, project: project
|
42
|
+
|
35
43
|
@form = form(ProjectForm).from_params(params)
|
36
44
|
|
37
45
|
UpdateProject.call(@form, project) do
|
@@ -48,6 +56,8 @@ module Decidim
|
|
48
56
|
end
|
49
57
|
|
50
58
|
def destroy
|
59
|
+
enforce_permission_to :destroy, :project, project: project
|
60
|
+
|
51
61
|
DestroyProject.call(project, current_user) do
|
52
62
|
on(:ok) do
|
53
63
|
flash[:notice] = I18n.t("projects.destroy.success", scope: "decidim.budgets.admin")
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Budgets
|
5
|
+
module Admin
|
6
|
+
class Permissions < Decidim::DefaultPermissions
|
7
|
+
def permissions
|
8
|
+
# The public part needs to be implemented yet
|
9
|
+
return permission_action if permission_action.scope != :admin
|
10
|
+
|
11
|
+
return permission_action if permission_action.subject != :project
|
12
|
+
|
13
|
+
case permission_action.action
|
14
|
+
when :create
|
15
|
+
permission_action.allow!
|
16
|
+
when :update, :destroy
|
17
|
+
permission_action.allow! if project.present?
|
18
|
+
end
|
19
|
+
|
20
|
+
permission_action
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def project
|
26
|
+
@project ||= context.fetch(:project, nil)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Budgets
|
5
|
+
class Permissions < Decidim::DefaultPermissions
|
6
|
+
def permissions
|
7
|
+
return permission_action unless user
|
8
|
+
|
9
|
+
# Delegate the admin permission checks to the admin permissions class
|
10
|
+
return Decidim::Budgets::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin
|
11
|
+
return permission_action if permission_action.scope != :public
|
12
|
+
|
13
|
+
return permission_action if permission_action.subject != :project
|
14
|
+
|
15
|
+
case permission_action.action
|
16
|
+
when :report
|
17
|
+
permission_action.allow!
|
18
|
+
end
|
19
|
+
|
20
|
+
permission_action
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<div class="card-divider">
|
3
3
|
<h2 class="card-title">
|
4
4
|
<%= t(".title") %>
|
5
|
-
<%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_project_path, class: "button tiny button--title" if
|
5
|
+
<%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_project_path, class: "button tiny button--title" if allowed_to? :create, :project %>
|
6
6
|
</h2>
|
7
7
|
</div>
|
8
8
|
|
@@ -28,19 +28,19 @@
|
|
28
28
|
<td class="table-list__actions">
|
29
29
|
<%= icon_link_to "eye", resource_locator(project).path, t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
|
30
30
|
|
31
|
-
<% if
|
31
|
+
<% if allowed_to? :update, :project, project: project %>
|
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
|
35
|
+
<% if allowed_to? :update, :project, project: project %>
|
36
36
|
<%= icon_link_to "folder", project_attachment_collections_path(project), t("actions.attachment_collections", scope: "decidim.budgets"), class: "action-icon--attachment_collections" %>
|
37
37
|
<% end %>
|
38
38
|
|
39
|
-
<% if
|
39
|
+
<% if allowed_to? :update, :project, project: project %>
|
40
40
|
<%= icon_link_to "paperclip", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
|
41
41
|
<% end %>
|
42
42
|
|
43
|
-
<% if
|
43
|
+
<% if allowed_to? :destroy, :project, project: project %>
|
44
44
|
<%= icon_link_to "circle-x", project_path(project), t("actions.destroy", scope: "decidim.budgets"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } %>
|
45
45
|
<% end %>
|
46
46
|
</td>
|
@@ -52,8 +52,8 @@
|
|
52
52
|
</div>
|
53
53
|
</div>
|
54
54
|
<div class="card-divider">
|
55
|
-
<strong><%= t ".finished_orders"
|
56
|
-
<span
|
57
|
-
<strong><%= t ".pending_orders"
|
55
|
+
<strong><%= t ".finished_orders" %>: </strong><span><%= finished_orders.count %></span>
|
56
|
+
<span> | </span>
|
57
|
+
<strong><%= t ".pending_orders" %>: </strong><span><%= pending_orders.count %></span>
|
58
58
|
</div>
|
59
59
|
</div>
|
@@ -1,6 +1,5 @@
|
|
1
1
|
<div class="card card--action card--list">
|
2
2
|
<% resources.each do |project| %>
|
3
|
-
<% next unless project.component.published? %>
|
4
3
|
<div class="card--list__item">
|
5
4
|
<%= icon "actions", class: "card--list__icon", remove_icon_class: true %>
|
6
5
|
<%= link_to resource_locator(project).path, class: "card--list__text card__link card__link--block" do %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<%= translated_attribute project.title %>
|
7
7
|
</h5>
|
8
8
|
<% end %>
|
9
|
-
<%=
|
9
|
+
<%= cell "decidim/tags", project, context: {extra_classes: ["tags--project"]} %>
|
10
10
|
</div>
|
11
11
|
</div>
|
12
12
|
<% if current_user.present? %>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<span class="card--list__data__number budget-list__number">
|
16
16
|
<%= budget_to_currency(project.budget) %>
|
17
17
|
</span>
|
18
|
-
<%= action_authorized_button_to "vote", order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out
|
18
|
+
<%= action_authorized_button_to "vote", order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button tiny budget--list__action success" do %>
|
19
19
|
<%= icon("check", class: "icon--small", aria_label: t(".remove"), role: "img") %>
|
20
20
|
<% end %>
|
21
21
|
<% if current_settings.show_votes? %>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
<span class="card--list__data__number budget-list__number">
|
30
30
|
<%= budget_to_currency(project.budget) %>
|
31
31
|
</span>
|
32
|
-
<%= action_authorized_button_to "vote", order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out
|
32
|
+
<%= action_authorized_button_to "vote", order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button tiny hollow budget--list__action" do %>
|
33
33
|
<%= icon("check", class: "icon--small", aria_label: t(".add"), role: "img") %>
|
34
34
|
<% end %>
|
35
35
|
<% if current_settings.show_votes? %>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<% if current_user.present? %>
|
2
2
|
<% if current_order && current_order.projects.include?(project) %>
|
3
|
-
<%= action_authorized_button_to "vote", t(".added"), order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out
|
3
|
+
<%= action_authorized_button_to "vote", t(".added"), order_line_item_path(project_id: project), method: :delete, remote: true, data: { disable: true, budget: project.budget, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button expanded button--sc success budget--list__action" %>
|
4
4
|
<% else %>
|
5
|
-
<%= action_authorized_button_to "vote", t(".add"), order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out
|
5
|
+
<%= action_authorized_button_to "vote", t(".add"), order_line_item_path(project_id: project), method: :post, remote: true, data: { disable: true, budget: project.budget, add: true, "redirect-url": project_path(project) }, disabled: !current_settings.votes_enabled? || current_order_checked_out? || !current_participatory_space.can_participate?(current_user), class: "button expanded button--sc budget--list__action" %>
|
6
6
|
<% end %>
|
7
7
|
<% else %>
|
8
8
|
<button class="button expanded button--sc disabled" data-toggle="loginModal"><%= t(".add") %></button>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= render partial: "decidim/shared/component_announcement" %>
|
2
2
|
|
3
|
-
<% if current_user.present? && current_settings.votes_enabled? %>
|
3
|
+
<% if current_user.present? && current_settings.votes_enabled? && current_participatory_space.can_participate?(current_user) %>
|
4
4
|
<div class="row column">
|
5
5
|
<%= render partial: "budget_summary", locals: { include_heading: true } %>
|
6
6
|
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
) %>
|
5
5
|
|
6
6
|
<div class="row column view-header">
|
7
|
-
<% if current_user.present? && current_settings.votes_enabled? %>
|
7
|
+
<% if current_user.present? && current_settings.votes_enabled? && current_participatory_space.can_participate?(current_user) %>
|
8
8
|
<%= render partial: "budget_summary", locals: { include_heading: false } %>
|
9
9
|
<% end %>
|
10
10
|
<%= link_to projects_path, class: "muted-link" do %>
|
@@ -38,7 +38,7 @@
|
|
38
38
|
<div class="columns mediumlarge-8 mediumlarge-pull-4">
|
39
39
|
<div class="section">
|
40
40
|
<%= decidim_sanitize translated_attribute project.description %>
|
41
|
-
<%=
|
41
|
+
<%= cell "decidim/tags", project, context: {extra_classes: ["tags--project"]} %>
|
42
42
|
</div>
|
43
43
|
<%= linked_resources_for project, :proposals, "included_proposals" %>
|
44
44
|
<%= linked_resources_for project, :results, "included_projects" %>
|
data/config/locales/ca.yml
CHANGED
@@ -8,6 +8,11 @@ ca:
|
|
8
8
|
description: Descripció
|
9
9
|
proposal_ids: Propostes relacionades
|
10
10
|
title: Títol
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Projecte
|
15
|
+
other: Projectes
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ ca:
|
|
99
104
|
one: 1 suport
|
100
105
|
other: "%{count} suports"
|
101
106
|
remove: Esborrar
|
107
|
+
view: Veure
|
102
108
|
project_budget_button:
|
103
109
|
add: Afegir
|
104
110
|
added: Afegit
|
@@ -131,7 +137,7 @@ ca:
|
|
131
137
|
success: El seu vot ha estat cancel·lat correctament
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Propostes incloses en aquest projecte:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Recompte de vots
|
137
143
|
total_budget: Pressupost total
|
data/config/locales/en.yml
CHANGED
@@ -9,6 +9,11 @@ en:
|
|
9
9
|
description: Description
|
10
10
|
proposal_ids: Related proposals
|
11
11
|
title: Title
|
12
|
+
activerecord:
|
13
|
+
models:
|
14
|
+
decidim/budgets/project:
|
15
|
+
one: Project
|
16
|
+
other: Projects
|
12
17
|
decidim:
|
13
18
|
budgets:
|
14
19
|
actions:
|
@@ -100,6 +105,7 @@ en:
|
|
100
105
|
one: 1 support
|
101
106
|
other: "%{count} supports"
|
102
107
|
remove: Remove
|
108
|
+
view: View
|
103
109
|
project_budget_button:
|
104
110
|
add: Add
|
105
111
|
added: Added
|
@@ -132,7 +138,7 @@ en:
|
|
132
138
|
success: Your vote has been canceled successfully
|
133
139
|
resource_links:
|
134
140
|
included_proposals:
|
135
|
-
|
141
|
+
project_proposal: 'Proposals included in this project:'
|
136
142
|
index:
|
137
143
|
confirmed_orders_count: Votes count
|
138
144
|
total_budget: Total budget
|
data/config/locales/es.yml
CHANGED
@@ -8,6 +8,11 @@ es:
|
|
8
8
|
description: Descripción
|
9
9
|
proposal_ids: Propuestas relacionadas
|
10
10
|
title: Título
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Proyecto
|
15
|
+
other: Proyectos
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ es:
|
|
99
104
|
one: 1 apoyo
|
100
105
|
other: "%{count} apoyos"
|
101
106
|
remove: Eliminar
|
107
|
+
view: Ver
|
102
108
|
project_budget_button:
|
103
109
|
add: Añadir
|
104
110
|
added: Añadido
|
@@ -131,7 +137,7 @@ es:
|
|
131
137
|
success: Tu voto ha sido cancelado correctamente
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Propuestas incluidas en este proyecto:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Número de votos
|
137
143
|
total_budget: Presupuesto total
|
data/config/locales/eu.yml
CHANGED
@@ -8,6 +8,11 @@ eu:
|
|
8
8
|
description: Descripción
|
9
9
|
proposal_ids: Honekin lotutako proposamenak
|
10
10
|
title: Titulua
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Proiektua
|
15
|
+
other: Proiektuak
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ eu:
|
|
99
104
|
one: 1 sostengu
|
100
105
|
other: "%{count} sostengu"
|
101
106
|
remove: Kendu
|
107
|
+
view: ikusi
|
102
108
|
project_budget_button:
|
103
109
|
add: Gehitu
|
104
110
|
added: Erantsita
|
@@ -131,7 +137,7 @@ eu:
|
|
131
137
|
success: Zure botua zuzen ezeztatu da
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Proiektu honetan jasotako proposamenak:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Botoen zenbaketa
|
137
143
|
total_budget: Guztizko aurrekontua
|
data/config/locales/fi.yml
CHANGED
@@ -8,6 +8,11 @@ fi:
|
|
8
8
|
description: Kuvaus
|
9
9
|
proposal_ids: Liittyvät esitykset
|
10
10
|
title: Otsikko
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: projekti
|
15
|
+
other: projektit
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ fi:
|
|
99
104
|
one: 1 kannatus
|
100
105
|
other: "%{count} kannatusta"
|
101
106
|
remove: Poista
|
107
|
+
view: näkymä
|
102
108
|
project_budget_button:
|
103
109
|
add: Lisää
|
104
110
|
added: Lisätty
|
@@ -131,7 +137,7 @@ fi:
|
|
131
137
|
success: Äänesi on peruttu onnistuneesti
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Tähän projektiin liittyvät ehdotukset:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Äänten määrä
|
137
143
|
total_budget: Koko budjetti
|
data/config/locales/fr.yml
CHANGED
@@ -8,6 +8,11 @@ fr:
|
|
8
8
|
description: Description
|
9
9
|
proposal_ids: Propositions liées
|
10
10
|
title: Titre
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Projet
|
15
|
+
other: Projets
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ fr:
|
|
99
104
|
one: 1 soutien
|
100
105
|
other: "%{count} soutiens"
|
101
106
|
remove: Supprimer
|
107
|
+
view: Voir
|
102
108
|
project_budget_button:
|
103
109
|
add: Ajouter
|
104
110
|
added: Ajouté
|
@@ -131,7 +137,7 @@ fr:
|
|
131
137
|
success: Votre vote a été annulé avec succès
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Propositions incluses dans ce projet:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Nombre de votes
|
137
143
|
total_budget: Budget total
|
data/config/locales/gl.yml
CHANGED
@@ -8,6 +8,11 @@ gl:
|
|
8
8
|
description: Descrición
|
9
9
|
proposal_ids: Propostas relacionadas
|
10
10
|
title: Título
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Proxecto
|
15
|
+
other: Proxectos
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ gl:
|
|
99
104
|
one: 1 apoio
|
100
105
|
other: "%{count} soporta"
|
101
106
|
remove: Quitar
|
107
|
+
view: Ver
|
102
108
|
project_budget_button:
|
103
109
|
add: Engadir
|
104
110
|
added: Engadido
|
@@ -131,7 +137,7 @@ gl:
|
|
131
137
|
success: O teu voto foi cancelado correctamente
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Propostas incluídas neste proxecto:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Reconto de votos
|
137
143
|
total_budget: Orzamento total
|
data/config/locales/it.yml
CHANGED
@@ -8,6 +8,11 @@ it:
|
|
8
8
|
description: Descrizione
|
9
9
|
proposal_ids: Proposte correlate
|
10
10
|
title: Titolo
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Progetto
|
15
|
+
other: progetti
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ it:
|
|
99
104
|
one: 1 supporto/voto
|
100
105
|
other: "%{count} supportati/voti"
|
101
106
|
remove: Elimina
|
107
|
+
view: vista
|
102
108
|
project_budget_button:
|
103
109
|
add: Aggiungi
|
104
110
|
added: Aggiunto
|
@@ -131,7 +137,7 @@ it:
|
|
131
137
|
success: OK, il tuo voto è stato cancellato.
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Proposte incluse in questo progetto:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Computo dei voti
|
137
143
|
total_budget: Budget totale
|
data/config/locales/nl.yml
CHANGED
@@ -8,6 +8,11 @@ nl:
|
|
8
8
|
description: Beschrijving
|
9
9
|
proposal_ids: Verwante voorstellen
|
10
10
|
title: Titel
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: project
|
15
|
+
other: projecten
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ nl:
|
|
99
104
|
one: 1 ondersteuning
|
100
105
|
other: "%{count} ondersteuning"
|
101
106
|
remove: Verwijderen
|
107
|
+
view: Uitzicht
|
102
108
|
project_budget_button:
|
103
109
|
add: Toevoegen
|
104
110
|
added: Toegevoegd
|
@@ -131,7 +137,7 @@ nl:
|
|
131
137
|
success: Uw stem is succesvol geannuleerd
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Voorstellen opgenomen in dit project:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Aantal stemmen
|
137
143
|
total_budget: Totale begroting
|
data/config/locales/pl.yml
CHANGED
@@ -8,6 +8,13 @@ pl:
|
|
8
8
|
description: Opis
|
9
9
|
proposal_ids: Proponowane propozycje
|
10
10
|
title: Tytuł
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Projekt
|
15
|
+
few: Projektowanie
|
16
|
+
many: Projektowanie
|
17
|
+
other: Projektowanie
|
11
18
|
decidim:
|
12
19
|
budgets:
|
13
20
|
actions:
|
@@ -105,6 +112,7 @@ pl:
|
|
105
112
|
many: "%{count} obsługuje"
|
106
113
|
other: "%{count} obsługuje"
|
107
114
|
remove: Usunąć
|
115
|
+
view: Widok
|
108
116
|
project_budget_button:
|
109
117
|
add: Dodaj
|
110
118
|
added: W dodatku
|
@@ -137,7 +145,7 @@ pl:
|
|
137
145
|
success: Twój głos został pomyślnie zakończony
|
138
146
|
resource_links:
|
139
147
|
included_proposals:
|
140
|
-
|
148
|
+
project_proposal: 'Propozycje zawarte w tym projekcie:'
|
141
149
|
index:
|
142
150
|
confirmed_orders_count: Liczba głosów
|
143
151
|
total_budget: Cały budżet
|
data/config/locales/pt-BR.yml
CHANGED
@@ -8,6 +8,11 @@ pt-BR:
|
|
8
8
|
description: Descrição
|
9
9
|
proposal_ids: Propostas relacionadas
|
10
10
|
title: Título
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Projeto
|
15
|
+
other: Projetos
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ pt-BR:
|
|
99
104
|
one: 1 suporte
|
100
105
|
other: "%{count} suporta"
|
101
106
|
remove: Remover
|
107
|
+
view: Ver
|
102
108
|
project_budget_button:
|
103
109
|
add: Adicionar
|
104
110
|
added: Adicionado
|
@@ -131,7 +137,7 @@ pt-BR:
|
|
131
137
|
success: Seu voto foi cancelado com sucesso
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Propostas incluídas neste projeto:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Contagem de votos
|
137
143
|
total_budget: Orçamento total
|
data/config/locales/pt.yml
CHANGED
@@ -8,6 +8,11 @@ pt:
|
|
8
8
|
description: Descrição
|
9
9
|
proposal_ids: Propostas relacionadas
|
10
10
|
title: Título
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Projeto
|
15
|
+
other: Projetos
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ pt:
|
|
99
104
|
one: 1 suporte
|
100
105
|
other: "%{count} suporta"
|
101
106
|
remove: Remover
|
107
|
+
view: Visão
|
102
108
|
project_budget_button:
|
103
109
|
add: Adicionar
|
104
110
|
added: Adicionado
|
@@ -131,7 +137,7 @@ pt:
|
|
131
137
|
success: Seu voto foi cancelado com sucesso
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Propostas incluídas neste projeto:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Contagem de votos
|
137
143
|
total_budget: Orçamento total
|
data/config/locales/ru.yml
CHANGED
@@ -8,6 +8,13 @@ ru:
|
|
8
8
|
description: Описание
|
9
9
|
proposal_ids: Подобные предложения
|
10
10
|
title: Название
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Проект
|
15
|
+
few: Проекта
|
16
|
+
many: Проектов
|
17
|
+
other: Проектов
|
11
18
|
decidim:
|
12
19
|
budgets:
|
13
20
|
actions:
|
@@ -105,6 +112,7 @@ ru:
|
|
105
112
|
many: "%{count} поддерживает"
|
106
113
|
other: "%{count} поддерживает"
|
107
114
|
remove: Удалить
|
115
|
+
view: Посмотреть
|
108
116
|
project_budget_button:
|
109
117
|
add: Добавить
|
110
118
|
added: Добавлено
|
@@ -137,7 +145,7 @@ ru:
|
|
137
145
|
success: Ваш голос успешно отменен
|
138
146
|
resource_links:
|
139
147
|
included_proposals:
|
140
|
-
|
148
|
+
project_proposal: 'Предложения, включенные в этот проект:'
|
141
149
|
index:
|
142
150
|
confirmed_orders_count: Количество голосов
|
143
151
|
total_budget: Общий бюджет
|
data/config/locales/sv.yml
CHANGED
@@ -8,6 +8,11 @@ sv:
|
|
8
8
|
description: Beskrivning
|
9
9
|
proposal_ids: Relaterade förslag
|
10
10
|
title: Titel
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Projekt
|
15
|
+
other: projekt
|
11
16
|
decidim:
|
12
17
|
budgets:
|
13
18
|
actions:
|
@@ -99,6 +104,7 @@ sv:
|
|
99
104
|
one: 1 stöd
|
100
105
|
other: "%{count} stöder"
|
101
106
|
remove: Avlägsna
|
107
|
+
view: Se
|
102
108
|
project_budget_button:
|
103
109
|
add: Lägg till
|
104
110
|
added: Tillagd
|
@@ -131,7 +137,7 @@ sv:
|
|
131
137
|
success: Din röst har avbrutits framgångsrikt
|
132
138
|
resource_links:
|
133
139
|
included_proposals:
|
134
|
-
|
140
|
+
project_proposal: 'Förslag som ingår i detta projekt:'
|
135
141
|
index:
|
136
142
|
confirmed_orders_count: Antal röster
|
137
143
|
total_budget: Total budget
|
data/config/locales/uk.yml
CHANGED
@@ -8,6 +8,13 @@ uk:
|
|
8
8
|
description: Опис
|
9
9
|
proposal_ids: Супутні пропозиції
|
10
10
|
title: Назва
|
11
|
+
activerecord:
|
12
|
+
models:
|
13
|
+
decidim/budgets/project:
|
14
|
+
one: Задум
|
15
|
+
few: Задуми
|
16
|
+
many: Задумів
|
17
|
+
other: Задумів
|
11
18
|
decidim:
|
12
19
|
budgets:
|
13
20
|
actions:
|
@@ -105,6 +112,7 @@ uk:
|
|
105
112
|
many: "%{count} людей підтримують"
|
106
113
|
other: "%{count} людей підтримують"
|
107
114
|
remove: Видалити
|
115
|
+
view: Переглянути
|
108
116
|
project_budget_button:
|
109
117
|
add: Додати
|
110
118
|
added: Додано
|
@@ -137,7 +145,7 @@ uk:
|
|
137
145
|
success: Ваш голос було успішно скасовано
|
138
146
|
resource_links:
|
139
147
|
included_proposals:
|
140
|
-
|
148
|
+
project_proposal: 'Пропозиції, включені до цього задуму:'
|
141
149
|
index:
|
142
150
|
confirmed_orders_count: Кількість голосів
|
143
151
|
total_budget: Загальний кошторис
|
@@ -7,6 +7,7 @@ Decidim.register_component(:budgets) do |component|
|
|
7
7
|
component.admin_engine = Decidim::Budgets::AdminEngine
|
8
8
|
component.icon = "decidim/budgets/icon.svg"
|
9
9
|
component.stylesheet = "decidim/budgets/budgets"
|
10
|
+
component.permissions_class_name = "Decidim::Budgets::Permissions"
|
10
11
|
|
11
12
|
component.actions = %(vote)
|
12
13
|
|
@@ -14,9 +15,10 @@ Decidim.register_component(:budgets) do |component|
|
|
14
15
|
raise StandardError, "Can't remove this component" if Decidim::Budgets::Project.where(component: instance).any?
|
15
16
|
end
|
16
17
|
|
17
|
-
component.register_resource do |resource|
|
18
|
+
component.register_resource(:project) do |resource|
|
18
19
|
resource.model_class_name = "Decidim::Budgets::Project"
|
19
20
|
resource.template = "decidim/budgets/projects/linked_projects"
|
21
|
+
resource.card = "decidim/budgets/project"
|
20
22
|
end
|
21
23
|
|
22
24
|
component.register_stat :projects_count, primary: true, priority: Decidim::StatsRegistry::LOW_PRIORITY do |components, start_at, end_at|
|
@@ -26,6 +26,11 @@ module Decidim
|
|
26
26
|
initializer "decidim_budgets.assets" do |app|
|
27
27
|
app.config.assets.precompile += %w(decidim_budgets_manifest.js)
|
28
28
|
end
|
29
|
+
|
30
|
+
initializer "decidim_budgets.add_cells_view_paths" do
|
31
|
+
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Budgets::Engine.root}/app/cells")
|
32
|
+
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Budgets::Engine.root}/app/views") # for partials
|
33
|
+
end
|
29
34
|
end
|
30
35
|
end
|
31
36
|
end
|
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.12.0.pre
|
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-06-
|
13
|
+
date: 2018-06-06 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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
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.12.0.pre
|
113
113
|
description: A budgets component for decidim's participatory spaces.
|
114
114
|
email:
|
115
115
|
- josepjaume@gmail.com
|
@@ -129,6 +129,10 @@ files:
|
|
129
129
|
- app/assets/stylesheets/decidim/budgets/budget/_budget-list.scss
|
130
130
|
- app/assets/stylesheets/decidim/budgets/budget/_budget-meter.scss
|
131
131
|
- app/assets/stylesheets/decidim/budgets/budget/_progress.scss
|
132
|
+
- app/cells/decidim/budgets/project_cell.rb
|
133
|
+
- app/cells/decidim/budgets/project_m/data.erb
|
134
|
+
- app/cells/decidim/budgets/project_m/footer.erb
|
135
|
+
- app/cells/decidim/budgets/project_m_cell.rb
|
132
136
|
- app/commands/decidim/budgets/add_line_item.rb
|
133
137
|
- app/commands/decidim/budgets/admin/create_project.rb
|
134
138
|
- app/commands/decidim/budgets/admin/destroy_project.rb
|
@@ -152,6 +156,8 @@ files:
|
|
152
156
|
- app/models/decidim/budgets/line_item.rb
|
153
157
|
- app/models/decidim/budgets/order.rb
|
154
158
|
- app/models/decidim/budgets/project.rb
|
159
|
+
- app/permissions/decidim/budgets/admin/permissions.rb
|
160
|
+
- app/permissions/decidim/budgets/permissions.rb
|
155
161
|
- app/presenters/decidim/budgets/admin_log/project_presenter.rb
|
156
162
|
- app/queries/decidim/budgets/filtered_projects.rb
|
157
163
|
- app/services/decidim/budgets/project_search.rb
|
@@ -223,9 +229,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
223
229
|
version: '2.3'
|
224
230
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
231
|
requirements:
|
226
|
-
- - "
|
232
|
+
- - ">"
|
227
233
|
- !ruby/object:Gem::Version
|
228
|
-
version:
|
234
|
+
version: 1.3.1
|
229
235
|
requirements: []
|
230
236
|
rubyforge_project:
|
231
237
|
rubygems_version: 2.7.6
|