decidim-conferences 0.23.6 → 0.24.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/conferences/conference_speaker/show.erb +1 -1
  3. data/app/cells/decidim/conferences/media_link/show.erb +1 -1
  4. data/app/cells/decidim/conferences/media_link_cell.rb +1 -0
  5. data/app/commands/decidim/conferences/admin/create_conference_speaker.rb +40 -18
  6. data/app/commands/decidim/conferences/admin/create_partner.rb +33 -14
  7. data/app/commands/decidim/conferences/admin/invite_user_to_join_conference.rb +1 -1
  8. data/app/commands/decidim/conferences/admin/update_conference_speaker.rb +41 -17
  9. data/app/commands/decidim/conferences/admin/update_partner.rb +30 -10
  10. data/app/controllers/decidim/conferences/admin/imports_controller.rb +14 -0
  11. data/app/controllers/decidim/conferences/admin/moderations/reports_controller.rb +14 -0
  12. data/app/forms/decidim/conferences/admin/conference_speaker_form.rb +1 -1
  13. data/app/forms/decidim/conferences/admin/media_link_form.rb +1 -1
  14. data/app/forms/decidim/conferences/admin/partner_form.rb +2 -1
  15. data/app/models/decidim/conference_meeting.rb +1 -1
  16. data/app/models/decidim/conference_speaker.rb +1 -1
  17. data/app/models/decidim/conference_speaker_conference_meeting.rb +2 -2
  18. data/app/models/decidim/conferences/conference_meeting_registration_type.rb +2 -2
  19. data/app/models/decidim/conferences/registration_type.rb +1 -1
  20. data/app/permissions/decidim/conferences/permissions.rb +1 -1
  21. data/app/presenters/decidim/conferences/conference_stats_presenter.rb +1 -1
  22. data/app/views/decidim/conferences/admin/partners/_form.html.erb +1 -1
  23. data/app/views/layouts/decidim/admin/conference.html.erb +2 -1
  24. data/config/locales/ar.yml +0 -4
  25. data/config/locales/ca.yml +7 -4
  26. data/config/locales/cs.yml +12 -5
  27. data/config/locales/de.yml +10 -3
  28. data/config/locales/el.yml +0 -4
  29. data/config/locales/en.yml +10 -3
  30. data/config/locales/es-MX.yml +7 -4
  31. data/config/locales/es-PY.yml +7 -4
  32. data/config/locales/es.yml +8 -5
  33. data/config/locales/eu.yml +0 -4
  34. data/config/locales/fi-plain.yml +11 -4
  35. data/config/locales/fi.yml +11 -4
  36. data/config/locales/fr-CA.yml +10 -3
  37. data/config/locales/fr.yml +10 -3
  38. data/config/locales/gl.yml +0 -4
  39. data/config/locales/hu.yml +0 -4
  40. data/config/locales/id-ID.yml +0 -4
  41. data/config/locales/it.yml +1 -5
  42. data/config/locales/ja.yml +6 -4
  43. data/config/locales/lv.yml +0 -4
  44. data/config/locales/nl.yml +130 -129
  45. data/config/locales/no.yml +0 -4
  46. data/config/locales/pl.yml +12 -5
  47. data/config/locales/pt-BR.yml +0 -4
  48. data/config/locales/pt.yml +0 -4
  49. data/config/locales/ro-RO.yml +0 -54
  50. data/config/locales/sk.yml +0 -4
  51. data/config/locales/sv.yml +6 -4
  52. data/config/locales/tr-TR.yml +7 -4
  53. data/config/locales/zh-CN.yml +0 -4
  54. data/lib/decidim/api/conference_media_link_type.rb +18 -0
  55. data/lib/decidim/api/conference_partner_type.rb +19 -0
  56. data/lib/decidim/api/conference_speaker_type.rb +23 -0
  57. data/lib/decidim/api/conference_type.rb +42 -0
  58. data/lib/decidim/conferences/admin_engine.rb +3 -1
  59. data/lib/decidim/conferences/api.rb +10 -0
  60. data/lib/decidim/conferences/engine.rb +7 -1
  61. data/lib/decidim/conferences/participatory_space.rb +25 -25
  62. data/lib/decidim/conferences/query_extensions.rb +43 -0
  63. data/lib/decidim/conferences/test/factories.rb +6 -6
  64. data/lib/decidim/conferences/version.rb +1 -1
  65. data/lib/decidim/conferences.rb +1 -0
  66. metadata +22 -18
  67. data/app/types/decidim/conferences/conference_media_link_type.rb +0 -19
  68. data/app/types/decidim/conferences/conference_partner_type.rb +0 -20
  69. data/app/types/decidim/conferences/conference_speaker_type.rb +0 -24
  70. data/app/types/decidim/conferences/conference_type.rb +0 -45
