decidim-pages 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/decidim/pages/icon.svg +1 -3
- data/app/models/decidim/pages/page.rb +22 -0
- data/app/views/decidim/pages/admin/pages/edit.html.erb +1 -1
- data/app/views/decidim/pages/application/show.html.erb +5 -6
- data/config/locales/ca.yml +2 -2
- data/config/locales/en.yml +2 -2
- data/config/locales/es.yml +2 -2
- data/config/locales/eu.yml +7 -0
- data/lib/decidim/pages/feature.rb +3 -2
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c3d233904e106ab91960203e3f4ac4a6869459f
|
4
|
+
data.tar.gz: 5f20be39206fe2d05d57785372cf44d5ccf45d4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 596cd0d1cfc1dff33a47854f7bc2457c50edcf4bf235a8dc3f3fbfca1f01a5fc86df2b0c98644a9ca28c2b3b13e04093b9d8c502bbabe2051ff520cc9107d5de
|
7
|
+
data.tar.gz: 4e72b10277de282c07cd85d8427171293cbc7ac3ad3df31b4e8c862f3a303795a940ebf5dd9196c371d21cc2df5b74d652ad55382c5a75b2dff85b51687d2b6c
|
@@ -1,3 +1 @@
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg"
|
2
|
-
<path d="M0 0v8h7v-4h-4v-4h-3zm4 0v3h3l-3-3zm-3 2h1v1h-1v-1zm0 2h1v1h-1v-1zm0 2h4v1h-4v-1z" />
|
3
|
-
</svg>
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.02 36.02"><path d="M373,545.54a18,18,0,1,1,18-18A18,18,0,0,1,373,545.54Zm0-34a16,16,0,1,0,16,16A16,16,0,0,0,373,511.53Z" transform="translate(-354.99 -509.53)"/><path d="M377.73,536.41h-9.46a1,1,0,1,1,0-2h9.46A1,1,0,0,1,377.73,536.41Z" transform="translate(-354.99 -509.53)"/><path d="M375,525.54h-6.73a1,1,0,1,1,0-2H375A1,1,0,1,1,375,525.54Z" transform="translate(-354.99 -509.53)"/><path d="M375,535.41a1,1,0,0,1-1-1v-9.87a1,1,0,1,1,2,0v9.87A1,1,0,0,1,375,535.41Z" transform="translate(-354.99 -509.53)"/><path d="M373,523a3,3,0,1,1,3-3A3,3,0,0,1,373,523Zm0-4a1,1,0,1,0,1,1A1,1,0,0,0,373,519Z" transform="translate(-354.99 -509.53)"/><path d="M371,535.41a1,1,0,0,1-1-1v-9.87a1,1,0,1,1,2,0v9.87A1,1,0,0,1,371,535.41Z" transform="translate(-354.99 -509.53)"/></svg>
|
@@ -4,12 +4,34 @@ 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::Comments::Commentable
|
8
|
+
|
7
9
|
belongs_to :feature, foreign_key: "decidim_feature_id", class_name: Decidim::Feature
|
8
10
|
has_one :organization, through: :feature
|
9
11
|
|
10
12
|
validates :title, :feature, presence: true
|
11
13
|
validate :feature_manifest_matches
|
12
14
|
|
15
|
+
# Public: Overrides the `commentable?` Commentable concern method.
|
16
|
+
def commentable?
|
17
|
+
feature.settings.comments_enabled?
|
18
|
+
end
|
19
|
+
|
20
|
+
# Public: Overrides the `accepts_new_comments?` Commentable concern method.
|
21
|
+
def accepts_new_comments?
|
22
|
+
commentable? && !feature.active_step_settings.comments_blocked
|
23
|
+
end
|
24
|
+
|
25
|
+
# Public: Overrides the `comments_have_alignment?` Commentable concern method.
|
26
|
+
def comments_have_alignment?
|
27
|
+
true
|
28
|
+
end
|
29
|
+
|
30
|
+
# Public: Overrides the `comments_have_votes?` Commentable concern method.
|
31
|
+
def comments_have_votes?
|
32
|
+
true
|
33
|
+
end
|
34
|
+
|
13
35
|
private
|
14
36
|
|
15
37
|
def feature_manifest_matches
|
@@ -1,4 +1,7 @@
|
|
1
|
-
<%
|
1
|
+
<% add_decidim_meta_tags({
|
2
|
+
title: translated_attribute(@page.title),
|
3
|
+
description: translated_attribute(@page.body),
|
4
|
+
}) %>
|
2
5
|
|
3
6
|
<div class="row column">
|
4
7
|
<div class="row">
|
@@ -10,8 +13,4 @@
|
|
10
13
|
</div>
|
11
14
|
</div>
|
12
15
|
|
13
|
-
|
14
|
-
<%= content_for :expanded do %>
|
15
|
-
<%= comments_for @page, arguable: true, votable: true %>
|
16
|
-
<% end %>
|
17
|
-
<% end %>
|
16
|
+
<%= comments_for @page %>
|
data/config/locales/ca.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
@@ -20,11 +20,11 @@ Decidim.register_feature(:pages) do |feature|
|
|
20
20
|
end
|
21
21
|
|
22
22
|
feature.settings(:global) do |settings|
|
23
|
-
settings.attribute :
|
23
|
+
settings.attribute :comments_enabled, type: :boolean, default: true
|
24
24
|
end
|
25
25
|
|
26
26
|
feature.settings(:step) do |settings|
|
27
|
-
settings.attribute :
|
27
|
+
settings.attribute :comments_blocked, type: :boolean, default: false
|
28
28
|
end
|
29
29
|
|
30
30
|
feature.seeds do
|
@@ -34,6 +34,7 @@ Decidim.register_feature(:pages) do |feature|
|
|
34
34
|
feature = Decidim::Feature.create!(
|
35
35
|
name: Decidim::Features::Namer.new(process.organization.available_locales, :pages).i18n_name,
|
36
36
|
manifest_name: :pages,
|
37
|
+
published_at: Time.current,
|
37
38
|
participatory_process: process
|
38
39
|
)
|
39
40
|
|
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.5
|
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-02-
|
13
|
+
date: 2017-02-17 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.5
|
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.5
|
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.5
|
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.5
|
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.5
|
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.5
|
71
71
|
description: A pages component for decidim's participatory processes.
|
72
72
|
email:
|
73
73
|
- josepjaume@gmail.com
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- config/locales/ca.yml
|
98
98
|
- config/locales/en.yml
|
99
99
|
- config/locales/es.yml
|
100
|
+
- config/locales/eu.yml
|
100
101
|
- db/migrate/20161116121353_create_decidim_pages.rb
|
101
102
|
- db/migrate/20161214150429_add_commentable_to_pages.rb
|
102
103
|
- db/migrate/20170110145040_remove_commentable_flag_from_pages.rb
|