decidim-pages 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/app/assets/images/decidim/pages/icon.svg +3 -0
- data/app/commands/decidim/pages/admin/update_page.rb +1 -2
- data/app/forms/decidim/pages/admin/page_form.rb +0 -1
- data/app/views/decidim/pages/admin/pages/_form.html.erb +0 -1
- data/app/views/decidim/pages/application/show.html.erb +3 -3
- data/config/i18n-tasks.yml +1 -0
- data/config/locales/ca.yml +5 -1
- data/config/locales/en.yml +5 -1
- data/config/locales/es.yml +5 -1
- data/db/migrate/20170110145040_remove_commentable_flag_from_pages.rb +5 -0
- data/lib/decidim/pages/feature.rb +13 -3
- metadata +11 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d4f91509718700bba96bb88a5ea4699924256e9
|
4
|
+
data.tar.gz: f4852700fc682d785e646f0d70037700214bad83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60ad78cc25ad9cb936d21c8ec41c60b61fed3ac39f190322e56ce144af173f3ee9d2e37f21def010d37bc4acac75408cc30c6c68c252795bcaae83a4eaa0fa1b
|
7
|
+
data.tar.gz: 51b6191f76068e592d06e4f3019433bd56a5456fc42fe242cde032a7b7295c35f38e11f38b89e72f7595c51d17fa395bd68ecc94d8d41b6db2cb0f18f8f1e929
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "decidim/common_rake"
|
2
|
+
require "decidim/dev/common_rake"
|
@@ -1,5 +1,4 @@
|
|
1
1
|
<div class="field">
|
2
2
|
<%= form.translated :text_field, :title, autofocus: true, label: t("models.components.title", scope: "decidim.pages.admin") %>
|
3
3
|
<%= form.translated :editor, :body, toolbar: :full, lines: 30, label: t("models.components.body", scope: "decidim.pages.admin") %>
|
4
|
-
<%= form.check_box :commentable, label: t("models.components.commentable", scope: "decidim.pages.admin") %>
|
5
4
|
</div>
|
@@ -9,8 +9,8 @@
|
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
<%= comments_for @page, arguable: true %>
|
12
|
+
<% if feature_settings.comments_always_enabled || current_settings.comments_enabled %>
|
13
|
+
<%= content_for :expanded do %>
|
14
|
+
<%= comments_for @page, arguable: true, votable: true %>
|
15
15
|
<% end %>
|
16
16
|
<% end %>
|
data/config/i18n-tasks.yml
CHANGED
data/config/locales/ca.yml
CHANGED
@@ -3,12 +3,16 @@ ca:
|
|
3
3
|
features:
|
4
4
|
pages:
|
5
5
|
name: Pàgina
|
6
|
+
settings:
|
7
|
+
global:
|
8
|
+
comments_always_enabled: Comentaris sempre habilitats
|
9
|
+
step:
|
10
|
+
comments_enabled: Comentaris habilitats
|
6
11
|
pages:
|
7
12
|
admin:
|
8
13
|
models:
|
9
14
|
components:
|
10
15
|
body: Cos
|
11
|
-
commentable: Habilitar comentaris per a aquesta pàgina
|
12
16
|
title: Títol
|
13
17
|
pages:
|
14
18
|
edit:
|
data/config/locales/en.yml
CHANGED
@@ -4,12 +4,16 @@ en:
|
|
4
4
|
features:
|
5
5
|
pages:
|
6
6
|
name: Page
|
7
|
+
settings:
|
8
|
+
global:
|
9
|
+
comments_always_enabled: Comments always enabled
|
10
|
+
step:
|
11
|
+
comments_enabled: Comments enabled
|
7
12
|
pages:
|
8
13
|
admin:
|
9
14
|
models:
|
10
15
|
components:
|
11
16
|
body: Body
|
12
|
-
commentable: Enable comments for this page
|
13
17
|
title: Title
|
14
18
|
pages:
|
15
19
|
edit:
|
data/config/locales/es.yml
CHANGED
@@ -3,12 +3,16 @@ es:
|
|
3
3
|
features:
|
4
4
|
pages:
|
5
5
|
name: Página
|
6
|
+
settings:
|
7
|
+
global:
|
8
|
+
comments_always_enabled: Comentarios siempre habilitados
|
9
|
+
step:
|
10
|
+
comments_enabled: Comentarios habilitados
|
6
11
|
pages:
|
7
12
|
admin:
|
8
13
|
models:
|
9
14
|
components:
|
10
15
|
body: Cuerpo
|
11
|
-
commentable: Habilitar comentarios para esta página
|
12
16
|
title: Título
|
13
17
|
pages:
|
14
18
|
edit:
|
@@ -5,6 +5,7 @@ require_dependency "decidim/features/namer"
|
|
5
5
|
Decidim.register_feature(:pages) do |feature|
|
6
6
|
feature.engine = Decidim::Pages::Engine
|
7
7
|
feature.admin_engine = Decidim::Pages::AdminEngine
|
8
|
+
feature.icon = "decidim/pages/icon.svg"
|
8
9
|
|
9
10
|
feature.on(:create) do |instance|
|
10
11
|
Decidim::Pages::CreatePage.call(instance) do
|
@@ -18,6 +19,14 @@ Decidim.register_feature(:pages) do |feature|
|
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
22
|
+
feature.settings(:global) do |settings|
|
23
|
+
settings.attribute :comments_always_enabled, type: :boolean
|
24
|
+
end
|
25
|
+
|
26
|
+
feature.settings(:step) do |settings|
|
27
|
+
settings.attribute :comments_enabled, type: :boolean
|
28
|
+
end
|
29
|
+
|
21
30
|
feature.seeds do
|
22
31
|
Decidim::ParticipatoryProcess.all.each do |process|
|
23
32
|
next unless process.steps.any?
|
@@ -28,14 +37,15 @@ Decidim.register_feature(:pages) do |feature|
|
|
28
37
|
participatory_process: process
|
29
38
|
)
|
30
39
|
|
31
|
-
Decidim::Pages::Page.create!(
|
40
|
+
page = Decidim::Pages::Page.create!(
|
32
41
|
feature: feature,
|
33
42
|
title: Decidim::Faker::Localized.sentence(2),
|
34
43
|
body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
35
44
|
Decidim::Faker::Localized.paragraph(3)
|
36
|
-
end
|
37
|
-
commentable: true
|
45
|
+
end
|
38
46
|
)
|
47
|
+
|
48
|
+
Decidim::Comments::Seed.comments_for(page)
|
39
49
|
end
|
40
50
|
end
|
41
51
|
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.2
|
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:
|
13
|
+
date: 2017-01-23 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.2
|
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.2
|
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.2
|
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.2
|
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.2
|
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.2
|
71
71
|
description: A pages component for decidim's participatory processes.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|
@@ -79,6 +79,7 @@ extra_rdoc_files: []
|
|
79
79
|
files:
|
80
80
|
- README.md
|
81
81
|
- Rakefile
|
82
|
+
- app/assets/images/decidim/pages/icon.svg
|
82
83
|
- app/commands/decidim/pages/admin/update_page.rb
|
83
84
|
- app/commands/decidim/pages/create_page.rb
|
84
85
|
- app/commands/decidim/pages/destroy_page.rb
|
@@ -98,6 +99,7 @@ files:
|
|
98
99
|
- config/locales/es.yml
|
99
100
|
- db/migrate/20161116121353_create_decidim_pages.rb
|
100
101
|
- db/migrate/20161214150429_add_commentable_to_pages.rb
|
102
|
+
- db/migrate/20170110145040_remove_commentable_flag_from_pages.rb
|
101
103
|
- lib/decidim/pages.rb
|
102
104
|
- lib/decidim/pages/admin.rb
|
103
105
|
- lib/decidim/pages/admin_engine.rb
|
@@ -124,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
126
|
version: '0'
|
125
127
|
requirements: []
|
126
128
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.6.8
|
128
130
|
signing_key:
|
129
131
|
specification_version: 4
|
130
132
|
summary: A pages component for decidim's participatory processes.
|