@@ -265,10 +265,6 @@ pt:
265
265
  conferences:
266
266
  conference_registration:
267
267
  confirm: "%{user_name} confirmou o registro da conferência em %{resource_name} conferência"
268
- partner:
269
- create: "%{user_name} criado %{resource_name} para a conferência %{space_name}"
270
- delete: "%{user_name} removeu o usuário %{resource_name} da conferência de %{space_name}"
271
- update: "%{user_name} atualizado %{resource_name} na conferência de %{space_name}"
272
268
  registration_type:
273
269
  create: "%{user_name} criou o tipo de registro %{resource_name} na conferência de %{space_name}"
274
270
  publish: "%{user_name} publicou o tipo de registro %{resource_name} na conferência %{space_name}"
@@ -266,10 +266,6 @@ pt:
266
266
  conferences:
267
267
  conference_registration:
268
268
  confirm: "%{user_name} confirmou um registo da conferência na conferência %{resource_name}"
269
- partner:
270
- create: "%{user_name} criou %{resource_name} na conferência %{space_name}"
271
- delete: "%{user_name} removeu o administrador %{resource_name} da conferência %{space_name}"
272
- update: "%{user_name} atualizou %{resource_name} na conferência %{space_name}"
273
269
  registration_type:
274
270
  create: "%{user_name} criou o tipo de registo %{resource_name} na conferência %{space_name}"
275
271
  publish: "%{user_name} publicou o tipo de registo %{resource_name} na conferência %{space_name}"
@@ -1,53 +1,4 @@
1
1
  ro:
2
- activemodel:
3
- attributes:
4
- conference:
5
- assemblies_ids: Organizații asemănătoare
6
- banner_image: Imagine pentru banner
7
- consultations_ids: Consultări conexe
8
- copy_categories: Copiază categoriile
9
- copy_components: Copiază componentele
10
- copy_features: Copiază caracteristici
11
- decidim_scope_id: Domeniu de interes
12
- description: Descriere
13
- hashtag: Hashtag
14
- hero_image: Imagine pagina principală
15
- participatory_processes_ids: Procese participative conexe
16
- promoted: Evidenţiat
17
- published_at: Publicat la
18
- scope_id: Domeniu de interes
19
- scopes_enabled: Domenii de interes activate
20
- short_description: Descriere scurtă
21
- show_statistics: Arată statistici
22
- slogan: Slogan
23
- slug: Adresă URL
24
- title: Titlu
25
- conference_speaker:
26
- full_name: Numele complet
27
- conference_user_role:
28
- email: E-mail
29
- name: Nume
30
- role: Rol
31
- errors:
32
- models:
33
- conference_registration_invite:
34
- attributes:
35
- email:
36
- already_invited: Acest e-mail a fost deja invitat
37
- activerecord:
38
- models:
39
- decidim/conference:
40
- one: Conferinţă
41
- few: Conferințe
42
- other: Conferințe
43
- decidim/conference_speaker:
44
- one: Vorbitor la conferință
45
- few: Vorbitori la conferință
46
- other: Vorbitori la conferință
47
- decidim/conference_user_role:
48
- one: Rolul utilizatorului în cadrul conferinței
49
- few: Rolurile utilizatorului în cadrul conferinței
50
- other: Rolurile utilizatorului în cadrul conferinței
51
2
  decidim:
52
3
  admin:
53
4
  actions:
@@ -269,10 +220,6 @@ ro:
269
220
  conferences:
270
221
  conference_registration:
271
222
  confirm: "%{user_name} a confirmat înregistrarea conferinței în %{resource_name} conferință"
272
- partner:
273
- create: "%{user_name} a creat %{resource_name} la conferința %{space_name}"
274
- delete: "%{user_name} a eliminat administratorul %{resource_name} de la conferința %{space_name}"
275
- update: "%{user_name} a actualizat %{resource_name} la conferința %{space_name}"
276
223
  registration_type:
277
224
  create: "%{user_name} a creat tipul de înregistrare %{resource_name} în conferința %{space_name}"
278
225
  publish: "%{user_name} a publicat tipul de înregistrare %{resource_name} în conferința %{space_name}"
