decidim-pages 0.5.1 → 0.6.0

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: d4cb9966f001e80a7f85d09731cb37897069dc23
4
- data.tar.gz: 3418ba52c6aeccba37ff1881ae3b2ac1479a3c7a
3
+ metadata.gz: c468e40c810b95529efbdb20abc871bb1195e248
4
+ data.tar.gz: 22c3657f71c92fca6c88e6c8f6ec977190d51f2f
5
5
  SHA512:
6
- metadata.gz: 5129bb77a3e0bba79905b304bf0eff586ed296aa246140c9cab1fc89abf0a850e8bc751da5adb25c33aaf6164967182cb876511b765f54b25c440bccd6d407e6
7
- data.tar.gz: b8d725a8a4fb0a7ed726ce0e881631db27ec8dc050d12784267798979c8dfd0bbad58070b7d9bb08b52779049eea16c1ff970b1751323e93d523d3653e40fcef
6
+ metadata.gz: fb3d3d50a3e812d0736254c5c1a6ae4b82a16db586546a98f67a436253738559887aee91ab7975b9b32c0b755502337ccd9eb0423f37c844e906048cfb51bc2e
7
+ data.tar.gz: 308b8d4c0b96aca0ae7a40233eb47e87c966e939498e8ac4bc04d3e3e08635567be5e3d048d8fb2becd8b54bc063edfb450ea07dd3f06b1299436c062d7d6101
@@ -1 +1,8 @@
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>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36.02 36.02">
2
+ <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)"/>
3
+ <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)"/>
4
+ <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)"/>
5
+ <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)"/>
6
+ <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)"/>
7
+ <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)"/>
8
+ </svg>
@@ -5,7 +5,6 @@ module Decidim
5
5
  # Custom helpers, scoped to the pages engine.
6
6
  #
7
7
  module ApplicationHelper
8
- include Decidim::Comments::CommentsHelper
9
8
  end
10
9
  end
11
10
  end
@@ -7,7 +7,6 @@ module Decidim
7
7
  class Page < Pages::ApplicationRecord
8
8
  include Decidim::Resourceable
9
9
  include Decidim::HasFeature
10
- include Decidim::Comments::Commentable
11
10
 
12
11
  feature_manifest_name "pages"
13
12
 
@@ -15,31 +14,6 @@ module Decidim
15
14
  def title
16
15
  feature.name
17
16
  end
18
-
19
- # Public: Overrides the `commentable?` Commentable concern method.
20
- def commentable?
21
- feature.settings.comments_enabled?
22
- end
23
-
24
- # Public: Overrides the `accepts_new_comments?` Commentable concern method.
25
- def accepts_new_comments?
26
- commentable? && !feature.active_step_settings.comments_blocked
27
- end
28
-
29
- # Public: Overrides the `comments_have_alignment?` Commentable concern method.
30
- def comments_have_alignment?
31
- true
32
- end
33
-
34
- # Public: Overrides the `comments_have_votes?` Commentable concern method.
35
- def comments_have_votes?
36
- true
37
- end
38
-
39
- # Public: Overrides the `notifiable?` Notifiable concern method.
40
- def notifiable?(_context)
41
- false
42
- end
43
17
  end
44
18
  end
45
19
  end
@@ -13,5 +13,3 @@
13
13
  </div>
14
14
  </div>
15
15
  </div>
16
-
17
- <%= comments_for @page %>
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ca:
2
3
  decidim:
3
4
  features:
@@ -5,9 +6,9 @@ ca:
5
6
  name: Pàgina
6
7
  settings:
7
8
  global:
8
- comments_enabled: Comentaris habilitats
9
+ announcement: Avís
9
10
  step:
10
- comments_blocked: Comentaris bloquejats
11
+ announcement: Avís
11
12
  pages:
12
13
  admin:
13
14
  models:
@@ -7,10 +7,8 @@ en:
7
7
  settings:
8
8
  global:
9
9
  announcement: Announcement
10
- comments_enabled: Comments enabled
11
10
  step:
12
11
  announcement: Announcement
13
- comments_blocked: Comments blocked
14
12
  pages:
15
13
  admin:
16
14
  models:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  es:
2
3
  decidim:
3
4
  features:
@@ -5,9 +6,9 @@ es:
5
6
  name: Página
6
7
  settings:
7
8
  global:
