decidim-pages 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/pages/admin/update_page.rb +1 -4
- data/app/commands/decidim/pages/create_page.rb +1 -4
- data/app/forms/decidim/pages/admin/page_form.rb +0 -3
- data/app/models/decidim/pages/page.rb +8 -12
- data/app/views/decidim/pages/admin/pages/_form.html.erb +0 -1
- data/app/views/decidim/pages/application/show.html.erb +0 -1
- data/config/locales/ca.yml +0 -1
- data/config/locales/en.yml +0 -1
- data/config/locales/es.yml +0 -1
- data/config/locales/eu.yml +14 -1
- data/config/locales/fi.yml +22 -0
- data/db/migrate/20170220091402_remove_page_feature_titles.rb +5 -0
- data/lib/decidim/pages/engine.rb +1 -0
- data/lib/decidim/pages/feature.rb +4 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88bb89278413c1a92dbf2ec9a45bd89accc621bf
|
4
|
+
data.tar.gz: d8684f7249a48bf29392faa275f01f5c6780d673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d83bc17e074007ac388e850d1efd18715a11be5addcd1b8d5cadb99d85f4bc9d95188aa07b34ae3f001499a148e27fdd1d51906c50b6ad830bc645b2dd15d9d
|
7
|
+
data.tar.gz: 37f2e0cf9b8967397be17e1a420f1b3a669f5be9ac0f04cf6159045b261f2b60a2ee39b8e8d0468ad97fa83b6280bda730e39e8496dd2f2c7afbeb687eab55e6
|
@@ -4,13 +4,16 @@ module Decidim
|
|
4
4
|
# The data store for a Page in the Decidim::Pages component. It stores a
|
5
5
|
# title, description and any other useful information to render a custom page.
|
6
6
|
class Page < Pages::ApplicationRecord
|
7
|
+
include Decidim::Resourceable
|
8
|
+
include Decidim::HasFeature
|
7
9
|
include Decidim::Comments::Commentable
|
8
10
|
|
9
|
-
|
10
|
-
has_one :organization, through: :feature
|
11
|
+
feature_manifest_name "pages"
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
# Public: Pages doesn't have title so we assign the feature one to it.
|
14
|
+
def title
|
15
|
+
feature.name
|
16
|
+
end
|
14
17
|
|
15
18
|
# Public: Overrides the `commentable?` Commentable concern method.
|
16
19
|
def commentable?
|
@@ -19,7 +22,7 @@ module Decidim
|
|
19
22
|
|
20
23
|
# Public: Overrides the `accepts_new_comments?` Commentable concern method.
|
21
24
|
def accepts_new_comments?
|
22
|
-
|
25
|
+
commentable? && !feature.active_step_settings.comments_blocked
|
23
26
|
end
|
24
27
|
|
25
28
|
# Public: Overrides the `comments_have_alignment?` Commentable concern method.
|
@@ -31,13 +34,6 @@ module Decidim
|
|
31
34
|
def comments_have_votes?
|
32
35
|
true
|
33
36
|
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def feature_manifest_matches
|
38
|
-
return unless feature
|
39
|
-
errors.add(:feature, :invalid) unless feature.manifest_name == "pages"
|
40
|
-
end
|
41
37
|
end
|
42
38
|
end
|
43
39
|
end
|
@@ -1,4 +1,3 @@
|
|
1
1
|
<div class="field">
|
2
|
-
<%= form.translated :text_field, :title, autofocus: true, label: t("models.components.title", scope: "decidim.pages.admin") %>
|
3
2
|
<%= form.translated :editor, :body, toolbar: :full, lines: 30, label: t("models.components.body", scope: "decidim.pages.admin") %>
|
4
3
|
</div>
|
data/config/locales/ca.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/config/locales/eu.yml
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
eu:
|
2
2
|
decidim:
|
3
|
+
features:
|
4
|
+
pages:
|
5
|
+
name: Orrialdea
|
6
|
+
settings:
|
7
|
+
global:
|
8
|
+
comments_enabled: Iruzkin gaituak
|
3
9
|
pages:
|
4
10
|
admin:
|
5
11
|
models:
|
6
12
|
components:
|
7
|
-
|
13
|
+
body: Testu-gorputza
|
14
|
+
pages:
|
15
|
+
edit:
|
16
|
+
save: Gorde orria
|
17
|
+
title: Editatu orria
|
18
|
+
update:
|
19
|
+
invalid: Erroreak gertatu dira orria gordetzean.
|
20
|
+
success: Orria zuzen gorde da.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
fi:
|
2
|
+
decidim:
|
3
|
+
features:
|
4
|
+
pages:
|
5
|
+
name: Sivu
|
6
|
+
settings:
|
7
|
+
global:
|
8
|
+
comments_enabled: Kommentointi sallittu
|
9
|
+
step:
|
10
|
+
comments_blocked: Kommentointi estetty
|
11
|
+
pages:
|
12
|
+
admin:
|
13
|
+
models:
|
14
|
+
components:
|
15
|
+
body: Runko
|
16
|
+
pages:
|
17
|
+
edit:
|
18
|
+
save: Tallenna sivu
|
19
|
+
title: Muokkaa sivua
|
20
|
+
update:
|
21
|
+
invalid: Sivun tallennuksessa oli virheitä.
|
22
|
+
success: Sivu tallennettu onnistuneesti.
|
data/lib/decidim/pages/engine.rb
CHANGED
@@ -27,6 +27,10 @@ Decidim.register_feature(:pages) do |feature|
|
|
27
27
|
settings.attribute :comments_blocked, type: :boolean, default: false
|
28
28
|
end
|
29
29
|
|
30
|
+
feature.register_resource do |resource|
|
31
|
+
resource.model_class_name = "Decidim::Pages::Page"
|
32
|
+
end
|
33
|
+
|
30
34
|
feature.seeds do
|
31
35
|
Decidim::ParticipatoryProcess.all.each do |process|
|
32
36
|
next unless process.steps.any?
|
@@ -40,7 +44,6 @@ Decidim.register_feature(:pages) do |feature|
|
|
40
44
|
|
41
45
|
page = Decidim::Pages::Page.create!(
|
42
46
|
feature: feature,
|
43
|
-
title: Decidim::Faker::Localized.sentence(2),
|
44
47
|
body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
45
48
|
Decidim::Faker::Localized.paragraph(3)
|
46
49
|
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.0.
|
4
|
+
version: 0.0.6
|
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-
|
13
|
+
date: 2017-03-24 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.
|
21
|
+
version: 0.0.6
|
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.6
|
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.
|
35
|
+
version: 0.0.6
|
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.
|
42
|
+
version: 0.0.6
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rectify
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,14 +60,14 @@ dependencies:
|
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0.0.
|
63
|
+
version: 0.0.6
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - '='
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0.0.
|
70
|
+
version: 0.0.6
|
71
71
|
description: A pages component for decidim's participatory processes.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|
@@ -98,9 +98,11 @@ files:
|
|
98
98
|
- config/locales/en.yml
|
99
99
|
- config/locales/es.yml
|
100
100
|
- config/locales/eu.yml
|
101
|
+
- config/locales/fi.yml
|
101
102
|
- db/migrate/20161116121353_create_decidim_pages.rb
|
102
103
|
- db/migrate/20161214150429_add_commentable_to_pages.rb
|
103
104
|
- db/migrate/20170110145040_remove_commentable_flag_from_pages.rb
|
105
|
+
- db/migrate/20170220091402_remove_page_feature_titles.rb
|
104
106
|
- lib/decidim/pages.rb
|
105
107
|
- lib/decidim/pages/admin.rb
|
106
108
|
- lib/decidim/pages/admin_engine.rb
|