@@ -479,7 +426,6 @@ ro:
479
426
  index:
480
427
  choose_an_option: 'Alegeți opțiunea de înregistrare:'
481
428
  login_as: Ești autentificat ca %{name} <%{email}>
482
- no_registrations: Fără înregistrări
483
429
  register: Inregistrare
484
430
  title: Tipuri de înregistrare
485
431
  shared:
@@ -272,10 +272,6 @@ sk:
272
272
  conferences:
273
273
  conference_registration:
274
274
  confirm: "%{user_name} potvrdil registráciu na konferencii %{resource_name}"
275
- partner:
276
- create: "%{user_name} pridal %{resource_name} do konferencie %{space_name}"
277
- delete: "%{user_name} odstránil administrátora %{resource_name} z konferencie %{space_name}"
278
- update: "%{user_name} zmenil %{resource_name} v konferencii %{space_name}"
279
275
  registration_type:
280
276
  create: "%{user_name} vytvoril typ registrácie %{resource_name} na konferencii %{space_name}"
281
277
  publish: "%{user_name} publikoval typ registrácie %{resource_name} na konferencii %{space_name}"
@@ -266,10 +266,6 @@ sv:
266
266
  conferences:
267
267
  conference_registration:
268
268
  confirm: "%{user_name} bekräftade en konferensregistrering till konferensen %{resource_name}"
269
- partner:
270
- create: "%{user_name} skapade %{resource_name} på konferensen %{space_name}"
271
- delete: "%{user_name} tog bort administratören %{resource_name} från konferensen %{space_name}"
272
- update: "%{user_name} uppdaterade %{resource_name} på konferensen %{space_name}"
273
269
  registration_type:
274
270
  create: "%{user_name} skapade registreringstypen %{resource_name} på konferensen %{space_name}"
275
271
  publish: "%{user_name} publicerade registreringstypen %{resource_name} till konferensen %{space_name}"
@@ -539,6 +535,12 @@ sv:
539
535
  email_outro: Du har fått det här meddelandet eftersom du följer konferensen "%{resource_title}". Du kan sluta att följa den från föregående länk.
540
536
  email_subject: Konferensen "%{resource_title}" kommer!
541
537
  notification_title: Konferensen <a href="%{resource_path}">%{resource_title}</a> börjar om två dagar.
538
+ help:
539
+ participatory_spaces:
540
+ conferences:
541
+ contextual: "<p>En <strong>konferens</strong> är en samling av möten som arrangeras i ett program, med ett antal personer inbjudna som talare, och andra informationsfält typiska för stora kongresser eller sociala evenemang (registrering, förteckning över organisationer som stöder eller sponsrar evenemanget, etc.).</p> <p>Exempel: En konferens kan vara ett relevant evenemang för en organisation och dess medlemmar, eller äga rum som en del av en deltagarprocess eller följa ett samråd.</p>\n"
542
+ page: "<p>En <strong>konferens</strong> är en samling av möten som arrangeras i ett program, med ett antal personer inbjudna som talare, och andra informationsfält typiska för stora kongresser eller sociala evenemang (registrering, förteckning över organisationer som stöder eller sponsrar evenemanget, etc.).</p> <p>Exempel: En konferens kan vara ett relevant evenemang för en organisation och dess medlemmar, eller äga rum som en del av en deltagarprocess eller följa ett samråd.</p>\n"
543
+ title: Vad är konferenser?
542
544
  log:
543
545
  value_types:
544
546
  conference_presenter:
@@ -266,10 +266,6 @@ tr:
266
266
  conferences:
267
267
  conference_registration:
268
268
  confirm: "%{user_name} , %{resource_name} konferansta bir konferans kaydını onayladı"
269
- partner:
270
- create: "%{user_name} %{space_name} konferansa %{resource_name} oluşturuldu"
271
- delete: "%{user_name} kullanıcı uzaklaştırıldı %{resource_name} den %{space_name} konferans"
272
- update: "%{user_name} %{space_name} konferansta %{resource_name} güncellendi"
273
269
  registration_type:
274
270
  create: "%{user_name} , %{space_name} konferansta %{resource_name} kayıt tipini oluşturdu"
275
271
  publish: "%{user_name} , %{space_name} konferansta %{resource_name} kayıt tipini yayınladı"
@@ -402,6 +398,7 @@ tr:
402
398
  personal_website: Kişisel web sitesi
403
399
  show:
404
400
  more_info: Daha fazla bilgi