8
- comments_enabled: Comentarios habilitados
9
+ announcement: Aviso
9
10
  step:
10
- comments_blocked: Comentarios bloqueados
11
+ announcement: Aviso
11
12
  pages:
12
13
  admin:
13
14
  models:
@@ -5,14 +5,14 @@ eu:
5
5
  name: Orria
6
6
  settings:
7
7
  global:
8
- comments_enabled: Iruzkinak gaituta
8
+ announcement: Oharra
9
9
  step:
10
- comments_blocked: Iruzkinak blokeatuta
10
+ announcement: Oharra
11
11
  pages:
12
12
  admin:
13
13
  models:
14
14
  components:
15
- body: Testu-gorputza
15
+ body: Testua
16
16
  pages:
17
17
  edit:
18
18
  save: Eguneratu
@@ -5,9 +5,9 @@ fi:
5
5
  name: Sivu
6
6
  settings:
7
7
  global:
8
- comments_enabled: Kommentointi sallittu
8
+ announcement: Ilmoitus
9
9
  step:
10
- comments_blocked: Kommentointi estetty
10
+ announcement: Ilmoitus
11
11
  pages:
12
12
  admin:
13
13
  models:
@@ -15,6 +15,7 @@ fi:
15
15
  body: Runko
16
16
  pages:
17
17
  edit:
18
+ save: Päivitä
18
19
  title: Muokkaa sivua
19
20
  update:
20
21
  invalid: Sivun tallennuksessa oli virheitä.
@@ -5,9 +5,9 @@ fr:
5
5
  name: Page
6
6
  settings:
7
7
  global:
8
- comments_enabled: Commentaires activés
8
+ announcement: Annonce
9
9
  step:
10
- comments_blocked: Commentaires bloqués
10
+ announcement: Annonce
11
11
  pages:
12
12
  admin:
13
13
  models:
@@ -15,7 +15,7 @@ fr:
15
15
  body: Corps de texte
16
16
  pages:
17
17
  edit:
18
- save: Mettre à jour
18
+ save: Mise à jour
19
19
  title: Modifier la page
20
20
  update:
21
21
  invalid: Il y a eu des erreurs lors de la sauvegarde de la page.
@@ -5,9 +5,9 @@ it:
5
5
  name: Pagina
6
6
  settings:
7
7
  global:
8
- comments_enabled: Commenti abilitati
8
+ announcement: Annuncio
9
9
  step:
10
- comments_blocked: Commenti bloccati
10
+ announcement: Annuncio
11
11
  pages:
12
12
  admin:
13
13
  models:
@@ -3,3 +3,20 @@ nl:
3
3
  features:
4
4
  pages:
5
5
  name: Pagina
6
+ settings:
7
+ global:
8
+ announcement: Aankondiging
9
+ step:
10
+ announcement: Aankondiging
11
+ pages:
12
+ admin:
13
+ models:
14
+ components:
15
+ body: Lichaam
16
+ pages:
17
+ edit:
18
+ save: Bijwerken
19
+ title: Pagina bewerken
20
+ update:
21
+ invalid: Er zijn fouten geweest bij het opslaan van de pagina.
22
+ success: Pagina is succesvol opgeslagen.
@@ -3,3 +3,20 @@ pl:
3
3
  features:
4
4
  pages:
5
5
  name: Strona
6
+ settings:
7
+ global:
8
+ announcement: Ogłoszenie
9
+ step:
10
+ announcement: Ogłoszenie
11
+ pages:
12
+ admin:
13
+ models:
14
+ components:
15
+ body: Treść
16
+ pages:
17
+ edit:
18
+ save: Aktualizuj
19
+ title: Edytuj stronę
20
+ update:
21
+ invalid: Podczas zapisywania strony wystąpiły błędy.
22
+ success: Strona została zapisana pomyślnie.
@@ -0,0 +1,22 @@
1
+ uk:
2
+ decidim:
3
+ features:
4
+ pages:
5
+ name: Сторінка
6
+ settings:
7
+ global:
8
+ announcement: Оголошення
9
+ step:
10
+ announcement: Оголошення
11
+ pages:
12
+ admin:
13
+ models:
14
+ components:
15
+ body: Основний текст
16
+ pages:
17
+ edit:
18
+ save: Оновити
19
+ title: Редагувати сторінку
20
+ update:
21
+ invalid: При збереженні цієї сторінки сталися помилки.
22
+ success: Сторінку успішно збережено.
@@ -32,20 +32,11 @@ Decidim.register_feature(:pages) do |feature|
32
32
  pages.count
