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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0af95f3bc7dab1f8c00fdddcd3200a26848a4aa
4
- data.tar.gz: 16a253297f058d7562f81d4d7509bdf904de9161
3
+ metadata.gz: 5c3d233904e106ab91960203e3f4ac4a6869459f
4
+ data.tar.gz: 5f20be39206fe2d05d57785372cf44d5ccf45d4b
5
5
  SHA512:
6
- metadata.gz: eb6349b85f5d5a7afe7b2cebf8109dc89b97d81c227c2897cb5ab904c2e4ee06bb4012cca8342c11dd4cef8ef699472152c0bebeea19035d6274fe7683a803a9
7
- data.tar.gz: 4a0cd277ce8b0ff30a99e9a4b75c99ea58f185078470fdcf6ea203dcb7ead2c29cc7317834aaa025bbf6372338153df6f9e8f35ee21d3a13aa7a9eb66d622abe
6
+ metadata.gz: 596cd0d1cfc1dff33a47854f7bc2457c50edcf4bf235a8dc3f3fbfca1f01a5fc86df2b0c98644a9ca28c2b3b13e04093b9d8c502bbabe2051ff520cc9107d5de
7
+ data.tar.gz: 4e72b10277de282c07cd85d8427171293cbc7ac3ad3df31b4e8c862f3a303795a940ebf5dd9196c371d21cc2df5b74d652ad55382c5a75b2dff85b51687d2b6c
@@ -1,3 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8">
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,6 +1,6 @@
1
1
  <h3><%= t ".title" %></h3>
2
2
 
3
- <%= form_for(@form, url: page_path, method: :post) do |form| %>
3
+ <%= decidim_form_for(@form, url: page_path, method: :post) do |form| %>
4
4
  <%= render partial: 'form', object: form %>
5
5
 
6
6
  <div class="actions">
@@ -1,4 +1,7 @@
1
- <% content_for(:meta_title, translated_attribute(@page.title)) %>
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
- <% if feature_settings.comments_always_enabled || current_settings.comments_enabled %>
14
- <%= content_for :expanded do %>
15
- <%= comments_for @page, arguable: true, votable: true %>
16
- <% end %>
17
- <% end %>
16
+ <%= comments_for @page %>
@@ -5,9 +5,9 @@ ca:
5
5
  name: Pàgina
6
6
  settings:
7
7
  global:
8
- comments_always_enabled: Comentaris sempre habilitats
9
- step:
10
8
  comments_enabled: Comentaris habilitats
9
+ step:
10
+ comments_blocked: Comentaris bloquejats
11
11
  pages:
12
12
  admin:
13
13
  models:
@@ -6,9 +6,9 @@ en:
6
6
  name: Page
7
7
  settings:
8
8
  global:
9
- comments_always_enabled: Comments always enabled
10
- step:
11
9
  comments_enabled: Comments enabled
10
+ step:
11
+ comments_blocked: Comments blocked
12
12
  pages:
13
13
  admin:
14
14
  models:
@@ -5,9 +5,9 @@ es:
5
5
  name: Página
6
6
  settings:
7
7
  global:
8
- comments_always_enabled: Comentarios siempre habilitados
9
- step:
10
8
  comments_enabled: Comentarios habilitados
9
+ step:
10
+ comments_blocked: Comentarios bloqueados
11
11
  pages:
12
12
  admin:
13
13
  models:
@@ -0,0 +1,7 @@
1
+ eu:
2
+ decidim:
3
+ pages:
4
+ admin:
5
+ models:
6
+ components:
7
+ title: Izenburua
@@ -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 :comments_always_enabled, type: :boolean
23
+ settings.attribute :comments_enabled, type: :boolean, default: true
24
24
  end
25
25
 
26
26
  feature.settings(:step) do |settings|
27
- settings.attribute :comments_enabled, type: :boolean
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.3
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-01 00:00:00.000000000 Z
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.3
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.3
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.3
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.3
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.3
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.3
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