401
+ speaking_at: Konuşma
405
402
  conference_speaker_cell:
406
403
  personal_url:
407
404
  personal_website: Kişisel web sitesi
@@ -539,6 +536,12 @@ tr:
539
536
  email_outro: '"%{resource_title}" konferansını izlediğiniz için bu bildirimi aldınız. Bir önceki bağlantıdan takip etmeyi bırakabilirsiniz.'
540
537
  email_subject: '"%{resource_title}" konferansı geliyor!'
541
538
  notification_title: <a href="%{resource_path}">%{resource_title}</a> konferans 2 gün içinde geliyor.
539
+ help:
540
+ participatory_spaces:
541
+ conferences:
542
+ contextual: "<p> <strong> Konferans </strong>, çok sayıda kişinin konuşmacı olarak davet edildiği bir programda düzenlenen toplantılar ve büyük kongreler veya sosyal etkinlikler için tipik olan diğer bilgi alanları (kayıt, destek veren kuruluşların listesi) veya etkinlik sponsoru vb. </p> <p> Örnekler: Bir konferans, bir kuruluş ve üyeleri için alakalı bir etkinlik olabilir veya katılımcı bir sürecin parçası olarak veya bir danışma sürecini takiben gerçekleşebilir. </p>\n"
543
+ page: "<p> <strong> Konferans </strong>, çok sayıda kişinin konuşmacı olarak davet edildiği bir programda düzenlenen toplantılar ve büyük kongreler veya sosyal etkinlikler için tipik olan diğer bilgi alanları (kayıt, destek veren kuruluşların listesi) veya etkinlik sponsoru vb. </p> <p> Örnekler: Bir konferans, bir kuruluş ve üyeleri için alakalı bir etkinlik olabilir veya katılımcı bir sürecin parçası olarak veya bir danışma sürecini takiben gerçekleşebilir. </p>\n"
544
+ title: Konferans nedir?
542
545
  log:
543
546
  value_types:
544
547
  conference_presenter:
@@ -263,10 +263,6 @@ zh-CN:
263
263
  conferences:
264
264
  conference_registration:
265
265
  confirm: "%{user_name} 在 %{resource_name} 次会议上确认了会议注册"
266
- partner:
267
- create: "%{user_name} 创建了 %{resource_name} 到 %{space_name} 会议"
268
- delete: "%{user_name} 将 %{resource_name} 管理员从 %{space_name} 次会议中删除"
269
- update: "%{user_name} 在 %{space_name} 次会议上更新 %{resource_name}"
270
266
  registration_type:
271
267
  create: "%{user_name} 在 %{space_name} 次会议上创建了 %{resource_name} 注册类型"
