decidim-proposals 0.8.2 → 0.8.3

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: 5e7947f5c96f19588e2e9497f0c079c4ab22f1ff
4
- data.tar.gz: fdd3a7ea85ef071af50a187f91dfba24c7c4c4bb
3
+ metadata.gz: c0b1b113a3fd0f94a8ef20a7ae92fd5a882fbe65
4
+ data.tar.gz: 81a31b60dbb6b5ef645ef884d8b17537dbe6edff
5
5
  SHA512:
6
- metadata.gz: ef4978659dd148c342a4593d10d153c7151db8d9cb47ff7fb1b936a5453a4f66dff630de71e347fa60ba9c6c4f3126d9243ed91de7772013346ba25f0881d9d2
7
- data.tar.gz: b023d5b86915eed6f629d14932bc54c2e2b6daa3d9b808ecba4db710c0cf1c55b4f618605a7e893ab2a74f827272a6d81e6ce27b3aced9543aef8c0176894ba6
6
+ metadata.gz: 536f83095345a16347b65a473021efeb93ee01950277ac5fd56863e21eb8e2df3e3a0ab6fa703e3d119e17e51bed1085aad737fd2d89fea4455ee93803b84c6b
7
+ data.tar.gz: b2335bb4c80d5bd4c23f3b8a15339a1f18efaff56846ee4330d889aa0d442c3373809a4ea1925d670a0cd59c1d5eff3f167839582139c3b681950aeace2d7da1
@@ -26,14 +26,8 @@ module Decidim
26
26
  return broadcast(:invalid) unless proposal.editable_by?(current_user)
27
27
  return broadcast(:invalid) if proposal_limit_reached?
28
28
 
29
- if process_attachments?
30
- build_attachment
31
- return broadcast(:invalid) if attachment_invalid?
32
- end
33
-
34
29
  transaction do
35
30
  update_proposal
36
- create_attachment if process_attachments?
37
31
  end
38
32
 
39
33
  broadcast(:ok, proposal)
@@ -41,7 +35,7 @@ module Decidim
41
35
 
42
36
  private
43
37
 
44
- attr_reader :form, :proposal, :attachment, :current_user
38
+ attr_reader :form, :proposal, :current_user
45
39
 
46
40
  def update_proposal
47
41
  @proposal.update_attributes!(
@@ -57,38 +51,6 @@ module Decidim
57
51
  )
58
52
  end
59
53
 
60
- def build_attachment
61
- @attachment = Attachment.new(
62
- title: form.attachment.title,
63
- file: form.attachment.file,
64
- attached_to: proposal
65
- )
66
- end
67
-
68
- def attachment_invalid?
69
- if attachment.invalid? && attachment.errors.has_key?(:file)
70
- form.attachment.errors.add :file, attachment.errors[:file]
71
- true
72
- end
73
- end
74
-
75
- def attachment_present?
76
- form.attachment.file.present?
77
- end
78
-
79
- def create_attachment
80
- attachment.attached_to = proposal
81
- attachment.save!
82
- end
83
-
84
- def attachments_allowed?
85
- form.current_feature.settings.attachments_allowed?
86
- end
87
-
88
- def process_attachments?
89
- attachments_allowed? && attachment_present?
90
- end
91
-
92
54
  def proposal_limit_reached?
93
55
  proposal_limit = form.current_feature.settings.proposal_limit
94
56
 
@@ -50,21 +50,6 @@
50
50
  </div>
51
51
  <% end %>
52
52
 
53
- <% if feature_settings.attachments_allowed? %>
54
- <fieldset>
55
- <legend><%= t('.attachment_legend') %></legend>
56
- <%= form.fields_for :attachment, @form.attachment do |form| %>
57
- <div class="field">
58
- <%= form.text_field :title %>
59
- </div>
60
-
61
- <div class="field">
62
- <%= form.upload :file, optional: false %>
63
- </div>
64
- <% end %>
65
- </fieldset>
66
- <% end %>
67
-
68
53
  <div class="actions">
69
54
  <%= form.submit t(".send"), class: "button expanded", "data-disable-with" => "#{t('.send')}..." %>
70
55
  </div>
@@ -106,7 +106,6 @@ ca:
106
106
  one: 1 proposta
107
107
  other: "%{count} propostes"
108
108
  edit:
109
- attachment_legend: "(Opcional) Afegir un fitxer adjunt"
110
109
  back: Enrere
111
110
  select_a_category: Si us plau, selecciona una categoria
112
111
  send: Enviar
@@ -106,7 +106,6 @@ en:
106
106
  one: 1 proposal
107
107
  other: "%{count} proposals"
108
108
  edit:
109
- attachment_legend: "(Optional) Add an attachment"
110
109
  back: Back
111
110
  select_a_category: Please select a category
112
111
  send: Send
@@ -106,7 +106,6 @@ es:
106
106
  one: 1 propuesta
107
107
  other: "%{count} propuestas"
108
108
  edit:
109
- attachment_legend: "(Opcional) Añadir un archivo adjunto"
110
109
  back: Atrás
111
110
  select_a_category: Por favor, seleccione una categoría
112
111
  send: Enviar
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-proposals version.
5
5
  module Proposals
6
6
  def self.version
7
- "0.8.2"
7
+ "0.8.3"
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.8.2
4
+ version: 0.8.3
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-12-12 00:00:00.000000000 Z
13
+ date: 2017-12-15 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.8.2
21
+ version: 0.8.3
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.8.2
28
+ version: 0.8.3
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.8.2
35
+ version: 0.8.3
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.8.2
42
+ version: 0.8.3
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: kaminari
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -74,84 +74,84 @@ dependencies:
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.8.2
77
+ version: 0.8.3
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.8.2
84
+ version: 0.8.3
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-assemblies
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.8.2
91
+ version: 0.8.3
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.8.2
98
+ version: 0.8.3
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-budgets
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.8.2
105
+ version: 0.8.3
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.8.2
112
+ version: 0.8.3
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: decidim-dev
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - '='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.8.2
119
+ version: 0.8.3
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.8.2
126
+ version: 0.8.3
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: decidim-meetings
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - '='
132
132
  - !ruby/object:Gem::Version
133
- version: 0.8.2
133
+ version: 0.8.3
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.8.2
140
+ version: 0.8.3
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: decidim-participatory_processes
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - '='
146
146
  - !ruby/object:Gem::Version
147
- version: 0.8.2
147
+ version: 0.8.3
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.8.2
154
+ version: 0.8.3
155
155
  description: A proposals component for decidim's participatory processes.
156
156
  email:
157
157
  - josepjaume@gmail.com