33
33
  end
34
34
 
35
- feature.register_stat :comments_count, tag: :comments do |features, start_at, end_at|
36
- pages = Decidim::Pages::Page.where(feature: features)
37
- pages = pages.where("created_at >= ?", start_at) if start_at.present?
38
- pages = pages.where("created_at <= ?", end_at) if end_at.present?
39
- Decidim::Comments::Comment.where(root_commentable: pages).count
40
- end
41
-
42
35
  feature.settings(:global) do |settings|
43
- settings.attribute :comments_enabled, type: :boolean, default: true
44
36
  settings.attribute :announcement, type: :text, translated: true, editor: true
45
37
  end
46
38
 
47
39
  feature.settings(:step) do |settings|
48
- settings.attribute :comments_blocked, type: :boolean, default: false
49
40
  settings.attribute :announcement, type: :text, translated: true, editor: true
50
41
  end
51
42
 
@@ -53,21 +44,19 @@ Decidim.register_feature(:pages) do |feature|
53
44
  resource.model_class_name = "Decidim::Pages::Page"
54
45
  end
55
46
 
56
- feature.seeds do |process|
47
+ feature.seeds do |participatory_space|
57
48
  feature = Decidim::Feature.create!(
58
- name: Decidim::Features::Namer.new(process.organization.available_locales, :pages).i18n_name,
49
+ name: Decidim::Features::Namer.new(participatory_space.organization.available_locales, :pages).i18n_name,
59
50
  manifest_name: :pages,
60
51
  published_at: Time.current,
61
- participatory_process: process
52
+ participatory_space: participatory_space
62
53
  )
63
54
 
64
- page = Decidim::Pages::Page.create!(
55
+ Decidim::Pages::Page.create!(
65
56
  feature: feature,
66
57
  body: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
67
58
  Decidim::Faker::Localized.paragraph(3)
68
59
  end
69
60
  )
70
-
71
- Decidim::Comments::Seed.comments_for(page)
72
61
  end
73
62
  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.5.1
4
+ version: 0.6.0
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-08-21 00:00:00.000000000 Z
13
+ date: 2017-09-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,56 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.5.1
21
+ version: 0.6.0
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.5.1
28
+ version: 0.6.0
29
29
  - !ruby/object:Gem::Dependency
30
- name: decidim-comments
30
+ name: rectify
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '='
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 0.5.1
35
+ version: 0.9.1
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.5.1
42
+ version: 0.9.1
43
43
  - !ruby/object:Gem::Dependency
44
- name: rectify
44
+ name: decidim-dev
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
47
+ - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.9.1
50
- type: :runtime
49
+ version: 0.6.0
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.9.1
56
+ version: 0.6.0
57
57
  - !ruby/object:Gem::Dependency
58
- name: decidim-dev
58
+ name: decidim-participatory_processes
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.5.1
63
+ version: 0.6.0
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.5.1
70
+ version: 0.6.0
71
71
  description: A pages component for decidim's participatory processes.
72
72
  email:
73
73
  - josepjaume@gmail.com
@@ -94,7 +94,6 @@ files:
94
94
  - app/views/decidim/pages/admin/pages/_form.html.erb
95
95
  - app/views/decidim/pages/admin/pages/edit.html.erb
96
96
  - app/views/decidim/pages/application/show.html.erb
97
- - config/i18n-tasks.yml
98
97
  - config/locales/ca.yml
99
98
  - config/locales/en.yml
100
99
  - config/locales/es.yml
@@ -104,6 +103,7 @@ files:
104
103
  - config/locales/it.yml
105
104
  - config/locales/nl.yml
106
105
  - config/locales/pl.yml
106
+ - config/locales/uk.yml
107
107
  - db/migrate/20161116121353_create_decidim_pages.rb
108
108
  - db/migrate/20161214150429_add_commentable_to_pages.rb
109
109
  - db/migrate/20170110145040_remove_commentable_flag_from_pages.rb
@@ -1,6 +0,0 @@
1
- base_locale: en
2
- ignore_unused:
3
- - "decidim.features.pages.name"
4
- - "decidim.features.pages.settings.*"
5
- search:
6
- strict: false