272
268
  publish: "%{user_name} 在 %{space_name} 次会议上发布了 %{resource_name} 注册类型"
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ # This type represents a conference.
6
+ class ConferenceMediaLinkType < Decidim::Api::Types::BaseObject
7
+ description "A conference media link"
8
+
9
+ field :id, GraphQL::Types::ID, "Internal ID for this media link", null: false
10
+ field :title, Decidim::Core::TranslatedFieldType, "Title for this media link", null: true
11
+ field :link, GraphQL::Types::String, "URL for this media link", null: true
12
+ field :date, Decidim::Core::DateType, "Relevant date for the media link", null: true
13
+ field :weight, GraphQL::Types::Int, "Order of appearance in which it should be presented", null: true
14
+ field :created_at, Decidim::Core::DateTimeType, "The time this entry was created", null: true
15
+ field :updated_at, Decidim::Core::DateTimeType, "The time this entry was updated", null: true
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ # This type represents a conference.
6
+ class ConferencePartnerType < Decidim::Api::Types::BaseObject
7
+ description "A conference partner"
8
+
9
+ field :id, GraphQL::Types::ID, "ID of the resource", null: false
10
+ field :name, GraphQL::Types::String, "Partner name", null: true
11
+ field :partner_type, GraphQL::Types::String, "Partner type", null: true
12
+ field :weight, GraphQL::Types::Int, "Order of appearance in which it should be presented", null: true
13
+ field :link, GraphQL::Types::String, "Relevant URL for this partner", null: true
14
+ field :logo, GraphQL::Types::String, "Link to the partner's logo", null: true
15
+ field :created_at, Decidim::Core::DateTimeType, "The time this partner was created", null: true
16
+ field :updated_at, Decidim::Core::DateTimeType, "The time this partner was updated", null: true
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ # This type represents a conference.
6
+ class ConferenceSpeakerType < Decidim::Api::Types::BaseObject
7
+ description "A conference speaker"
8
+
9
+ field :id, GraphQL::Types::ID, "Internal ID of the speaker", null: false
10
+ field :full_name, GraphQL::Types::String, "Full name of the speaker", null: true
11
+ field :position, Decidim::Core::TranslatedFieldType, "Position of the speaker in the conference", null: true
12
+ field :affiliation, Decidim::Core::TranslatedFieldType, "Affiliation of the speaker", null: true
13
+ field :twitter_handle, GraphQL::Types::String, "Twitter handle", null: true
14
+ field :short_bio, Decidim::Core::TranslatedFieldType, "Short biography of the speaker", null: true
15
+ field :personal_url, GraphQL::Types::String, "Personal URL of the speaker", null: true
16
+ field :avatar, GraphQL::Types::String, "Avatar of the speaker", null: true
17
+ field :user, Decidim::Core::UserType, "Decidim user corresponding to this speaker", null: true
18
+
19
+ field :created_at, Decidim::Core::DateTimeType, "The time this member was created ", null: true
20
+ field :updated_at, Decidim::Core::DateTimeType, "The time this member was updated", null: true
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ # This type represents a conference.
6
+ class ConferenceType < Decidim::Api::Types::BaseObject
7
+ implements Decidim::Core::ParticipatorySpaceInterface
8
+ implements Decidim::Core::ScopableInterface
9
+ implements Decidim::Core::AttachableInterface
10
+
11
+ description "A conference"
12
+
13
+ field :id, GraphQL::Types::ID, "Internal ID for this conference", null: false
14
+ field :short_description, Decidim::Core::TranslatedFieldType, "The short description of this conference", null: true
15
+ field :description, Decidim::Core::TranslatedFieldType, "The description of this conference", null: true
16
+ field :slug, GraphQL::Types::String, "The slug of this conference", null: true
17
+ field :hashtag, GraphQL::Types::String, "The hashtag for this conference", null: true
18
+ field :slogan, Decidim::Core::TranslatedFieldType, "The slogan of the conference", null: true
19
+ field :location, String, "The location of this conference", null: true
20
+ field :created_at, Decidim::Core::DateTimeType, "The time this conference was created", null: true
21
+ field :updated_at, Decidim::Core::DateTimeType, "The time this conference was updated", null: true
22
+ field :published_at, Decidim::Core::DateTimeType, "The time this conference was published", null: true
23
+ field :reference, GraphQL::Types::String, "Reference prefix for this conference", null: true
24
+
25
+ field :hero_image, GraphQL::Types::String, "The hero image for this conference", null: true
26
+ field :banner_image, GraphQL::Types::String, "The banner image for this conference", null: true
27
+ field :promoted, GraphQL::Types::Boolean, "If this conference is promoted (therefore in the homepage)", null: true
28
+ field :objectives, Decidim::Core::TranslatedFieldType, "The objectives of the conference", null: true
29
+ field :show_statistics, GraphQL::Types::Boolean, "If this conference shows the statistics", null: true
30
+ field :start_date, Decidim::Core::DateType, "The date this conference starts", null: true
31
+ field :end_date, Decidim::Core::DateType, "The date this conference ends", null: true
32
+ field :registrations_enabled, GraphQL::Types::Boolean, "If the registrations are enabled in this conference", null: true
33
+ field :available_slots, GraphQL::Types::Int, "The number of available slots in this conference", null: true
34
+ field :registration_terms, Decidim::Core::TranslatedFieldType, "The registration terms of this conference", null: true
35
+
36
+ field :speakers, [Decidim::Conferences::ConferenceSpeakerType, { null: true }], "List of speakers in this conference", null: true
37
+ field :partners, [Decidim::Conferences::ConferencePartnerType, { null: true }], "List of partners in this conference", null: true
38
+ field :categories, [Decidim::Core::CategoryType, { null: true }], "List of categories in this conference", null: true
39
+ field :media_links, [Decidim::Conferences::ConferenceMediaLinkType, { null: true }], "List of media links in this conference", null: true
40
+ end
41
+ end
42
+ end
@@ -61,6 +61,7 @@ module Decidim
61
61
  get :share
62
62
  end
63
63
  resources :exports, only: :create
64
+ resources :imports, only: [:new, :create]
64
65
  end
65
66
 
66
67
  resources :moderations do
