decidim-budgets 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3e2656e58b1d375c6ed9cc32d4af823549aa19a
4
- data.tar.gz: 1e3664e67a65acce779cf361bbd58dd305929b6d
3
+ metadata.gz: '034088ae5b466ef853b3bf717793131d2a2be14f'
4
+ data.tar.gz: bf4a366848416446c2722cccf40e97770c774138
5
5
  SHA512:
6
- metadata.gz: d096815f3bf0747eea89df09a2a99b196451a826110015fcad984fd8af367b6eb3d80a7d3cbf64f65cb0c2e0768cce5034de72b3c57344293f45ea4007eb7bc2
7
- data.tar.gz: 25da824f93001da298b80ecfaa5103a17d1aeee9a8f2478e383eff5ce0cff34a01d1afef9b5960f6e3023622222414929af0ed9543c1f112b3e62c5c87280bd5
6
+ metadata.gz: c22063bcda419c7c30a4f40984d76eeee36f63fd77dc238c39d66d2bf97c800fc4e7703b88e56d7d95d46de7dd824fffed816212838c7886054eef78580504b0
7
+ data.tar.gz: 228cd378ba5ed440f4f2355f227c63a19d6435a3795d897be6e6282e72729b747d70bb7b04cf6f6dfd16edd15147650e6869f448f4bbcef8b0dff8a902a124e7
@@ -57,7 +57,7 @@ module Decidim
57
57
  private
58
58
 
59
59
  def projects
60
- @projects ||= Project.where(feature: current_feature)
60
+ @projects ||= Project.where(feature: current_feature).page(params[:page]).per(15)
61
61
  end
62
62
 
63
63
  def orders
@@ -11,26 +11,32 @@ module Decidim
11
11
  def create
12
12
  authorize_action! "vote"
13
13
 
14
- AddLineItem.call(current_order, project, current_user) do
15
- on(:ok) do |order|
16
- self.current_order = order
17
- render "update_budget"
18
- end
19
-
20
- on(:invalid) do
21
- render nothing: true, status: 422
14
+ respond_to do |format|
15
+ AddLineItem.call(current_order, project, current_user) do
16
+ on(:ok) do |order|
17
+ self.current_order = order
18
+ format.html { redirect_to :back }
19
+ format.js { render "update_budget" }
20
+ end
21
+
22
+ on(:invalid) do
23
+ render nothing: true, status: 422
24
+ end
22
25
  end
23
26
  end
24
27
  end
25
28
 
26
29
  def destroy
27
- RemoveLineItem.call(current_order, project) do
28
- on(:ok) do |_order|
29
- render "update_budget"
30
- end
31
-
32
- on(:invalid) do
33
- render nothing: true, status: 422
30
+ respond_to do |format|
31
+ RemoveLineItem.call(current_order, project) do
32
+ on(:ok) do |_order|
33
+ format.html { redirect_to :back }
34
+ format.js { render "update_budget" }
35
+ end
36
+
37
+ on(:invalid) do
38
+ render nothing: true, status: 422
39
+ end
34
40
  end
35
41
  end
36
42
  end
@@ -1,29 +1,39 @@
1
- <div class="field" >
2
- <%= form.translated :text_field, :title, autofocus: true %>
3
- </div>
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= title %></h2>
4
+ </div>
4
5
 
5
- <div class="field" >
6
- <%= form.translated :editor, :description %>
7
- </div>
6
+ <div class="card-section">
7
+ <div class="row column" >
8
+ <%= form.translated :text_field, :title, autofocus: true %>
9
+ </div>
8
10
 
9
- <div class="field" >
10
- <%= form.number_field :budget %>
11
- </div>
11
+ <div class="row column" >
12
+ <%= form.translated :editor, :description %>
13
+ </div>
12
14
 
13
- <% if !current_participatory_process.scope %>
14
- <div class="field" >
15
- <%= form.collection_select :decidim_scope_id, organization_scopes, :id, :name %>
16
- </div>
17
- <% end %>
15
+ <div class="row column" >
16
+ <%= form.number_field :budget %>
17
+ </div>
18
18
 
19
- <div class="field" >
20
- <%= form.categories_select :decidim_category_id, current_participatory_process.categories, include_blank: true, disable_parents: false %>
21
- </div>
19
+ <% if !current_participatory_process.scope %>
20
+ <div class="row column" >
21
+ <%= form.collection_select :decidim_scope_id, organization_scopes, :id, :name %>
22
+ </div>
23
+ <% end %>
22
24
 
