decidim-admin 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/decidim/admin/application.js.es6 +3 -2
- data/app/assets/javascripts/decidim/admin/tab_focus.js.es6 +1 -1
- data/app/assets/stylesheets/decidim/admin/_foundation_and_overrides.scss +1 -1
- data/app/commands/decidim/admin/{create_participatory_process_attachment.rb → create_attachment.rb} +6 -7
- data/app/commands/decidim/admin/create_participatory_process.rb +12 -3
- data/app/commands/decidim/admin/{update_participatory_process_attachment.rb → update_attachment.rb} +7 -6
- data/app/commands/decidim/admin/update_feature.rb +2 -1
- data/app/commands/decidim/admin/update_organization.rb +1 -0
- data/app/commands/decidim/admin/update_participatory_process.rb +16 -4
- data/app/constraints/decidim/admin/organization_dashboard_constraint.rb +1 -1
- data/app/controllers/decidim/admin/application_controller.rb +2 -2
- data/app/controllers/decidim/admin/concerns/has_attachments.rb +116 -0
- data/app/controllers/decidim/admin/participatory_process_attachments_controller.rb +5 -67
- data/app/controllers/decidim/admin/users_controller.rb +5 -5
- data/app/forms/decidim/admin/{participatory_process_attachment_form.rb → attachment_form.rb} +2 -2
- data/app/forms/decidim/admin/feature_form.rb +1 -0
- data/app/forms/decidim/admin/organization_form.rb +1 -0
- data/app/forms/decidim/admin/participatory_process_form.rb +8 -1
- data/app/helpers/decidim/admin/application_helper.rb +1 -0
- data/app/helpers/decidim/admin/feature_settings_helper.rb +29 -0
- data/app/models/decidim/admin/abilities/admin_user.rb +4 -4
- data/app/models/decidim/admin/abilities/base.rb +3 -3
- data/app/models/decidim/admin/abilities/participatory_process_admin.rb +15 -7
- data/app/views/decidim/admin/{participatory_process_attachments → attachments}/_form.html.erb +0 -0
- data/app/views/decidim/admin/attachments/edit.html.erb +9 -0
- data/app/views/decidim/admin/attachments/index.html.erb +37 -0
- data/app/views/decidim/admin/attachments/new.html.erb +9 -0
- data/app/views/decidim/admin/attachments/show.html.erb +25 -0
- data/app/views/decidim/admin/features/_form.html.erb +1 -0
- data/app/views/decidim/admin/features/_settings_fields.html.erb +6 -3
- data/app/views/decidim/admin/organization/_form.html.erb +4 -0
- data/app/views/decidim/admin/participatory_processes/_form.html.erb +16 -0
- data/app/views/decidim/admin/participatory_processes/show.html.erb +11 -1
- data/app/views/layouts/decidim/admin/_header.html.erb +2 -2
- data/app/views/layouts/decidim/admin/_sidebar.html.erb +1 -1
- data/app/views/layouts/decidim/admin/participatory_process.html.erb +2 -2
- data/config/locales/ca.yml +29 -27
- data/config/locales/en.yml +29 -27
- data/config/locales/es.yml +29 -27
- data/config/routes.rb +1 -1
- data/db/migrate/20170128112958_change_user_groups_verified_to_timestamp.rb +9 -0
- data/lib/decidim/admin/engine.rb +2 -2
- data/lib/decidim/admin/test/manage_attachments_examples.rb +103 -0
- metadata +18 -35
- data/app/helpers/decidim/admin/aria_selected_link_to_helper.rb +0 -28
- data/app/views/decidim/admin/participatory_process_attachments/edit.html.erb +0 -9
- data/app/views/decidim/admin/participatory_process_attachments/index.html.erb +0 -37
- data/app/views/decidim/admin/participatory_process_attachments/new.html.erb +0 -9
- data/app/views/decidim/admin/participatory_process_attachments/show.html.erb +0 -25
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.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-01
|
13
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: decidim-core
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.0.
|
21
|
+
version: 0.0.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.0.
|
28
|
+
version: 0.0.3
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rails
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,26 +130,6 @@ dependencies:
|
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: 4.2.2
|
133
|
-
- !ruby/object:Gem::Dependency
|
134
|
-
name: turbolinks
|
135
|
-
requirement: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - "~>"
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: 5.0.0
|
140
|
-
- - ">="
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: 5.0.0.1
|
143
|
-
type: :runtime
|
144
|
-
prerelease: false
|
145
|
-
version_requirements: !ruby/object:Gem::Requirement
|
146
|
-
requirements:
|
147
|
-
- - "~>"
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: 5.0.0
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 5.0.0.1
|
153
133
|
- !ruby/object:Gem::Dependency
|
154
134
|
name: foundation_rails_helper
|
155
135
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,14 +192,14 @@ dependencies:
|
|
212
192
|
requirements:
|
213
193
|
- - '='
|
214
194
|
- !ruby/object:Gem::Version
|
215
|
-
version: 0.0.
|
195
|
+
version: 0.0.3
|
216
196
|
type: :development
|
217
197
|
prerelease: false
|
218
198
|
version_requirements: !ruby/object:Gem::Requirement
|
219
199
|
requirements:
|
220
200
|
- - '='
|
221
201
|
- !ruby/object:Gem::Version
|
222
|
-
version: 0.0.
|
202
|
+
version: 0.0.3
|
223
203
|
description: Organization administration to manage a single organization.
|
224
204
|
email:
|
225
205
|
- josepjaume@gmail.com
|
@@ -246,11 +226,11 @@ files:
|
|
246
226
|
- app/assets/stylesheets/decidim/admin/_tables.scss
|
247
227
|
- app/assets/stylesheets/decidim/admin/application.scss
|
248
228
|
- app/commands/decidim/admin/activate_participatory_process_step.rb
|
229
|
+
- app/commands/decidim/admin/create_attachment.rb
|
249
230
|
- app/commands/decidim/admin/create_category.rb
|
250
231
|
- app/commands/decidim/admin/create_feature.rb
|
251
232
|
- app/commands/decidim/admin/create_participatory_process.rb
|
252
233
|
- app/commands/decidim/admin/create_participatory_process_admin.rb
|
253
|
-
- app/commands/decidim/admin/create_participatory_process_attachment.rb
|
254
234
|
- app/commands/decidim/admin/create_participatory_process_step.rb
|
255
235
|
- app/commands/decidim/admin/create_scope.rb
|
256
236
|
- app/commands/decidim/admin/create_static_page.rb
|
@@ -261,17 +241,18 @@ files:
|
|
261
241
|
- app/commands/decidim/admin/publish_participatory_process.rb
|
262
242
|
- app/commands/decidim/admin/reorder_participatory_process_steps.rb
|
263
243
|
- app/commands/decidim/admin/unpublish_participatory_process.rb
|
244
|
+
- app/commands/decidim/admin/update_attachment.rb
|
264
245
|
- app/commands/decidim/admin/update_category.rb
|
265
246
|
- app/commands/decidim/admin/update_feature.rb
|
266
247
|
- app/commands/decidim/admin/update_organization.rb
|
267
248
|
- app/commands/decidim/admin/update_participatory_process.rb
|
268
|
-
- app/commands/decidim/admin/update_participatory_process_attachment.rb
|
269
249
|
- app/commands/decidim/admin/update_participatory_process_step.rb
|
270
250
|
- app/commands/decidim/admin/update_scope.rb
|
271
251
|
- app/commands/decidim/admin/update_static_page.rb
|
272
252
|
- app/constraints/decidim/admin/organization_dashboard_constraint.rb
|
273
253
|
- app/controllers/decidim/admin/application_controller.rb
|
274
254
|
- app/controllers/decidim/admin/categories_controller.rb
|
255
|
+
- app/controllers/decidim/admin/concerns/has_attachments.rb
|
275
256
|
- app/controllers/decidim/admin/concerns/participatory_process_admin.rb
|
276
257
|
- app/controllers/decidim/admin/dashboard_controller.rb
|
277
258
|
- app/controllers/decidim/admin/features_controller.rb
|
@@ -287,18 +268,18 @@ files:
|
|
287
268
|
- app/controllers/decidim/admin/static_pages_controller.rb
|
288
269
|
- app/controllers/decidim/admin/user_groups_controller.rb
|
289
270
|
- app/controllers/decidim/admin/users_controller.rb
|
271
|
+
- app/forms/decidim/admin/attachment_form.rb
|
290
272
|
- app/forms/decidim/admin/category_form.rb
|
291
273
|
- app/forms/decidim/admin/feature_form.rb
|
292
274
|
- app/forms/decidim/admin/organization_form.rb
|
293
|
-
- app/forms/decidim/admin/participatory_process_attachment_form.rb
|
294
275
|
- app/forms/decidim/admin/participatory_process_form.rb
|
295
276
|
- app/forms/decidim/admin/participatory_process_step_form.rb
|
296
277
|
- app/forms/decidim/admin/participatory_process_user_role_form.rb
|
297
278
|
- app/forms/decidim/admin/scope_form.rb
|
298
279
|
- app/forms/decidim/admin/static_page_form.rb
|
299
280
|
- app/helpers/decidim/admin/application_helper.rb
|
300
|
-
- app/helpers/decidim/admin/aria_selected_link_to_helper.rb
|
301
281
|
- app/helpers/decidim/admin/attributes_display_helper.rb
|
282
|
+
- app/helpers/decidim/admin/feature_settings_helper.rb
|
302
283
|
- app/jobs/decidim/admin/application_job.rb
|
303
284
|
- app/mailers/decidim/admin/application_mailer.rb
|
304
285
|
- app/models/decidim/admin/abilities/admin_user.rb
|
@@ -308,6 +289,11 @@ files:
|
|
308
289
|
- app/models/decidim/admin/participatory_process_user_role.rb
|
309
290
|
- app/queries/decidim/admin/manageable_participatory_processes_for_user.rb
|
310
291
|
- app/queries/decidim/admin/process_admin_roles_for_process.rb
|
292
|
+
- app/views/decidim/admin/attachments/_form.html.erb
|
293
|
+
- app/views/decidim/admin/attachments/edit.html.erb
|
294
|
+
- app/views/decidim/admin/attachments/index.html.erb
|
295
|
+
- app/views/decidim/admin/attachments/new.html.erb
|
296
|
+
- app/views/decidim/admin/attachments/show.html.erb
|
311
297
|
- app/views/decidim/admin/categories/_form.html.erb
|
312
298
|
- app/views/decidim/admin/categories/edit.html.erb
|
313
299
|
- app/views/decidim/admin/categories/index.html.erb
|
@@ -324,11 +310,6 @@ files:
|
|
324
310
|
- app/views/decidim/admin/features/new.html.erb
|
325
311
|
- app/views/decidim/admin/organization/_form.html.erb
|
326
312
|
- app/views/decidim/admin/organization/edit.html.erb
|
327
|
-
- app/views/decidim/admin/participatory_process_attachments/_form.html.erb
|
328
|
-
- app/views/decidim/admin/participatory_process_attachments/edit.html.erb
|
329
|
-
- app/views/decidim/admin/participatory_process_attachments/index.html.erb
|
330
|
-
- app/views/decidim/admin/participatory_process_attachments/new.html.erb
|
331
|
-
- app/views/decidim/admin/participatory_process_attachments/show.html.erb
|
332
313
|
- app/views/decidim/admin/participatory_process_steps/_form.html.erb
|
333
314
|
- app/views/decidim/admin/participatory_process_steps/edit.html.erb
|
334
315
|
- app/views/decidim/admin/participatory_process_steps/index.html.erb
|
@@ -366,12 +347,14 @@ files:
|
|
366
347
|
- config/locales/es.yml
|
367
348
|
- config/routes.rb
|
368
349
|
- db/migrate/20161102144648_add_admin_participatory_process_user_roles.rb
|
350
|
+
- db/migrate/20170128112958_change_user_groups_verified_to_timestamp.rb
|
369
351
|
- db/seeds.rb
|
370
352
|
- lib/decidim/admin.rb
|
371
353
|
- lib/decidim/admin/engine.rb
|
372
354
|
- lib/decidim/admin/features.rb
|
373
355
|
- lib/decidim/admin/features/base_controller.rb
|
374
356
|
- lib/decidim/admin/test/factories.rb
|
357
|
+
- lib/decidim/admin/test/manage_attachments_examples.rb
|
375
358
|
- lib/tasks/decidim/admin_tasks.rake
|
376
359
|
- vendor/assets/javascripts/html.sortable.js
|
377
360
|
homepage: https://github.com/AjuntamentdeBarcelona/decidim
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module Decidim
|
3
|
-
module Admin
|
4
|
-
# Module to add the attribute `aria-selected` to links when they are
|
5
|
-
# pointing to the current path. Uses the `active_link_to` gem to calculate
|
6
|
-
# this.
|
7
|
-
#
|
8
|
-
module AriaSelectedLinkToHelper
|
9
|
-
# Adds the `aria-selected` attribute to a link when it's pointing to the
|
10
|
-
# current path. The API is the same than the `link_to` one, and uses this
|
11
|
-
# helper internally.
|
12
|
-
#
|
13
|
-
# text - a String with the link text
|
14
|
-
# link - Where the link should point to. Accepts the same value than
|
15
|
-
# `link_to` helper.
|
16
|
-
# options - An options Hash that will be passed to `link_to`.
|
17
|
-
def aria_selected_link_to(text, link, options = {})
|
18
|
-
link_to(
|
19
|
-
text,
|
20
|
-
link,
|
21
|
-
options.merge(
|
22
|
-
"aria-selected": is_active_link?(link, options[:aria_link_type] || :inclusive)
|
23
|
-
)
|
24
|
-
)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<h3><%= t ".title" %></h3>
|
2
|
-
|
3
|
-
<%= form_for(@form, url: participatory_process_attachment_path(@participatory_process_attachment.participatory_process, @participatory_process_attachment)) do |f| %>
|
4
|
-
<%= render partial: 'form', object: f %>
|
5
|
-
|
6
|
-
<div class="actions">
|
7
|
-
<%= f.submit t(".update") %>
|
8
|
-
</div>
|
9
|
-
<% end %>
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<section id="attachments">
|
2
|
-
<h4><%= t(".attachments_title", scope: "decidim.admin") %></h4>
|
3
|
-
|
4
|
-
<% if can? :create, Decidim::ParticipatoryProcessAttachment %>
|
5
|
-
<div class="actions title">
|
6
|
-
<%= link_to t("actions.new", scope: "decidim.admin", name: t("models.participatory_process_attachment.name", scope: "decidim.admin")), new_participatory_process_attachment_path(participatory_process), class: 'new' %>
|
7
|
-
</div>
|
8
|
-
<% end %>
|
9
|
-
|
10
|
-
<% if participatory_process.attachments.any? %>
|
11
|
-
<table class="stack">
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th><%= t("models.participatory_process_attachment.fields.title", scope: "decidim.admin") %></th>
|
15
|
-
<th><%= t("models.participatory_process_attachment.fields.content_type", scope: "decidim.admin") %></th>
|
16
|
-
<th class="actions"><%= t("actions.title", scope: "decidim.admin") %></th>
|
17
|
-
</tr>
|
18
|
-
</thead>
|
19
|
-
<tbody>
|
20
|
-
<% participatory_process.attachments.each do |attachment| %>
|
21
|
-
<tr data-id="<%= attachment.id %>">
|
22
|
-
<td>
|
23
|
-
<%= link_to translated_attribute(attachment.title), participatory_process_attachment_path(participatory_process, attachment) %><br />
|
24
|
-
</td>
|
25
|
-
<td>
|
26
|
-
<%= attachment.file_type %>
|
27
|
-
</td>
|
28
|
-
<td class="actions">
|
29
|
-
<%= link_to t("actions.edit", scope: "decidim.admin"), edit_participatory_process_attachment_path(participatory_process, attachment) if can? :update, attachment %>
|
30
|
-
<%= link_to t("actions.destroy", scope: "decidim.admin"), participatory_process_attachment_path(participatory_process, attachment), method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } if can? :destroy, attachment %>
|
31
|
-
</td>
|
32
|
-
</tr>
|
33
|
-
<% end %>
|
34
|
-
</tbody>
|
35
|
-
</table>
|
36
|
-
<% end %>
|
37
|
-
</section>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<h3><%= translated_attribute(@participatory_process_attachment.title) %></h3>
|
2
|
-
|
3
|
-
<div class="actions">
|
4
|
-
<hr />
|
5
|
-
<%= link_to t("decidim.admin.actions.edit"), ['edit', @participatory_process_attachment] if can? :update, @participatory_process_attachment %>
|
6
|
-
<%= link_to t("decidim.admin.actions.destroy"), @participatory_process_attachment, method: :delete, class: "alert button", data: { confirm: t("decidim.admin.actions.confirm_destroy") } if can? :destroy, @participatory_process_attachment %>
|
7
|
-
</div>
|
8
|
-
|
9
|
-
<dl>
|
10
|
-
<%= display_for @participatory_process_attachment,
|
11
|
-
:title,
|
12
|
-
:description,
|
13
|
-
:file_type
|
14
|
-
%>
|
15
|
-
<dt><%= display_label(@participatory_process_attachment, :file_size) %></dt>
|
16
|
-
<dd><%= number_to_human_size(@participatory_process_attachment.file_size) %></dd>
|
17
|
-
<dt><%= display_label(@participatory_process_attachment, :file) %></dt>
|
18
|
-
<% if @participatory_process_attachment.photo? %>
|
19
|
-
<%= link_to @participatory_process_attachment.big_url do %>
|
20
|
-
<%= image_tag @participatory_process_attachment.thumbnail_url, class:"thumbnail", alt: strip_tags(translated_attribute(@participatory_process_attachment.description)) %>
|
21
|
-
<% end %>
|
22
|
-
<% else %>
|
23
|
-
<%= link_to @participatory_process_attachment.url, @participatory_process_attachment.file.original_file_name %>
|
24
|
-
<% end %>
|
25
|
-
</dl>
|