@@ -69,6 +70,7 @@ module Decidim
69
70
  put :hide
70
71
  put :unhide
71
72
  end
73
+ resources :reports, controller: "moderations/reports", only: [:index, :show]
72
74
  end
73
75
  end
74
76
 
@@ -92,7 +94,7 @@ module Decidim
92
94
  menu.item I18n.t("menu.conferences", scope: "decidim.admin"),
93
95
  decidim_admin_conferences.conferences_path,
94
96
  icon_name: "microphone",
95
- position: 3.5,
97
+ position: 2.8,
96
98
  active: :inclusive,
97
99
  if: allowed_to?(:enter, :space_area, space_name: :conferences)
98
100
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ autoload :ConferenceType, "decidim/api/conference_type"
6
+ autoload :ConferenceMediaLinkType, "decidim/api/conference_media_link_type"
7
+ autoload :ConferencePartnerType, "decidim/api/conference_partner_type"
8
+ autoload :ConferenceSpeakerType, "decidim/api/conference_speaker_type"
9
+ end
10
+ end
@@ -5,6 +5,8 @@ require "active_support/all"
5
5
  require "decidim/core"
6
6
  require "wicked_pdf"
7
7
 
8
+ require "decidim/conferences/query_extensions"
9
+
8
10
  module Decidim
9
11
  module Conferences
10
12
  # Decidim's Conferences Rails Engine.
@@ -67,7 +69,7 @@ module Decidim
67
69
  Decidim.menu :menu do |menu|
68
70
  menu.item I18n.t("menu.conferences", scope: "decidim"),
69
71
  decidim_conferences.conferences_path,
70
- position: 6,
72
+ position: 2.8,
71
73
  if: Decidim::Conference.where(organization: current_organization).published.any?,
72
74
  active: :inclusive
73
75
  end
@@ -79,6 +81,10 @@ module Decidim
79
81
  content_block.public_name_key = "decidim.conferences.content_blocks.highlighted_conferences.name"
80
82
  end
81
83
  end
84
+
85
+ initializer "decidim_conferences.query_extensions" do
86
+ Decidim::Api::QueryType.include Decidim::Conferences::QueryExtensions
87
+ end
82
88
  end
83
89
  end
84
90
  end
@@ -53,15 +53,15 @@ Decidim.register_participatory_space(:conferences) do |participatory_space|
53
53
 
54
54
  2.times do |_n|
55
55
  conference = Decidim::Conference.create!(
56
- title: Decidim::Faker::Localized.sentence(5),
57
- slogan: Decidim::Faker::Localized.sentence(2),
58
- slug: Faker::Internet.unique.slug(nil, "-"),
56
+ title: Decidim::Faker::Localized.sentence(word_count: 5),
57
+ slogan: Decidim::Faker::Localized.sentence(word_count: 2),
58
+ slug: Decidim::Faker::Internet.unique.slug(words: nil, glue: "-"),
59
59
  hashtag: "##{Faker::Lorem.word}",
60
60
  short_description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
61
- Decidim::Faker::Localized.sentence(3)
61
+ Decidim::Faker::Localized.sentence(word_count: 3)
62
62
  end,
63
63
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
64
- Decidim::Faker::Localized.paragraph(3)
64
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
65
65
  end,
66
66
  organization: organization,
67
67
  hero_image: File.new(File.join(seeds_root, "city.jpeg")), # Keep after organization
@@ -69,14 +69,14 @@ Decidim.register_participatory_space(:conferences) do |participatory_space|
69
69
  promoted: true,
70
70
  published_at: 2.weeks.ago,
71
71
  objectives: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
72
- Decidim::Faker::Localized.paragraph(3)
72
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
73
73
  end,
74
74
  start_date: Time.current,
75
75
  end_date: 2.months.from_now.at_midnight,
76
76
  registrations_enabled: [true, false].sample,
77
77
  available_slots: (10..50).step(10).to_a.sample,
78
78
  registration_terms: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
79
- Decidim::Faker::Localized.paragraph(3)
79
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
80
80
  end
81
81
  )
82
82
  conference.add_to_index_as_search_resource
@@ -106,37 +106,37 @@ Decidim.register_participatory_space(:conferences) do |participatory_space|
106
106
 
107
107
  attachment_collection = Decidim::AttachmentCollection.create!(
108
108
  name: Decidim::Faker::Localized.word,
109
- description: Decidim::Faker::Localized.sentence(5),
109
+ description: Decidim::Faker::Localized.sentence(word_count: 5),
110
110
  collection_for: conference
111
111
  )