23
- <% if @form.proposals %>
24
- <%= form.select :proposal_ids,
25
- @form.proposals,
26
- {},
27
- { multiple: true, class: "chosen-select" }
28
- %>
29
- <% end %>
25
+ <div class="row column" >
26
+ <%= form.categories_select :decidim_category_id, current_participatory_process.categories, include_blank: true, disable_parents: false %>
27
+ </div>
28
+
29
+ <div class="row column">
30
+ <% if @form.proposals %>
31
+ <%= form.select :proposal_ids,
32
+ @form.proposals,
33
+ {},
34
+ { multiple: true, class: "chosen-select" }
35
+ %>
36
+ <% end %>
37
+ </div>
38
+ </div>
39
+ </div>
@@ -1,9 +1,7 @@
1
- <h3><%= t ".title" %></h3>
1
+ <%= decidim_form_for(@form, html: { class: "form edit_project" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
2
3
 
3
- <%= decidim_form_for(@form) do |f| %>
4
- <%= render partial: 'form', object: f %>
5
-
6
- <div class="actions">
4
+ <div class="button--double form-general-submit">
7
5
  <%= f.submit t(".update") %>
8
6
  </div>
9
7
  <% end %>
@@ -1,37 +1,55 @@
1
- <h2><%= t(".title") %></h2>
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title">
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 can? :manage, current_feature %>
6
+ </h2>
7
+ </div>
2
8
 
3
- <dl>
4
- <dt><%= t ".finished_orders" %>: </dt><dd><%= finished_orders.count %></dd>
5
- <dt><%= t ".pending_orders" %>: </dt><dd><%= pending_orders.count %></dd>
6
- </dl>
9
+ <div class="card-section">
10
+ <div class="table-scroll">
11
+ <table class="table-list">
12
+ <thead>
13
+ <tr>
14
+ <th><%= t("models.project.fields.title", scope: "decidim.budgets") %></th>
15
+ <th class="center"><%= t("index.confirmed_orders_count") %></th>
16
+ <th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <% projects.each do |project| %>
21
+ <tr data-id="<%= project.id %>">
22
+ <td>
23
+ <%= translated_attribute(project.title) %><br />
24
+ </td>
25
+ <td class='center'>
26
+ <%= project.confirmed_orders_count %>
27
+ </td>
28
+ <td class="table-list__actions">
29
+ <%= icon_link_to "eye", decidim_budgets.project_path(id: project, feature_id: current_feature, participatory_process_id: current_participatory_process), t("actions.preview", scope: "decidim.budgets"), target: :blank, class: "action-icon--preview" %>
7
30
 
8
- <div class="actions title">
9
- <%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_project_path, class: 'new' if can? :manage, current_feature %>
10
- </div>
31
+ <% if can? :update, current_feature %>
32
+ <%= icon_link_to "pencil", edit_project_path(project), t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
33
+ <% end %>
34
+
35
+ <% if can? :update, current_feature %>
36
+ <%= icon_link_to "paperclip", project_attachments_path(project), t("actions.attachments", scope: "decidim.budgets"), class: "action-icon--attachments" %>
37
+ <% end %>
11
38
 
12
- <table class="stack">
13
- <thead>
14
- <tr>
15
- <th><%= t("models.project.fields.title", scope: "decidim.budgets") %></th>
16
- <th class="center"><%= t("index.confirmed_orders_count") %></th>
17
- <th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
18
- </tr>
19
- </thead>
20
- <tbody>
21
- <% projects.each do |project| %>
22
- <tr data-id="<%= project.id %>">
23
- <td>
24
- <%= link_to translated_attribute(project.title), decidim_budgets.project_path(id: project, feature_id: current_feature, participatory_process_id: current_participatory_process), target: :blank %><br />
25
- </td>
26
- <td class='center'>
27
- <%= project.confirmed_orders_count %>
28
- </td>
29
- <td class="actions">
30
- <%= link_to t("actions.edit", scope: "decidim.budgets"), edit_project_path(project) if can? :update, current_feature %>
31
- <%= link_to t("actions.attachments", scope: "decidim.budgets"), project_attachments_path(project) if can? :update, current_feature %>
32
- <%= link_to t("actions.destroy", scope: "decidim.budgets"), project_path(project), method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } if can? :destroy, current_feature %>
33
- </td>
34
- </tr>
35
- <% end %>
36
- </tbody>
37
- </table>
39
+ <% if can? :destroy, current_feature %>
40
+ <%= 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") } %>
41
+ <% end %>
42
+ </td>
43
+ </tr>
44
+ <% end %>
45
+ </tbody>
46
+ </table>
47
+ <%= paginate projects, theme: "decidim" %>
48
+ </div>
49
+ </div>
50
+ <div class="card-divider">
51
+ <strong><%= t ".finished_orders" %>: </strong><span><%= finished_orders.count %></span>
52
+ <span>|</span>
53
+ <strong><%= t ".pending_orders" %>: </strong><span><%= pending_orders.count %></span>
54
+ </div>
55
+ </div>
@@ -1,9 +1,8 @@
1
- <h3><%= t ".title" %></h3>
1
+ <%= decidim_form_for(@form, html: { class: "form new_project" }) do |f| %>
2
+ <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
2
3
 
3
- <%= decidim_form_for(@form) do |f| %>
4
- <%= render partial: 'form', object: f %>
5
-
6
- <div class="actions">
4
+ <div class="button--double form-general-submit">
7
5
  <%= f.submit t(".create") %>
8
6
  </div>
9
7
  <% end %>
8
+
@@ -17,7 +17,7 @@
17
17
  <% end %>
18
18
 
19
19
  <% if current_feature.categories.any? %>
20
- <%= form.categories_select :category_id, current_feature.categories, legend_title: t('.category'), disable_parents: false, label: false, include_blank: true %>
20
+ <%= form.categories_select :category_id, current_feature.categories, legend_title: t('.category'), disable_parents: false, label: false, prompt: t('.category_prompt') %>
21
21
  <% end %>
22
22
 
23
23
  <%= form.hidden_field :random_seed %>
@@ -5,3 +5,4 @@ ignore_unused:
5
5
  - "decidim.features.budgets.settings.*"
6
6
  - "decidim.features.budgets.actions.*"
7
7
  - "activemodel.attributes.project.*"
8
+ - "decidim.resource_links.*"
@@ -16,6 +16,7 @@ ca:
16
16
  destroy: Esborrar
17
17
  edit: Editar
18
18
  new: Nou %{name}
19
+ preview: Previsualitzar
19
20
  title: Accions
20
21
  admin:
21
22
  models:
@@ -71,6 +72,7 @@ ca:
71
72
  other: "%{count} projectes"
72
73
  filters:
73
74
  category: Categoria
75
+ category_prompt: Selecciona una categoria
74
76
  scopes: Àmbits
75
77
  search: Cerca
76
78
  filters_small_view:
@@ -118,6 +120,9 @@ ca:
118
120
  destroy:
119
121
  error: S'ha produït un error en cancel·lar el seu vot
120
122
  success: El seu vot ha estat cancel·lat correctament
123
+ resource_links:
124
+ included_proposals:
125
+ project_proposals: 'Propostes incloses en aquest projecte:'
121
126
  index:
122
127
  confirmed_orders_count: Nombre de vots
123
128
  total_budget: Pressupost total
@@ -17,6 +17,7 @@ en:
17
17
  destroy: Delete
18
18
  edit: Edit
19
19
  new: New %{name}
20
+ preview: Preview
20
21
  title: Actions
21
22
  admin:
22
23
  models:
@@ -78,6 +79,7 @@ en:
78
79
  other: "%{count} projects"
79
80
  filters:
80
81
  category: Category
82
+ category_prompt: Select a category
81
83
  scopes: Scopes
82
84
  search: Search
83
85
  filters_small_view:
@@ -125,6 +127,9 @@ en:
125
127
  destroy:
126
128
  error: An error ocurred while canceling your vote
127
129
  success: Your vote has been canceled successfully
130
+ resource_links:
131
+ included_proposals:
132
+ project_proposals: 'Proposals included in this project:'
128
133
  index:
129
134
  confirmed_orders_count: Orders count
130
135
  total_budget: Total budget
@@ -16,6 +16,7 @@ es:
16
16
  destroy: Borrar
17
17
  edit: Editar
18
18
  new: Nuevo %{name}
19
+ preview: Previsualizar
19
20
  title: Acciones
20
21
  admin:
21
22
  models:
@@ -71,6 +72,7 @@ es:
71
72
  other: "%{count} proyectos"
72
73
  filters:
73
74
  category: Categoría
75
+ category_prompt: Selecciona una categoría
74
76
  scopes: Ámbitos
75
77
  search: Buscar
76
78
  filters_small_view:
@@ -118,6 +120,9 @@ es:
118
120
  destroy:
119
121
  error: Ha habido un error al cancelar tu voto
120
122
  success: Tu voto ha sido cancelado correctamente
123
+ resource_links:
124
+ included_proposals:
125
+ project_proposals: 'Propuestas incluidas en este proyecto:'
121
126
  index:
122
127
  confirmed_orders_count: Número de votos
123
128
  total_budget: Presupuesto total
@@ -16,6 +16,7 @@ eu:
16
16
  destroy: Garbitu
17
17
  edit: Editatu
18
18
  new: '%{name} berria'
19
+ preview: Aurreikusi
19
20
  title: Ekintzak
20
21
  admin:
21
22
  models:
@@ -31,6 +32,8 @@ eu:
31
32
  title: Editatu proiektua
32
33
  update: Eguneratu proiektua
33
34
  index:
35
+ finished_orders: Emandako botoak
36
+ pending_orders: Emateke dauden botoak
34
37
  title: Proiektuak
35
38
  new:
36
39
  create: Sortu proiektua
@@ -57,7 +60,9 @@ eu:
57
60
  budget_summary:
58
61
  are_you_sure: Ziur zaude zure botoa ezeztatu nahi duzula?
59
62
  assigned: 'Esleituta:'
63
+ cancel_order: ezabatu ezazu botoa eta hasi berriro
60
64
  checked_out:
65
+ description: 'Jada bozkatu duzu aurrekonturako. Iritziz aldatu baduzu, ezeztatu hemen: %{cancel_link}.'
61
66
  title: Botoa zuzen bidali da
62
67
  description: Zure aburuz, proiektuetako zeinei esleitu behar diegu aurrekontua? Gutxienez, %{minimum_budget} esleitu nahi dituzun proiektuei, eta bozkatu aurrekontua zehazteko.
63
68
  title: Zure esku dago aurrekontua erabakitzea
@@ -67,10 +72,14 @@ eu:
67
72
  other: "%{count} proiektu"
68
73
  filters:
69
74
  category: Kategoria
75
+ category_prompt: Aukeratu kategoria bat
70
76
  scopes: Esparruak
71
77
  search: Bilatu
72
78
  filters_small_view:
79
+ close_modal: Itxi leihoa
80
+ filter: Iragazi
73
81
  filter_by: 'Iragazi honen arabera:'
82
+ unfold: Zabaldu
74
83
  order_progress:
75
84
  vote: Bozkatu
76
85
  order_selected_projects:
@@ -81,6 +90,9 @@ eu:
81
90
  view: Ikusi
82
91
  project:
83
92
  add: Gehitu
93
+ count:
94
+ one: 1 sostengu 
95
+ other: "%{count} sostengu"
84
96
  remove: Kendu
85
97
  project_budget_button:
86
98
  add: Gehitu
@@ -90,7 +102,17 @@ eu:
90
102
  view_all_projects: Ikusi proiektu guztiak
91
103
  features:
92
104
  budgets:
105
+ actions:
106
+ vote: Proiektuaren alde egin
93
107
  name: Aurrekontuak
108
+ settings:
109
+ global:
110
+ comments_enabled: Iruzkinak gaituta
111
+ total_budget: Guztizko aurrekontua
112
+ vote_threshold_percent: Aurrekontuaren gutxieneko ehunekoa
113
+ step:
114
+ comments_blocked: Iruzkinak blokeatuta
115
+ votes_enabled: Botoak gaituta
94
116
  orders:
95
117
  checkout:
96
118
  error: Errorea gertatu da zure botoa prozesatzean
@@ -98,4 +120,9 @@ eu:
98
120
  destroy:
99
121
  error: Errorea gertatu da zure botoa ezeztatzean
100
122
  success: Zure botua zuzen ezeztatu da
123
+ resource_links:
124
+ included_proposals:
125
+ project_proposals: 'Proiektu honetan jasotako proposamenak:'
126
+ index:
127
+ confirmed_orders_count: Boto-kopurua
101
128
  total_budget: Guztizko aurrekontua
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.0.6
4
+ version: 0.0.7
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-03-24 00:00:00.000000000 Z
13
+ date: 2017-04-07 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.0.6
21
+ version: 0.0.7
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.0.6
28
+ version: 0.0.7
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.0.6
35
+ version: 0.0.7
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.0.6
42
+ version: 0.0.7
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.0.6
91
+ version: 0.0.7
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.0.6
98
+ version: 0.0.7
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.0.6
105
+ version: 0.0.7
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.0.6
112
+ version: 0.0.7
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.0.6
119
+ version: 0.0.7
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.0.6
126
+ version: 0.0.7
127
127
  description: ''
128
128
  email:
129
129
  - josepjaume@gmail.com
@@ -226,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
226
  version: '0'
227
227
  requirements: []
228
228
  rubyforge_project:
229
- rubygems_version: 2.6.8
229
+ rubygems_version: 2.6.11
230
230
  signing_key:
231
231
  specification_version: 4
232
232
  summary: A budgets component for decidim's participatory processes.