decidim-pages 0.11.2 → 0.12.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/decidim/pages/admin/pages_controller.rb +4 -0
- data/app/permissions/decidim/pages/permissions.rb +15 -0
- data/config/locales/ca.yml +5 -0
- data/config/locales/en.yml +5 -0
- data/config/locales/es.yml +5 -0
- data/config/locales/eu.yml +5 -0
- data/config/locales/fi.yml +5 -0
- data/config/locales/fr.yml +5 -0
- data/config/locales/gl.yml +5 -0
- data/config/locales/it.yml +5 -0
- data/config/locales/nl.yml +5 -0
- data/config/locales/pl.yml +7 -0
- data/config/locales/pt-BR.yml +5 -0
- data/config/locales/pt.yml +5 -0
- data/config/locales/sv.yml +5 -0
- data/config/locales/uk.yml +7 -0
- data/lib/decidim/pages/component.rb +2 -1
- data/lib/decidim/pages/version.rb +1 -1
- metadata +11 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1970dfaec0eccfe3829d3ac8a6a6673445848fc8ae83fdd03fa04b6d8ea24ec2
|
4
|
+
data.tar.gz: e7e70730d1bc64dcb2769e27069b60290988e42ba3623533d73ed99ed4399ba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b2cb6353c446bd9959d04db98aac6493ad884bd8a6d6774e3df7b9185b475a260536b0a8fe7042e0213f4ff9b89340e1dd1e4724c8b6abeb3588d1aea864a8
|
7
|
+
data.tar.gz: dbbbb63a13c51b04267f836edc6cfe7c9201ba21d5492f0959a52b27ea6fee22fcb2cd433d0a3cb2ab6e6f7b5a6235eb0b143137abbd7dd5a36f0fa684b4e2bb
|
@@ -6,10 +6,14 @@ module Decidim
|
|
6
6
|
# This controller allows the user to update a Page.
|
7
7
|
class PagesController < Admin::ApplicationController
|
8
8
|
def edit
|
9
|
+
enforce_permission_to :update, :page
|
10
|
+
|
9
11
|
@form = form(Admin::PageForm).from_model(page)
|
10
12
|
end
|
11
13
|
|
12
14
|
def update
|
15
|
+
enforce_permission_to :update, :page
|
16
|
+
|
13
17
|
@form = form(Admin::PageForm).from_params(params)
|
14
18
|
|
15
19
|
Admin::UpdatePage.call(@form, page) do
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Pages
|
5
|
+
class Permissions < Decidim::DefaultPermissions
|
6
|
+
def permissions
|
7
|
+
return permission_action if permission_action.scope != :admin
|
8
|
+
|
9
|
+
permission_action.allow! if permission_action.action == :update
|
10
|
+
|
11
|
+
permission_action
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
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
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
@@ -6,6 +6,7 @@ Decidim.register_component(:pages) do |component|
|
|
6
6
|
component.engine = Decidim::Pages::Engine
|
7
7
|
component.admin_engine = Decidim::Pages::AdminEngine
|
8
8
|
component.icon = "decidim/pages/icon.svg"
|
9
|
+
component.permissions_class_name = "Decidim::Pages::Permissions"
|
9
10
|
|
10
11
|
component.on(:create) do |instance|
|
11
12
|
Decidim::Pages::CreatePage.call(instance) do
|
@@ -40,7 +41,7 @@ Decidim.register_component(:pages) do |component|
|
|
40
41
|
settings.attribute :announcement, type: :text, translated: true, editor: true
|
41
42
|
end
|
42
43
|
|
43
|
-
component.register_resource do |resource|
|
44
|
+
component.register_resource(:page) do |resource|
|
44
45
|
resource.model_class_name = "Decidim::Pages::Page"
|
45
46
|
end
|
46
47
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-pages
|
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-core
|
@@ -18,42 +18,42 @@ 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-dev
|
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: :development
|
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: decidim-participatory_processes
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - '='
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0.
|
49
|
+
version: 0.12.0.pre
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 0.
|
56
|
+
version: 0.12.0.pre
|
57
57
|
description: A pages component for decidim's participatory processes.
|
58
58
|
email:
|
59
59
|
- josepjaume@gmail.com
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- app/helpers/decidim/pages/application_helper.rb
|
78
78
|
- app/models/decidim/pages/application_record.rb
|
79
79
|
- app/models/decidim/pages/page.rb
|
80
|
+
- app/permissions/decidim/pages/permissions.rb
|
80
81
|
- app/presenters/decidim/pages/admin_log/page_presenter.rb
|
81
82
|
- app/views/decidim/pages/admin/pages/_form.html.erb
|
82
83
|
- app/views/decidim/pages/admin/pages/edit.html.erb
|
@@ -122,9 +123,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
123
|
version: '2.3'
|
123
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
125
|
requirements:
|
125
|
-
- - "
|
126
|
+
- - ">"
|
126
127
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
128
|
+
version: 1.3.1
|
128
129
|
requirements: []
|
129
130
|
rubyforge_project:
|
130
131
|
rubygems_version: 2.7.6
|