112
112
 
113
113
  Decidim::Attachment.create!(
114
- title: Decidim::Faker::Localized.sentence(2),
115
- description: Decidim::Faker::Localized.sentence(5),
114
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
115
+ description: Decidim::Faker::Localized.sentence(word_count: 5),
116
116
  attachment_collection: attachment_collection,
117
117
  attached_to: conference,
118
118
  file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
119
119
  )
120
120
 
121
121
  Decidim::Attachment.create!(
122
- title: Decidim::Faker::Localized.sentence(2),
123
- description: Decidim::Faker::Localized.sentence(5),
122
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
123
+ description: Decidim::Faker::Localized.sentence(word_count: 5),
124
124
  attached_to: conference,
125
125
  file: File.new(File.join(seeds_root, "city.jpeg")) # Keep after attached_to
126
126
  )
127
127
 
128
128
  Decidim::Attachment.create!(
129
- title: Decidim::Faker::Localized.sentence(2),
130
- description: Decidim::Faker::Localized.sentence(5),
129
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
130
+ description: Decidim::Faker::Localized.sentence(word_count: 5),
131
131
  attached_to: conference,
132
132
  file: File.new(File.join(seeds_root, "Exampledocument.pdf")) # Keep after attached_to
133
133
  )
134
134
 
135
135
  2.times do
136
136
  Decidim::Category.create!(
137
- name: Decidim::Faker::Localized.sentence(5),
137
+ name: Decidim::Faker::Localized.sentence(word_count: 5),
138
138
  description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
139
- Decidim::Faker::Localized.paragraph(3)
139
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
140
140
  end,
141
141
  participatory_space: conference
142
142
  )
@@ -147,9 +147,9 @@ Decidim.register_participatory_space(:conferences) do |participatory_space|
147
147
  user: conference.organization.users.sample,
148
148
  full_name: Faker::Name.name,
149
149
  position: Decidim::Faker::Localized.word,
150
- affiliation: Decidim::Faker::Localized.paragraph(3),
150
+ affiliation: Decidim::Faker::Localized.paragraph(sentence_count: 3),
151
151
  short_bio: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
152
- Decidim::Faker::Localized.paragraph(3)
152
+ Decidim::Faker::Localized.paragraph(sentence_count: 3)
153
153
  end,
154
154
  twitter_handle: Faker::Twitter.unique.screen_name,
155
155
  personal_url: Faker::Internet.url,
@@ -161,7 +161,7 @@ Decidim.register_participatory_space(:conferences) do |participatory_space|
161
161
  4.times do
