decidim-feeds 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE-AGPLv3.txt +661 -0
  3. data/README.md +39 -0
  4. data/Rakefile +9 -0
  5. data/app/cells/decidim/feeds/content_blocks/feeds_settings_form/show.erb +3 -0
  6. data/app/cells/decidim/feeds/content_blocks/feeds_settings_form_cell.rb +23 -0
  7. data/app/cells/decidim/feeds/feed_cell.rb +24 -0
  8. data/app/cells/decidim/feeds/feed_dropdown_metadata_cell.rb +19 -0
  9. data/app/cells/decidim/feeds/feed_g_cell.rb +33 -0
  10. data/app/cells/decidim/feeds/feed_metadata_g_cell.rb +25 -0
  11. data/app/cells/decidim/feeds/feed_s_cell.rb +13 -0
  12. data/app/commands/decidim/feeds/admin/create_feed.rb +90 -0
  13. data/app/commands/decidim/feeds/admin/update_feed.rb +85 -0
  14. data/app/commands/decidim/feeds/create_feed.rb +90 -0
  15. data/app/commands/decidim/feeds/update_feed.rb +73 -0
  16. data/app/constraints/decidim/feeds/current_component.rb +28 -0
  17. data/app/constraints/decidim/feeds/current_feed.rb +43 -0
  18. data/app/controllers/concerns/decidim/feeds/feed_breadcrumb.rb +36 -0
  19. data/app/controllers/decidim/feeds/admin/application_controller.rb +26 -0
  20. data/app/controllers/decidim/feeds/admin/components_controller.rb +14 -0
  21. data/app/controllers/decidim/feeds/admin/concerns/feed_admin.rb +51 -0
  22. data/app/controllers/decidim/feeds/admin/feeds_controller.rb +92 -0
  23. data/app/controllers/decidim/feeds/application_controller.rb +37 -0
  24. data/app/controllers/decidim/feeds/feeds_controller.rb +137 -0
  25. data/app/forms/decidim/feeds/admin/feed_form.rb +102 -0
  26. data/app/forms/decidim/feeds/feed_form.rb +70 -0
  27. data/app/helpers/decidim/feeds/admin/feeds_admin_menu_helper.rb +10 -0
  28. data/app/helpers/decidim/feeds/application_helper.rb +16 -0
  29. data/app/helpers/decidim/feeds/feeds_helper.rb +38 -0
  30. data/app/models/decidim/feeds/application_record.rb +10 -0
  31. data/app/models/decidim/feeds/feed.rb +113 -0
  32. data/app/packs/entrypoints/decidim_feeds.js +5 -0
  33. data/app/packs/entrypoints/decidim_feeds.scss +1 -0
  34. data/app/packs/images/decidim/feeds/decidim_feeds.svg +1 -0
  35. data/app/packs/images/decidim/feeds/icon.svg +1 -0
  36. data/app/packs/src/decidim/feeds/feeds.js +0 -0
  37. data/app/packs/stylesheets/decidim/feeds/_variables.scss +10 -0
  38. data/app/packs/stylesheets/decidim/feeds/feeds.scss +3 -0
  39. data/app/permissions/decidim/feeds/permissions.rb +53 -0
  40. data/app/presenters/decidim/feeds/admin_log/feed_presenter.rb +46 -0
  41. data/app/queries/decidim/feeds/admin/admin_users.rb +60 -0
  42. data/app/queries/decidim/feeds/organization_feeds.rb +16 -0
  43. data/app/views/decidim/feeds/admin/feeds/_form.html.erb +66 -0
  44. data/app/views/decidim/feeds/admin/feeds/edit.html.erb +20 -0
  45. data/app/views/decidim/feeds/admin/feeds/index.html.erb +65 -0
  46. data/app/views/decidim/feeds/admin/feeds/new.html.erb +20 -0
  47. data/app/views/decidim/feeds/feeds/_form.html.erb +18 -0
  48. data/app/views/decidim/feeds/feeds/edit.html.erb +10 -0
  49. data/app/views/decidim/feeds/feeds/index.html.erb +5 -0
  50. data/app/views/decidim/feeds/feeds/new.html.erb +20 -0
  51. data/app/views/decidim/feeds/feeds/show.html.erb +33 -0
  52. data/app/views/layouts/decidim/admin/_manage_feeds.html.erb +11 -0
  53. data/app/views/layouts/decidim/admin/feed.html.erb +17 -0
  54. data/app/views/layouts/decidim/admin/feeds.html.erb +17 -0
  55. data/app/views/layouts/decidim/feed.html.erb +18 -0
  56. data/config/assets.rb +9 -0
  57. data/config/i18n-tasks.yml +10 -0
  58. data/config/locales/bs.yml +75 -0
  59. data/config/locales/de.yml +77 -0
  60. data/config/locales/en.yml +75 -0
  61. data/config/locales/hr.yml +75 -0
  62. data/config/locales/it.yml +75 -0
  63. data/config/locales/sr.yml +75 -0
  64. data/config/locales/tr.yml +75 -0
  65. data/lib/decidim/api/feed_type.rb +30 -0
  66. data/lib/decidim/feeds/admin.rb +10 -0
  67. data/lib/decidim/feeds/admin_engine.rb +81 -0
  68. data/lib/decidim/feeds/api.rb +9 -0
  69. data/lib/decidim/feeds/content_blocks/content_blocks_homepage.rb +19 -0
  70. data/lib/decidim/feeds/engine.rb +83 -0
  71. data/lib/decidim/feeds/menu.rb +106 -0
  72. data/lib/decidim/feeds/participatory_space.rb +52 -0
  73. data/lib/decidim/feeds/seeds.rb +47 -0
  74. data/lib/decidim/feeds/test/factories.rb +17 -0
  75. data/lib/decidim/feeds/version.rb +9 -0
  76. data/lib/decidim/feeds.rb +13 -0
  77. metadata +142 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ de:
3
+ decidim:
4
+ feeds:
5
+ feeds:
6
+ index:
7
+ new_feed: Neuer Feed
8
+ show:
9
+ show_posts: Beiträge anzeigen
10
+ edit: Bearbeiten
11
+ posts_component_not_found: Beitragskomponente nicht gefunden
12
+ new:
13
+ title: Neuer Feed
14
+ create: Feed erstellen
15
+ edit:
16
+ update: Feed aktualisieren
17
+ form:
18
+ title: Titel
19
+ create:
20
+ error: Feed-Erstellung fehlgeschlagen
21
+ success: Feed erfolgreich erstellt
22
+ update:
23
+ success: Feed erfolgreich aktualisiert
24
+ error: Feed-Aktualisierung fehlgeschlagen
25
+ admin:
26
+ feeds:
27
+ index:
28
+ new_info_page_info: "Für die Feeds UI benötigen sie eine Seite mit dem URL Slug \"info\""
29
+ new_info_page_button: Neue Info-Seite erstellen
30
+ form:
31
+ title: Titel
32
+ slug_help_html: 'URL-Slugs werden zum Generieren der URLs verwendet, die auf diesen Feed verweisen. Akzeptiert werden nur Buchstaben, Zahlen und Bindestriche und es muss mit einem Buchstaben beginnen. Beispiel: %{url}'
33
+ sponsor_logos: Sponsor-Logos
34
+ add_sponsor_logo: Sponsor-Logo hinzufügen
35
+ replace_sponsor_logo: Sponsor-Logo ersetzen
36
+ content_blocks:
37
+ feeds:
38
+ name: Feed
39
+ survey:
40
+ participated: "%{count} Antworten"
41
+ shared:
42
+ flag_modal:
43
+ report: Melden
44
+ endorsement_buttons_cell:
45
+ already_endorsed: Gefällt mir
46
+ admin:
47
+ feeds:
48
+ new:
49
+ title: Neuer Feed
50
+ create: Feed erstellen
51
+ create:
52
+ success: Feed erfolgreich erstellt
53
+ invalid: Erstellen des Feeds fehlgeschlagen
54
+ error: Erstellen des Feeds fehlgeschlagen
55
+ edit:
56
+ title: Feed bearbeiten
57
+ update: Feed aktualisieren
58
+ update:
59
+ success: Feed erfolgreich aktualisiert
60
+ invalid: Aktualisieren des Feeds fehlgeschlagen
61
+ menu:
62
+ feeds: Feeds
63
+ feeds_submenu:
64
+ components: Komponenten
65
+ info: Über diesen Feed
66
+ moderations: Moderationen
67
+ see_feed: Feed anzeigen
68
+ titles:
69
+ feeds: Feeds
70
+ actions:
71
+ new_feed: Neuer Feed
72
+ models:
73
+ feed:
74
+ fields:
75
+ title: Titel
76
+ created_at: Erstellt am
77
+ actions: Aktionen
@@ -0,0 +1,75 @@
1
+ ---
2
+ en:
3
+ decidim:
4
+ feeds:
5
+ feeds:
6
+ index:
7
+ new_feed: New Feed
8
+ show:
9
+ show_posts: Show posts
10
+ edit: Edit
11
+ posts_component_not_found: Posts component not found
12
+ new:
13
+ title: New Feed
14
+ create: Create Feed
15
+ edit:
16
+ update: Update Feed
17
+ form:
18
+ title: Title
19
+ create:
20
+ error: Feed creation failed
21
+ success: Feed created successfully
22
+ update:
23
+ success: Feed updated successfully
24
+ error: Feed update failed
25
+ admin:
26
+ feeds:
27
+ index:
28
+ new_info_page_info: "For the Feeds UI, you need a page with the URL slug \"info\""
29
+ new_info_page_button: Create new info page
30
+ form:
31
+ title: Title
32
+ slug_help_html: 'URL slugs are used to generate the URLs that point to this feed. Only accepts letters, numbers and dashes, and must start with a letter. Example: %{url}'
33
+ sponsor_logos: Sponsor Logos
34
+ add_sponsor_logo: Add Sponsor Logo
35
+ replace_sponsor_logo: Replace Sponsor Logo
36
+ content_blocks:
37
+ feeds:
38
+ name: Feed
39
+ survey:
40
+ participated: "%{count} responses"
41
+ shared:
42
+ flag_modal:
43
+ report: Report
44
+ admin:
45
+ feeds:
46
+ new:
47
+ title: New Feed
48
+ create: Create Feed
49
+ create:
50
+ success: Feed created successfully
51
+ invalid: Feed creation failed
52
+ error: Feed creation failed
53
+ edit:
54
+ title: Edit Feed
55
+ update: Update Feed
56
+ update:
57
+ success: Feed updated successfully
58
+ invalid: Feed update failed
59
+ menu:
60
+ feeds: Feeds
61
+ feeds_submenu:
62
+ components: Components
63
+ info: About this feed
64
+ moderations: Moderations
65
+ see_feed: See feed
66
+ titles:
67
+ feeds: Feeds
68
+ actions:
69
+ new_feed: New Feed
70
+ models:
71
+ feed:
72
+ fields:
73
+ title: Title
74
+ created_at: Created at
75
+ actions: Actions
@@ -0,0 +1,75 @@
1
+ ---
2
+ hr:
3
+ decidim:
4
+ feeds:
5
+ feeds:
6
+ index:
7
+ new_feed: Novi Feed
8
+ show:
9
+ show_posts: Prikazi postove
10
+ edit: Uredi
11
+ posts_component_not_found: Postovi nisu pronađeni
12
+ new:
13
+ title: Novi Feed
14
+ create: Kreiraj Feed
15
+ edit:
16
+ update: Ažuriraj Feed
17
+ form:
18
+ title: Naslov
19
+ create:
20
+ error: Kreiranje feeda nije uspjelo
21
+ success: Feed uspješno kreiran
22
+ update:
23
+ success: Feed uspješno ažuriran
24
+ error: Ažuriranje feeda nije uspjelo
25
+ admin:
26
+ feeds:
27
+ index:
28
+ new_info_page_info: "Za Feeds UI, potrebna vam je stranica s URL slugom \"info\""
29
+ new_info_page_button: Kreiraj novu info stranicu
30
+ form:
31
+ title: Naslov
32
+ slug_help_html: 'URL slugovi se koriste za generiranje URL-ova koji upućuju na ovaj feed. Prihvaća samo slova, brojeve i crtice, i mora početi slovom. Primjer: %{url}'
33
+ sponsor_logos: Sponsor Logos
34
+ add_sponsor_logo: Dodaj Sponsor Logo
35
+ replace_sponsor_logo: Zamijeni Sponsor Logo
36
+ content_blocks:
37
+ feeds:
38
+ name: Feed
39
+ survey:
40
+ participated: "%{count} odgovora"
41
+ shared:
42
+ flag_modal:
43
+ report: Prijavi
44
+ admin:
45
+ feeds:
46
+ new:
47
+ title: Novi Feed
48
+ create: Kreiraj Feed
49
+ create:
50
+ success: Feed uspješno kreiran
51
+ invalid: Kreiranje feeda nije uspjelo
52
+ error: Kreiranje feeda nije uspjelo
53
+ edit:
54
+ title: Uredi Feed
55
+ update: Ažuriraj Feed
56
+ update:
57
+ success: Feed uspješno ažuriran
58
+ invalid: Ažuriranje feeda nije uspjelo
59
+ menu:
60
+ feeds: Feedovi
61
+ feeds_submenu:
62
+ components: Komponente
63
+ info: O ovom feedu
64
+ moderations: Moderacije
65
+ see_feed: Pogledaj feed
66
+ titles:
67
+ feeds: Feedovi
68
+ actions:
69
+ new_feed: Novi Feed
70
+ models:
71
+ feed:
72
+ fields:
73
+ title: Naslov
74
+ created_at: Kreirano
75
+ actions: Akcije
@@ -0,0 +1,75 @@
1
+ ---
2
+ it:
3
+ decidim:
4
+ feeds:
5
+ feeds:
6
+ index:
7
+ new_feed: Nuovo feed
8
+ show:
9
+ show_posts: Mostra post
10
+ edit: Modifica
11
+ posts_component_not_found: Componente post non trovato
12
+ new:
13
+ title: Nuovo feed
14
+ create: Crea feed
15
+ edit:
16
+ update: Aggiorna feed
17
+ form:
18
+ title: Titolo
19
+ create:
20
+ error: Creazione del feed fallita
21
+ success: Feed creato con successo
22
+ update:
23
+ success: Feed aggiornato con successo
24
+ error: Aggiornamento del feed fallito
25
+ admin:
26
+ feeds:
27
+ index:
28
+ new_info_page_info: "Per l'interfaccia utente dei feed, è necessaria una pagina con lo slug URL \"info\""
29
+ new_info_page_button: Crea nuova pagina di informazioni
30
+ form:
31
+ title: Titolo
32
+ slug_help_html: 'Gli URL slugs vengono utilizzati per generare gli URL che puntano a questa feed. Accetta solo lettere, numeri e trattini e deve iniziare con una lettera. Esempio: %{url}'
33
+ sponsor_logos: Sponsor Logos
34
+ add_sponsor_logo: Aggiungi Sponsor Logo
35
+ replace_sponsor_logo: Sostituisci Sponsor Logo
36
+ content_blocks:
37
+ feeds:
38
+ name: Feed
39
+ survey:
40
+ participated: "%{count} risposte"
41
+ shared:
42
+ flag_modal:
43
+ report: Segnala
44
+ admin:
45
+ feeds:
46
+ new:
47
+ title: Nuovo feed
48
+ create: Crea feed
49
+ create:
50
+ success: Feed creato con successo
51
+ invalid: Creazione del feed fallita
52
+ error: Creazione del feed fallita
53
+ edit:
54
+ title: Modifica feed
55
+ update: Aggiorna feed
56
+ update:
57
+ success: Feed aggiornato con successo
58
+ invalid: Aggiornamento del feed fallito
59
+ menu:
60
+ feeds: Feeds
61
+ feeds_submenu:
62
+ components: Componenti
63
+ info: Informazioni su questo feed
64
+ moderations: Moderazioni
65
+ see_feed: Vedi feed
66
+ titles:
67
+ feeds: Feeds
68
+ actions:
69
+ new_feed: Nuovo feed
70
+ models:
71
+ feed:
72
+ fields:
73
+ title: Titolo
74
+ created_at: Creato il
75
+ actions: Azioni
@@ -0,0 +1,75 @@
1
+ ---
2
+ sr:
3
+ decidim:
4
+ feeds:
5
+ feeds:
6
+ index:
7
+ new_feed: Novi Feed
8
+ show:
9
+ show_posts: Prikazi postove
10
+ edit: Uredi
11
+ posts_component_not_found: Postovi nisu pronađeni
12
+ new:
13
+ title: Novi Feed
14
+ create: Kreiraj Feed
15
+ edit:
16
+ update: Ažuriraj Feed
17
+ form:
18
+ title: Naslov
19
+ create:
20
+ error: Kreiranje feeda nije uspelo
21
+ success: Feed uspešno kreiran
22
+ update:
23
+ success: Feed uspešno ažuriran
24
+ error: Ažuriranje feeda nije uspelo
25
+ admin:
26
+ feeds:
27
+ index:
28
+ new_info_page_info: "Za Feeds UI, potrebna vam je stranica s URL slugom \"info\""
29
+ new_info_page_button: Kreiraj novu info stranicu
30
+ form:
31
+ title: Naslov
32
+ slug_help_html: 'URL slugovi se koriste za generisanje URL-ova koji upućuju na ovaj feed. Prihvata samo slova, brojeve i crtice, i mora početi slovom. Primer: %{url}'
33
+ sponsor_logos: Sponsor Logos
34
+ add_sponsor_logo: Dodaj Sponsor Logo
35
+ replace_sponsor_logo: Zamijeni Sponsor Logo
36
+ content_blocks:
37
+ feeds:
38
+ name: Feed
39
+ survey:
40
+ participated: "%{count} odgovora"
41
+ shared:
42
+ flag_modal:
43
+ report: Prijavi
44
+ admin:
45
+ feeds:
46
+ new:
47
+ title: Novi Feed
48
+ create: Kreiraj Feed
49
+ create:
50
+ success: Feed uspešno kreiran
51
+ invalid: Kreiranje feeda nije uspelo
52
+ error: Kreiranje feeda nije uspelo
53
+ edit:
54
+ title: Uredi Feed
55
+ update: Ažuriraj Feed
56
+ update:
57
+ success: Feed uspešno ažuriran
58
+ invalid: Ažuriranje feeda nije uspelo
59
+ menu:
60
+ feeds: Feedovi
61
+ feeds_submenu:
62
+ components: Komponente
63
+ info: O ovom feedu
64
+ moderations: Moderacije
65
+ see_feed: Pogledaj feed
66
+ titles:
67
+ feeds: Feedovi
68
+ actions:
69
+ new_feed: Novi Feed
70
+ models:
71
+ feed:
72
+ fields:
73
+ title: Naslov
74
+ created_at: Kreirano
75
+ actions: Akcije
@@ -0,0 +1,75 @@
1
+ ---
2
+ tr:
3
+ decidim:
4
+ feeds:
5
+ feeds:
6
+ index:
7
+ new_feed: Yeni Feed
8
+ show:
9
+ show_posts: Gönderileri Göster
10
+ edit: Düzenle
11
+ posts_component_not_found: Gönderi bileşeni bulunamadı
12
+ new:
13
+ title: Yeni Feed
14
+ create: Feed Oluştur
15
+ edit:
16
+ update: Feed'i Güncelle
17
+ form:
18
+ title: Başlık
19
+ create:
20
+ error: Feed oluşturma başarısız oldu
21
+ success: Feed başarıyla oluşturuldu
22
+ update:
23
+ success: Feed başarıyla güncellendi
24
+ error: Feed güncelleme başarısız oldu
25
+ admin:
26
+ feeds:
27
+ index:
28
+ new_info_page_info: "Feeds UI için \"info\" URL slug'ına sahip bir sayfaya ihtiyacınız var"
29
+ new_info_page_button: Yeni bilgi sayfası oluştur
30
+ form:
31
+ title: Başlık
32
+ slug_help_html: "URL slugları, bu feed'e işaret eden URL'leri oluşturmak için kullanılır. Sadece harfler, rakamlar ve tireler kabul edilir ve bir harfle başlamalıdır. Örnek: %{url}"
33
+ sponsor_logos: Sponsor Logoları
34
+ add_sponsor_logo: Sponsor Logosu Ekle
35
+ replace_sponsor_logo: Sponsor Logosunu Değiştir
36
+ content_blocks:
37
+ feeds:
38
+ name: Feed
39
+ survey:
40
+ participated: "%{count} yanıt"
41
+ shared:
42
+ flag_modal:
43
+ report: Rapor Et
44
+ admin:
45
+ feeds:
46
+ new:
47
+ title: Yeni Feed
48
+ create: Feed Oluştur
49
+ create:
50
+ success: Feed başarıyla oluşturuldu
51
+ invalid: Feed oluşturma başarısız oldu
52
+ error: Feed oluşturma başarısız oldu
53
+ edit:
54
+ title: Feed'i Düzenle
55
+ update: Feed'i Güncelle
56
+ update:
57
+ success: Feed başarıyla güncellendi
58
+ invalid: Feed güncelleme başarısız oldu
59
+ menu:
60
+ feeds: Feedler
61
+ feeds_submenu:
62
+ components: Bileşenler
63
+ info: Bu feed hakkında
64
+ moderations: Moderasyonlar
65
+ see_feed: Feed'i Görüntüle
66
+ titles:
67
+ feeds: Feedler
68
+ actions:
69
+ new_feed: Yeni Feed
70
+ models:
71
+ feed:
72
+ fields:
73
+ title: Başlık
74
+ created_at: Oluşturulma Tarihi
75
+ actions: Eylemler
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Feeds
5
+ # This type represents a Feed.
6
+ class FeedType < Decidim::Api::Types::BaseObject
7
+ implements Decidim::Core::ParticipatorySpaceInterface
8
+ implements Decidim::Core::AttachableInterface
9
+ implements Decidim::Core::ParticipatorySpaceResourceableInterface
10
+ implements Decidim::Core::CategoriesContainerInterface
11
+
12
+ description "A feed"
13
+
14
+ field :id, ID, "The internal ID for this feed", null: false
15
+ field :slug, String, "The slug of this feed", null: false
16
+ field :created_at, Decidim::Core::DateTimeType, "The time this feed was created", null: false
17
+ field :updated_at, Decidim::Core::DateTimeType, "The time this feed was updated", null: false
18
+
19
+ field :created_by, String, "The creator of this feed", null: true
20
+
21
+ # def hero_image
22
+ # object.attached_uploader(:hero_image).path
23
+ # end
24
+
25
+ # def banner_image
26
+ # object.attached_uploader(:banner_image).path
27
+ # end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Feeds
5
+ # This module contains all the domain logic associated to Decidim's Feeds
6
+ # component admin panel.
7
+ module Admin
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "decidim/core"
4
+ require "decidim/feeds/menu"
5
+
6
+ module Decidim
7
+ module Feeds
8
+ # This is the engine that runs on the public interface of `Feeds`.
9
+ class AdminEngine < ::Rails::Engine
10
+ isolate_namespace Decidim::Feeds::Admin
11
+
12
+ paths["db/migrate"] = nil
13
+ paths["lib/tasks"] = nil
14
+
15
+ routes do
16
+ # Add admin engine routes here
17
+ resources :feeds, param: :slug, except: [:show, :destroy] do
18
+ # collection do
19
+ # resources :exports, only: [:create]
20
+ # end
21
+ end
22
+
23
+ scope "/feeds/:feed_slug" do
24
+ # resources :categories, except: [:show]
25
+
26
+ resources :components do
27
+ resource :permissions, controller: "component_permissions"
28
+ member do
29
+ put :publish
30
+ put :unpublish
31
+ get :share
32
+ end
33
+ resources :exports, only: :create
34
+ #resources :imports, only: [:new, :create] do
35
+ # get :example, on: :collection
36
+ #end
37
+ #resources :reminders, only: [:new, :create]
38
+ end
39
+
40
+ resources :moderations do
41
+ member do
42
+ put :unreport
43
+ put :hide
44
+ put :unhide
45
+ end
46
+ resources :reports, controller: "moderations/reports", only: [:index, :show]
47
+ end
48
+ end
49
+
50
+ scope "/feeds/:feed_slug/components/:component_id/manage" do
51
+ Decidim.component_manifests.each do |manifest|
52
+ next unless manifest.admin_engine
53
+
54
+ constraints CurrentComponent.new(manifest) do
55
+ mount manifest.admin_engine, at: "/", as: "decidim_admin_feed_#{manifest.name}"
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+ def load_seed
62
+ nil
63
+ end
64
+
65
+ initializer "decidim_feeds_admin.action_controller" do |app|
66
+ app.config.to_prepare do
67
+ ActiveSupport.on_load :action_controller do
68
+ helper Decidim::Feeds::Admin::FeedsAdminMenuHelper if respond_to?(:helper)
69
+ end
70
+ end
71
+ end
72
+
73
+ initializer "decidim_feeds_admin.menu" do
74
+ Decidim::Feeds::Menu.register_admin_menu_modules!
75
+ Decidim::Feeds::Menu.register_admin_feeds_components_menu!
76
+ Decidim::Feeds::Menu.register_admin_feed_menu!
77
+ Decidim::Feeds::Menu.register_admin_feeds_menu!
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Feeds
5
+ autoload :FeedType, "decidim/api/feed_type"
6
+ # autoload :AssemblyMemberType, "decidim/api/assembly_member_type"
7
+ # autoload :AssembliesTypeType, "decidim/api/assemblies_type_type"
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ # # frozen_string_literal: true
2
+
3
+ # def initialize_homepage_content_blocks
4
+ # initializer "Feeds.content_blocks" do
5
+ # Decidim.content_blocks.register(:homepage, :feeds) do |content_block|
6
+ # content_block.cell = "decidim/feeds/content_blocks/feeds"
7
+ # content_block.settings_form_cell = "decidim/feeds/content_blocks/feeds_settings_form"
8
+ # content_block.public_name_key = "decidim.feeds.content_blocks.feeds.name"
9
+
10
+ # content_block.settings do |settings|
11
+ # # settings.attribute :title, type: :text, translated: true
12
+ # # settings.attribute :link_text, type: :text, translated: true
13
+ # # settings.attribute :link_url, type: :text, translated: true
14
+ # # settings.attribute :count, type: :integer, default: 3
15
+ # settings.attribute :component_id, type: :integer
16
+ # end
17
+ # end
18
+ # end
19
+ # end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails"
4
+ require "decidim/core"
5
+
6
+ require "decidim/feeds/menu"
7
+
8
+ require_relative "content_blocks/content_blocks_homepage"
9
+
10
+ module Decidim
11
+ module Feeds
12
+ # This is the engine that runs on the public interface of feeds.
13
+ class Engine < ::Rails::Engine
14
+ routes do
15
+ # redirect feed id to feed slug
16
+ get "feeds/:feed_id", to: redirect { |params, _request|
17
+ feed = Decidim::Feeds::Feed.find(params[:feed_id])
18
+ feed ? "/feeds/#{feed.slug}" : "/404"
19
+ }, constraints: { feed_id: /[0-9]+/ }
20
+
21
+ # redirect feed id to feed slug
22
+ get "/feeds/:feed_id/f/:component_id", to: redirect { |params, _request|
23
+ feed = Decidim::Feeds::Feed.find(params[:feed_id])
24
+ feed ? "/feeds/#{feed.slug}/f/#{params[:component_id]}" : "/404"
25
+ }, constraints: { feed_id: /[0-9]+/ }
26
+
27
+ resources :feeds, only: [:index, :show, :new, :create, :edit, :update], param: :slug, path: "feeds" do
28
+ resources :feed_members, only: :index, path: "members"
29
+ end
30
+
31
+ scope "/feeds/:feed_slug/f/:component_id" do
32
+ Decidim.component_manifests.each do |manifest|
33
+ next unless manifest.engine
34
+
35
+ constraints CurrentComponent.new(manifest) do
36
+ mount manifest.engine, at: "/", as: "decidim_feed_#{manifest.name}"
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ isolate_namespace Decidim::Feeds
43
+
44
+ # initializer "decidim_feeds.overrides", after: "decidim.action_controller" do
45
+ # config.to_prepare do
46
+ # Decidim::HomepageController.include(Decidim::Feeds::NeedsContentBlocksSnippets)
47
+ # end
48
+ # end
49
+
50
+ initializer "decidim_feeds.snippets" do |app|
51
+ app.config.enable_html_header_snippets = true
52
+ end
53
+
54
+ initializer "decidim_feeds.add_cells_view_paths" do
55
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Feeds::Engine.root}/app/cells")
56
+ Cell::ViewModel.view_paths << File.expand_path("#{Decidim::Feeds::Engine.root}/app/views")
57
+ end
58
+
59
+ initializer "decidim_feeds.webpacker.assets_path" do
60
+ Decidim.register_assets_path File.expand_path("app/packs", root)
61
+ end
62
+
63
+ # initialize_homepage_content_blocks
64
+
65
+ initializer "decidim_feeds.register_icons" do
66
+ Decidim.icons.register(name: "function-line", icon: "function-line", category: "system", description: "", engine: :feeds)
67
+ Decidim.icons.register(name: "home-5-line", icon: "home-5-line", category: "system", description: "", engine: :feeds)
68
+ Decidim.icons.register(name: "recycle-line", icon: "recycle-line", category: "system", description: "", engine: :feeds)
69
+ Decidim.icons.register(name: "shake-hands-line", icon: "shake-hands-line", category: "system", description: "", engine: :feeds)
70
+ Decidim.icons.register(name: "gallery-fill", icon: "gallery-fill", category: "system", description: "", engine: :feeds)
71
+ Decidim.icons.register(name: "send-plane-line", icon: "send-plane-line", category: "system", description: "", engine: :feeds)
72
+ Decidim.icons.register(name: "image-add-line", icon: "image-add-line", category: "system", description: "", engine: :feeds)
73
+ Decidim.icons.register(name: "film-line", icon: "film-line", category: "system", description: "", engine: :feeds)
74
+ Decidim.icons.register(name: "file-add-line", icon: "file-add-line", category: "system", description: "", engine: :feeds)
75
+ Decidim.icons.register(name: "chat-4-line", icon: "chat-4-line", category: "communication", description: "", engine: :feeds)
76
+ Decidim.icons.register(name: "translate", icon: "translate", category: "editor", description: "", engine: :feeds)
77
+ Decidim.icons.register(name: "file-2-line", icon: "file-2-line", category: "editor", description: "", engine: :feeds)
78
+ Decidim.icons.register(name: "dislike", icon: "heart-fill", description: "Dislike", category: "action", engine: :feeds)
79
+ end
80
+
81
+ end
82
+ end
83
+ end