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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04ca32d09705df339e1f733c5352b6f1b5e7deb615fb2d775f8b4049a8758a9b
4
- data.tar.gz: 8a34e8d717afab4f04aba4b063f497b6c74007d82e11e2d74c7c3ec82f9f629e
3
+ metadata.gz: 1970dfaec0eccfe3829d3ac8a6a6673445848fc8ae83fdd03fa04b6d8ea24ec2
4
+ data.tar.gz: e7e70730d1bc64dcb2769e27069b60290988e42ba3623533d73ed99ed4399ba5
5
5
  SHA512:
6
- metadata.gz: dc33500ff19eed3626ce69e5f91b85d4ab6467e81969cdba1589b09a32dd64298357bf4defbbd8ed43bb1fa681a2fd9b5db9e0fe925997ef505b9c9c6f3b4f59
7
- data.tar.gz: 3363cb875f28e905c5233e3c81c31344bad239ece9bb82730addd3e07cb6a2855bd1f2595197ad087fa7409395782d8ffa05bd0b8ff84ecdfed9e1ba08eddedf
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
@@ -1,4 +1,9 @@
1
1
  ca:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Pàgina
6
+ other: Pàgines
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,5 +1,10 @@
1
1
  ---
2
2
  en:
3
+ activerecord:
4
+ models:
5
+ decidim/pages/page:
6
+ one: Page
7
+ other: Pages
3
8
  decidim:
4
9
  admin_log:
5
10
  page:
@@ -1,4 +1,9 @@
1
1
  es:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Página
6
+ other: Páginas
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  eu:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: page
6
+ other: orrialdeak
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  fi:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Sivu
6
+ other: sivut
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  fr:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Page
6
+ other: Pages
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  gl:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Páxina
6
+ other: Páxinas
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  it:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Pagina
6
+ other: pagine
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  nl:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Pagina
6
+ other: Pages
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,11 @@
1
1
  pl:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Strona
6
+ few: Strony
7
+ many: Strony
8
+ other: Strony
2
9
  decidim:
3
10
  admin_log:
4
11
  page:
@@ -1,4 +1,9 @@
1
1
  pt-BR:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Página
6
+ other: Páginas
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  pt:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Página
6
+ other: Páginas
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,9 @@
1
1
  sv:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Sida
6
+ other: sidor
2
7
  decidim:
3
8
  admin_log:
4
9
  page:
@@ -1,4 +1,11 @@
1
1
  uk:
2
+ activerecord:
3
+ models:
4
+ decidim/pages/page:
5
+ one: Сторінка
6
+ few: Сторінки
7
+ many: Сторінок
8
+ other: Сторінок
2
9
  decidim:
3
10
  admin_log:
4
11
  page:
@@ -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
 
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-pages version.
5
5
  module Pages
6
6
  def self.version
7
- "0.11.2"
7
+ "0.12.0.pre"
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-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
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 00:00:00.000000000 Z
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.11.2
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.11.2
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.11.2
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.11.2
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.11.2
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.11.2
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: '0'
128
+ version: 1.3.1
128
129
  requirements: []
129
130
  rubyforge_project:
130
131
  rubygems_version: 2.7.6