162
162
  Decidim::Conferences::Partner.create!(
163
163
  name: Faker::Name.name,
164
- weight: Faker::Number.between(1, 10),
164
+ weight: Faker::Number.between(from: 1, to: 10),
165
165
  link: Faker::Internet.url,
166
166
  partner_type: type,
167
167
  conference: conference,
@@ -172,20 +172,20 @@ Decidim.register_participatory_space(:conferences) do |participatory_space|
172
172
 
173
173
  5.times do
174
174
  Decidim::Conferences::MediaLink.create!(
175
- title: Decidim::Faker::Localized.sentence(2),
175
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
176
176
  link: Faker::Internet.url,
177
177
  date: Date.current,
178
- weight: Faker::Number.between(1, 10),
178
+ weight: Faker::Number.between(from: 1, to: 10),
179
179
  conference: conference
180
180
  )
181
181
  end
182
182
 
183
183
  5.times do
184
184
  Decidim::Conferences::RegistrationType.create!(
185
- title: Decidim::Faker::Localized.sentence(2),
186
- description: Decidim::Faker::Localized.sentence(5),
187
- weight: Faker::Number.between(1, 10),
188
- price: Faker::Number.between(1, 300),
185
+ title: Decidim::Faker::Localized.sentence(word_count: 2),
186
+ description: Decidim::Faker::Localized.sentence(word_count: 5),
187
+ weight: Faker::Number.between(from: 1, to: 10),
188
+ price: Faker::Number.between(from: 1, to: 300),
189
189
  published_at: 2.weeks.ago,
190
190
  conference: conference
191
191
  )
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Conferences
5
+ # This module's job is to extend the API with custom fields related to
6
+ # decidim-assemblies.
7
+ module QueryExtensions
8
+ # Public: Extends a type with `decidim-assemblies`'s fields.
9
+ #
10
+ # type - A GraphQL::BaseType to extend.
11
+ #
12
+ # Returns nothing.
13
+ def self.included(type)
14
+ type.field :conferences,
15
+ [Decidim::Conferences::ConferenceType],
16
+ null: true,
17
+ description: "Lists all conferences" do
18
+ argument :filter, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputFilter, "This argument lets you filter the results", required: false
19
+ argument :order, Decidim::ParticipatoryProcesses::ParticipatoryProcessInputSort, "This argument lets you order the results", required: false
20
+ end
21
+
22
+ type.field :conference,
23
+ Decidim::Conferences::ConferenceType,
24
+ null: true,
25
+ description: "Finds a conference" do
26
+ argument :id, GraphQL::Types::ID, "The ID of the participatory space", required: false
27
+ end
28
+ end
29
+
30
+ def conferences(filter: {}, order: {})
31
+ manifest = Decidim.participatory_space_manifests.select { |m| m.name == :conferences }.first
32
+
33
+ Decidim::Core::ParticipatorySpaceListBase.new(manifest: manifest).call(object, { filter: filter, order: order }, context)
34
+ end
35
+
36
+ def conference(id: nil)
37
+ manifest = Decidim.participatory_space_manifests.select { |m| m.name == :conferences }.first
38
+
39
+ Decidim::Core::ParticipatorySpaceFinderBase.new(manifest: manifest).call(object, { id: id }, context)
40
+ end
41
+ end
42
+ end
43
+ end
@@ -5,7 +5,7 @@ require "decidim/dev"
5
5
 
6
6
  FactoryBot.define do
7
7
  sequence(:conference_slug) do |n|
8
- "#{Faker::Internet.slug(nil, "-")}-#{n}"
8
+ "#{Decidim::Faker::Internet.slug(words: nil, glue: "-")}-#{n}"
9
9
  end
10
10
 
11
11
  factory :conference, class: "Decidim::Conference" do
@@ -19,7 +19,7 @@ FactoryBot.define do
19
19
  hero_image { Decidim::Dev.test_file("city.jpeg", "image/jpeg") } # Keep after organization
20
20
  banner_image { Decidim::Dev.test_file("city2.jpeg", "image/jpeg") } # Keep after organization
21
21
  published_at { Time.current }
22
- location { Faker::Lorem.sentence(3) }
22
+ location { Faker::Lorem.sentence(word_count: 3) }
23
23
  show_statistics { true }
24
24
  start_date { 1.month.ago }
25
25
  end_date { 1.month.ago + 3.days }
@@ -133,8 +133,8 @@ FactoryBot.define do
133
133
  title { generate_localized_title }
134
134
  description { Decidim::Faker::Localized.wrapped("<p>", "</p>") { generate_localized_title } }
135
135
  published_at { Time.current }
136
- price { Faker::Number.between(1, 300) }
137
- weight { Faker::Number.between(1, 10) }
136
+ price { Faker::Number.between(from: 1, to: 300) }
137
+ weight { Faker::Number.between(from: 1, to: 10) }
138
138
 
139
139
  trait :unpublished do
140
140
  published_at { nil }
@@ -181,7 +181,7 @@ FactoryBot.define do
181
181
  conference
182
182
 
183
183
  name { Faker::Name.name }
184
- weight { Faker::Number.between(1, 10) }
184
+ weight { Faker::Number.between(from: 1, to: 10) }
185
185
  link { Faker::Internet.url }
186
186
  partner_type { "main_promotor" }
187
187
  logo { Decidim::Dev.test_file("avatar.jpg", "image/jpeg") }
@@ -198,7 +198,7 @@ FactoryBot.define do
198
198
  factory :media_link, class: "Decidim::Conferences::MediaLink" do
199
199
  conference
200
200
  title { generate_localized_title }
201
- weight { Faker::Number.between(1, 10) }
201
+ weight { Faker::Number.between(from: 1, to: 10) }
202
202
  link { Faker::Internet.url }
203
203
  date { 1.month.ago }
204
204
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-conferences version.
5
5
  module Conferences
6
6
  def self.version
7
- "0.23.6"
7
+ "0.24.0.rc1"
8
8
  end
9
9
  end
10
10
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "decidim/conferences/admin"
4
+ require "decidim/conferences/api"
4
5
  require "decidim/conferences/engine"
5
6
  require "decidim/conferences/admin_engine"
6
7
  require "decidim/conferences/participatory_space"