decidim-blogs 0.28.5 → 0.29.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/blogs/post_g_cell.rb +5 -1
  3. data/app/cells/decidim/blogs/post_l_cell.rb +5 -1
  4. data/app/commands/decidim/blogs/admin/create_post.rb +7 -37
  5. data/app/commands/decidim/blogs/admin/update_post.rb +4 -40
  6. data/app/controllers/decidim/blogs/admin/posts_controller.rb +7 -8
  7. data/app/forms/decidim/blogs/admin/post_form.rb +1 -1
  8. data/app/helpers/decidim/blogs/admin/posts_helper.rb +1 -1
  9. data/app/views/decidim/blogs/admin/posts/_form.html.erb +0 -2
  10. data/app/views/decidim/blogs/admin/posts/index.html.erb +2 -2
  11. data/config/locales/ar.yml +1 -3
  12. data/config/locales/bg.yml +1 -0
  13. data/config/locales/ca.yml +1 -1
  14. data/config/locales/cs.yml +1 -1
  15. data/config/locales/el.yml +1 -0
  16. data/config/locales/eu.yml +7 -7
  17. data/config/locales/fr-CA.yml +1 -1
  18. data/config/locales/fr.yml +1 -1
  19. data/config/locales/ga-IE.yml +1 -0
  20. data/config/locales/gl.yml +1 -0
  21. data/config/locales/hu.yml +1 -0
  22. data/config/locales/id-ID.yml +2 -0
  23. data/config/locales/is-IS.yml +2 -0
  24. data/config/locales/it.yml +2 -0
  25. data/config/locales/ko.yml +1 -0
  26. data/config/locales/lb.yml +2 -0
  27. data/config/locales/lt.yml +1 -0
  28. data/config/locales/lv.yml +2 -0
  29. data/config/locales/nl.yml +2 -1
  30. data/config/locales/no.yml +1 -0
  31. data/config/locales/pl.yml +1 -0
  32. data/config/locales/pt-BR.yml +1 -0
  33. data/config/locales/pt.yml +2 -0
  34. data/config/locales/ro-RO.yml +1 -0
  35. data/config/locales/ru.yml +1 -0
  36. data/config/locales/sk.yml +2 -0
  37. data/config/locales/sl.yml +5 -0
  38. data/config/locales/sq-AL.yml +1 -0
  39. data/config/locales/sv.yml +7 -28
  40. data/config/locales/tr-TR.yml +2 -0
  41. data/config/locales/uk.yml +2 -0
  42. data/config/locales/zh-CN.yml +2 -0
  43. data/config/locales/zh-TW.yml +1 -0
  44. data/decidim-blogs.gemspec +2 -2
  45. data/lib/decidim/api/blogs_type.rb +3 -1
  46. data/lib/decidim/api/post_type.rb +0 -13
  47. data/lib/decidim/blogs/test/factories.rb +1 -23
  48. data/lib/decidim/blogs/version.rb +1 -1
  49. metadata +21 -23
  50. data/config/locales/bn-BD.yml +0 -1
  51. data/config/locales/bs-BA.yml +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4ffc0b13b84d282bebd34186636d153aacfa1a9076f00384cda8649ee109514
4
- data.tar.gz: 6b4f609b3d92183e3fed05b2f5e52e974b89fbc38dbfd02c2cb02be947484e02
3
+ metadata.gz: 2d3e05fbe48097df47ffc82f4b2ebbde3fc54a955c8d2b2df9b56b38f75d1014
4
+ data.tar.gz: 0f053312ab155c859de24f3f0249876f301bedb5339eaa8ce5e82a49a9397d84
5
5
  SHA512:
6
- metadata.gz: 242c6a29b9f948d36f7c6e5825707f6c289c97f85bba883d47f839f56951c2a8390ab0c379f891525482096631983ac8dca1bee05f4fb15c292dc7449d7dc4bc
7
- data.tar.gz: 4e4314e721c6be205fde3e36f06c484718061026b3de1ff8b607fc10fefcb7cdcf72982b22504ae807a5e3ca464204fdb357813477072aeb7fa4292cc0fad7cf
6
+ metadata.gz: 0a46ed37e62404b0a957b8d4ac280233e34643f03d28f7248274539570a5dab1e43e459ee77ce2102f656b37fc9eb10c3f3a410b61b4f0cf56af58480aa7525f
7
+ data.tar.gz: b4fa8aea088a2ad4d7b68dd92e03028cfb88bc9ea97cb3ed845b7600b0df575116e2b9ad0d57d33c9cc3f1e9c263996b9311db0058c594252ec330641c91e836
@@ -9,6 +9,10 @@ module Decidim
9
9
 
10
10
  private
11
11
 
12
+ def has_image?
13
+ resource_image_path.present?
14
+ end
15
+
12
16
  def show_description?
13
17
  true
14
18
  end
@@ -17,7 +21,7 @@ module Decidim
17
21
  "decidim/blogs/post_metadata_g"
18
22
  end
19
23
 
20
- def resource_image_url
24
+ def resource_image_path
21
25
  return if photo.blank?
22
26
 
23
27
  photo.url
@@ -9,6 +9,10 @@ module Decidim
9
9
 
10
10
  private
11
11
 
12
+ def has_image?
13
+ true
14
+ end
15
+
12
16
  def has_description?
13
17
  true
14
18
  end
@@ -21,7 +25,7 @@ module Decidim
21
25
  "decidim/blogs/post_metadata"
22
26
  end
23
27
 
24
- def resource_image_url
28
+ def resource_image_path
25
29
  return if photo.blank?
26
30
 
27
31
  photo.url
@@ -5,51 +5,21 @@ module Decidim
5
5
  module Admin
6
6
  # This command is executed when the user creates a Post from the admin
7
7
  # panel.
8
- class CreatePost < Decidim::Command
9
- def initialize(form, current_user)
10
- @form = form
11
- @current_user = current_user
12
- end
13
-
14
- # Creates the post if valid.
15
- #
16
- # Broadcasts :ok if successful, :invalid otherwise.
17
- def call
18
- return broadcast(:invalid) if @form.invalid?
19
-
20
- transaction do
21
- create_post!
22
- send_notification
23
- end
24
-
25
- broadcast(:ok, @post)
26
- end
8
+ class CreatePost < Decidim::Commands::CreateResource
9
+ fetch_form_attributes :title, :body, :published_at, :author, :component
27
10
 
28
11
  private
29
12
 
30
- def create_post!
31
- attributes = {
32
- title: @form.title,
33
- body: @form.body,
34
- published_at: @form.published_at,
35
- component: @form.current_component,
36
- author: @form.author
37
- }
13
+ def resource_class = Decidim::Blogs::Post
38
14
 
39
- @post = Decidim.traceability.create!(
40
- Post,
41
- @current_user,
42
- attributes,
43
- visibility: "all"
44
- )
45
- end
15
+ def extra_params = { visibility: "all" }
46
16
 
47
- def send_notification
17
+ def run_after_hooks
48
18
  Decidim::EventsManager.publish(
49
19
  event: "decidim.events.blogs.post_created",
50
20
  event_class: Decidim::Blogs::CreatePostEvent,
51
- resource: @post,
52
- followers: @post.participatory_space.followers
21
+ resource:,
22
+ followers: resource.participatory_space.followers
53
23
  )
54
24
  end
55
25
  end
@@ -3,51 +3,15 @@
3
3
  module Decidim
4
4
  module Blogs
5
5
  module Admin
6
- # This command is executed when the user changes a Blog from the admin
6
+ # This command is executed when the user changes a Post from the admin
7
7
  # panel.
8
- class UpdatePost < Decidim::Command
9
- # Initializes a UpdateBlog Command.
10
- #
11
- # form - The form from which to get the data.
12
- # blog - The current instance of the page to be updated.
13
- def initialize(form, post, user)
14
- @form = form
15
- @post = post
16
- @user = user
17
- end
18
-
19
- # Updates the blog if valid.
20
- #
21
- # Broadcasts :ok if successful, :invalid otherwise.
22
- def call
23
- return broadcast(:invalid) if form.invalid?
24
-
25
- transaction do
26
- update_post!
27
- end
28
-
29
- broadcast(:ok, post)
30
- end
8
+ class UpdatePost < Decidim::Commands::UpdateResource
9
+ fetch_form_attributes :title, :body, :author
31
10
 
32
11
  private
33
12
 
34
- attr_reader :form, :post
35
-
36
- def update_post!
37
- Decidim.traceability.update!(
38
- post,
39
- @user,
40
- attributes
41
- )
42
- end
43
-
44
13
  def attributes
45
- {
46
- title: form.title,
47
- body: form.body,
48
- published_at: form.published_at,
49
- author: form.author
50
- }.reject do |attribute, value|
14
+ super.merge(published_at: form.published_at).reject do |attribute, value|
51
15
  value.blank? && attribute == :published_at
52
16
  end
53
17
  end
@@ -17,7 +17,7 @@ module Decidim
17
17
  enforce_permission_to :create, :blogpost
18
18
  @form = form(PostForm).from_params(params, current_component:)
19
19
 
20
- CreatePost.call(@form, current_user) do
20
+ CreatePost.call(@form) do
21
21
  on(:ok) do
22
22
  flash[:notice] = I18n.t("posts.create.success", scope: "decidim.blogs.admin")
23
23
  redirect_to posts_path
@@ -39,7 +39,7 @@ module Decidim
39
39
  enforce_permission_to :update, :blogpost, blogpost: post
40
40
  @form = form(PostForm).from_params(params, current_component:)
41
41
 
42
- UpdatePost.call(@form, post, current_user) do
42
+ UpdatePost.call(@form, post) do
43
43
  on(:ok) do
44
44
  flash[:notice] = I18n.t("posts.update.success", scope: "decidim.blogs.admin")
45
45
  redirect_to posts_path
@@ -55,13 +55,12 @@ module Decidim
55
55
  def destroy
56
56
  enforce_permission_to :destroy, :blogpost, blogpost: post
57
57
 
58
- Decidim.traceability.perform_action!("delete", post, current_user) do
59
- post.destroy!
58
+ Decidim::Commands::DestroyResource.call(post, current_user) do
59
+ on(:ok) do
60
+ flash[:notice] = I18n.t("posts.destroy.success", scope: "decidim.blogs.admin")
61
+ redirect_to posts_path
62
+ end
60
63
  end
61
-
62
- flash[:notice] = I18n.t("posts.destroy.success", scope: "decidim.blogs.admin")
63
-
64
- redirect_to posts_path
65
64
  end
66
65
 
67
66
  private
@@ -8,7 +8,7 @@ module Decidim
8
8
  include TranslatableAttributes
9
9
 
10
10
  translatable_attribute :title, String
11
- translatable_attribute :body, Decidim::Attributes::RichText
11
+ translatable_attribute :body, String
12
12
 
13
13
  attribute :decidim_author_id, Integer
14
14
  attribute :published_at, Decidim::Attributes::TimeWithZone
@@ -22,7 +22,7 @@ module Decidim
22
22
 
23
23
  def post_author_select_field(form, name, _options = {})
24
24
  select_options = [
25
- [current_organization.name, ""],
25
+ [current_organization_name, ""],
26
26
  [current_user.name, current_user.id]
27
27
  ]
28
28
  current_user_groups = Decidim::UserGroups::ManageableUserGroups.for(current_user).verified
@@ -2,9 +2,7 @@
2
2
  <div class="card pt-4">
3
3
  <div class="card-section">
4
4
  <div class="row column">
5
- <div class="field">
6
5
  <%= post_author_select_field form, :decidim_author_id, label: t("decidim.blogs.actions.author_id") %>
7
- </div>
8
6
  </div>
9
7
 
10
8
  <div class="row column">
@@ -15,7 +15,7 @@
15
15
  <th><%= t("models.post.fields.body", scope: "decidim.blogs") %></th>
16
16
  <th><%= t("models.post.fields.author", scope: "decidim.blogs") %></th>
17
17
  <th><%= t("models.post.fields.published_at", scope: "decidim.blogs") %></th>
18
- <th class="actions"><%= t("actions.title", scope: "decidim.blogs") %></th>
18
+ <th><%= t("actions.title", scope: "decidim.blogs") %></th>
19
19
  </tr>
20
20
  </thead>
21
21
  <tbody>
@@ -33,7 +33,7 @@
33
33
  <%= decidim_sanitize_editor post_description_admin(post) %>
34
34
  </td>
35
35
  <td>
36
- <%= post.try(:author).try(:name) %>
36
+ <%= translated_attribute(post.try(:author).try(:name)) %>
37
37
  </td>
38
38
  <% publish_data = publish_data(post.published_at) %>
39
39
  <td>
@@ -22,6 +22,7 @@ ar:
22
22
  blogs:
23
23
  actions:
24
24
  author_id: إنشاء مشاركة كـ
25
+ confirm_destroy: هل أنت متأكد أنك تريد حذف هذه المشاركة؟
25
26
  destroy: حذف
26
27
  edit: تعديل
27
28
  new: منشور جديد
@@ -43,9 +44,6 @@ ar:
43
44
  create: "%{user_name} أنشأ منشور المدونة %{resource_name} في %{space_name}"
44
45
  delete: "%{user_name} حذف منشور المدونة%{resource_name} من %{space_name}"
45
46
  update: "%{user_name} حدث منشور المدونة %{resource_name} في %{space_name}"
46
- content_blocks:
47
- highlighted_posts:
48
- name: المنشورات
49
47
  last_activity:
50
48
  new_post: 'منشور جديد:'
51
49
  models:
@@ -18,6 +18,7 @@ bg:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Създаване на публикация като
21
+ confirm_destroy: Сигурни ли сте, че желаете да изтриете тази публикация?
21
22
  destroy: Изтрий
22
23
  edit: Редактирай
23
24
  new: Нова публикация
@@ -19,7 +19,7 @@ ca:
19
19
  actions:
20
20
  author_id: Crear publicació com
21
21
  confirm_destroy: Segur que vols eliminar aquesta publicació?
22
- destroy: Esborrar
22
+ destroy: Suprimeix
23
23
  edit: Edita
24
24
  new: Nova publicació
25
25
  title: Accions
@@ -20,7 +20,7 @@ cs:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Vytvořit příspěvek jako
23
- confirm_destroy: Opravdu chcete odstranit tento příspěvek?
23
+ confirm_destroy: Opravdu chcete tento příspěvek smazat?
24
24
  destroy: Smazat
25
25
  edit: Upravit
26
26
  new: Nový příspěvek
@@ -18,6 +18,7 @@ el:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Δημιουργία ανάρτησης ως
21
+ confirm_destroy: Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτήν τη δημοσίευση;
21
22
  destroy: Διαγραφή
22
23
  edit: Επεξεργασία
23
24
  new: Νέα δημοσίευση
@@ -18,7 +18,7 @@ eu:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Sortu argitalpena hau bezala
21
- confirm_destroy: Ziur zaude korreo elektronikoa hau ezabatu nahi duzula?
21
+ confirm_destroy: Ziur zaude post hau argitalpen ezabatu nahi duzula?
22
22
  destroy: Ezabatu
23
23
  edit: Editatu
24
24
  new: Beste argitalpen bat
@@ -44,9 +44,9 @@ eu:
44
44
  success: Argitalpena zuzen gordea.
45
45
  admin_log:
46
46
  post:
47
- create: "%{user_name} parte-hartzailekak %{resource_name} blogeko argitalpena sortu du %{space_name} espazioan"
48
- delete: "%{user_name} parte-hartzailekak %{resource_name} blogeko argitalpena ezabatu du %{space_name} espazioan"
49
- update: "%{user_name} parte-hartzailekak %{resource_name} blogeko argitalpena eguneratu egin da %{space_name} espazioan"
47
+ create: "%{user_name} k %{resource_name} blogeko argitalpena sortu du %{space_name} espazioan"
48
+ delete: "%{user_name} k %{resource_name} blogeko argitalpena ezabatu du %{space_name} espazioan"
49
+ update: "%{user_name} k %{resource_name} blogeko argitalpena eguneratu egin da %{space_name} espazioan"
50
50
  content_blocks:
51
51
  highlighted_posts:
52
52
  last_published: Azken argitarapena
@@ -65,8 +65,8 @@ eu:
65
65
  posts:
66
66
  index:
67
67
  count:
68
- one: "Argitalpen %{count}"
69
- other: "%{count} argitalpen"
68
+ one: "%{count} argitalpen"
69
+ other: "%{count} edukin"
70
70
  empty: Oraindik ez dago argitalpenik.
71
71
  components:
72
72
  blogs:
@@ -93,6 +93,6 @@ eu:
93
93
  email_intro: '"%{resource_title}" argitalpena jarraitzen ari zaren "%{participatory_space_title}" espazioan argitaratu da.'
94
94
  email_outro: Jakinarazpena jaso duzu "%{participatory_space_title}" jarraitzen ari zarelako. Aurreko estekan utzi ahal diozu jarraitzeari.
95
95
  email_subject: Argitalpen berria %{participatory_space_title} espazioan
96
- notification_title: <a href="%{resource_path}">%{resource_title}</a> sarrera %{participatory_space_title} argitaratu da
96
+ notification_title: <a href="%{resource_path}">%{resource_title}</a> posta %{participatory_space_title} argitaratu da
97
97
  statistics:
98
98
  posts_count: Argitalpenak
@@ -18,7 +18,7 @@ fr-CA:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Créer un article comme
21
- confirm_destroy: Êtes-vous sûr(e) de vouloir supprimer cet article ?
21
+ confirm_destroy: Êtes-vous certain de vouloir supprimer cet article ?
22
22
  destroy: Supprimer
23
23
  edit: Modifier
24
24
  new: Nouvel article
@@ -18,7 +18,7 @@ fr:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Créer un article en tant que
21
- confirm_destroy: Êtes-vous sûr(e) de vouloir supprimer cet article ?
21
+ confirm_destroy: Êtes-vous certain de vouloir supprimer cet article ?
22
22
  destroy: Supprimer
23
23
  edit: Modifier
24
24
  new: Nouvel article
@@ -11,6 +11,7 @@ ga:
11
11
  decidim:
12
12
  blogs:
13
13
  actions:
14
+ destroy: Scrios
14
15
  edit: Eagar
15
16
  new: Postáil nua
16
17
  title: Gníomhartha
@@ -12,6 +12,7 @@ gl:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Crear publicación como
15
+ confirm_destroy: Tes a certeza de querer eliminar esta publicación?
15
16
  destroy: Eliminar
16
17
  edit: Editar
17
18
  new: Nova publicación
@@ -18,6 +18,7 @@ hu:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Bejegyzés létrehozása
21
+ confirm_destroy: Biztos, hogy törlöd ezt a bejegyzést?
21
22
  destroy: Törlés
22
23
  edit: Szerkesztés
23
24
  new: Új bejegyzés
@@ -10,6 +10,8 @@ id:
10
10
  decidim:
11
11
  blogs:
12
12
  actions:
13
+ confirm_destroy: Anda yakin ingin menghapus posting ini?
14
+ destroy: Menghapus
13
15
  edit: Edit
14
16
  new: Berita Baru
15
17
  title: Tindakan
@@ -3,6 +3,8 @@ is:
3
3
  decidim:
4
4
  blogs:
5
5
  actions:
6
+ confirm_destroy: Ertu viss um að þú viljir eyða þessu færslu?
7
+ destroy: Eyða
6
8
  edit: Breyta
7
9
  title: Aðgerðir
8
10
  admin:
@@ -12,6 +12,8 @@ it:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Crea post come
15
+ confirm_destroy: Sei sicuro di voler eliminare questo post?
16
+ destroy: Elimina
15
17
  edit: Modifica
16
18
  new: Nuovo post
17
19
  title: Azioni
@@ -8,6 +8,7 @@ ko:
8
8
  decidim:
9
9
  blogs:
10
10
  actions:
11
+ destroy: 삭제
11
12
  edit: 수정
12
13
  new: 새 게시물
13
14
  title: 작업
@@ -12,6 +12,8 @@ lb:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Beitrag erstellen als
15
+ confirm_destroy: Möchten Sie diesen Beitrag wirklich löschen?
16
+ destroy: Löschen
15
17
  edit: Bearbeiten
16
18
  new: Neuer Beitrag
17
19
  title: Aktionen
@@ -20,6 +20,7 @@ lt:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Sukurti įrašą kaip
23
+ confirm_destroy: Ar tikrai norite ištrinti šį įrašą?
23
24
  destroy: Ištrinti
24
25
  edit: Redaguoti
25
26
  new: Naujas įrašas
@@ -12,6 +12,8 @@ lv:
12
12
  decidim:
13
13
  blogs:
14
14
  actions:
15
+ confirm_destroy: Vai tiešām vēlaties dzēst šo ziņu?
16
+ destroy: Dzēst
15
17
  edit: Labot
16
18
  new: Jauna ziņa
17
19
  title: Darbības
@@ -12,7 +12,8 @@ nl:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Bericht aanmaken als
15
- destroy: Verwijderen
15
+ confirm_destroy: Weet je zeker dat je dit bericht wilt verwijderen?
16
+ destroy: Verwijder
16
17
  edit: Bewerk
17
18
  new: Nieuwe blogpost
18
19
  title: acties
@@ -12,6 +12,7 @@
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Opprett innlegg som
15
+ confirm_destroy: Er du sikker på at du vil slette dette innlegget?
15
16
  destroy: Slett
16
17
  edit: Editar
17
18
  new: Nytt innlegg
@@ -20,6 +20,7 @@ pl:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Utwórz wpis jako
23
+ confirm_destroy: Czy na pewno chcesz usunąć ten wpis?
23
24
  destroy: Usuń
24
25
  edit: Edytuj
25
26
  new: Nowy wpis
@@ -18,6 +18,7 @@ pt-BR:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Criar publicação como
21
+ confirm_destroy: Deseja mesmo excluir este post?
21
22
  destroy: Excluir
22
23
  edit: Editar
23
24
  new: Nova postagem
@@ -12,6 +12,8 @@ pt:
12
12
  blogs:
13
13
  actions:
14
14
  author_id: Criar publicação como
15
+ confirm_destroy: Tem a certeza de que deseja eliminar esta publicação?
16
+ destroy: Eliminar
15
17
  edit: Editar
16
18
  new: Nova publicação
17
19
  title: Ações
@@ -19,6 +19,7 @@ ro:
19
19
  blogs:
20
20
  actions:
21
21
  author_id: Creează postare ca
22
+ confirm_destroy: Sigur dorești să ştergi această postare?
22
23
  destroy: Șterge
23
24
  edit: Editează
24
25
  new: Postare nouă
@@ -20,6 +20,7 @@ ru:
20
20
  blogs:
21
21
  actions:
22
22
  author_id: Создать пост как
23
+ confirm_destroy: Вы действительно хотите удалить этот пост?
23
24
  destroy: Удалить
24
25
  edit: Редактировать
25
26
  new: Создать новый пост
@@ -13,6 +13,8 @@ sk:
13
13
  decidim:
14
14
  blogs:
15
15
  actions:
16
+ confirm_destroy: Naozaj chcete odstrániť tento príspevok?
17
+ destroy: Odstrániť
16
18
  edit: Upraviť
17
19
  new: Nový príspevok
18
20
  title: Akcie
@@ -1 +1,6 @@
1
+ ---
1
2
  sl:
3
+ decidim:
4
+ blogs:
5
+ actions:
6
+ destroy: Izbriši
@@ -18,6 +18,7 @@ sq:
18
18
  blogs:
19
19
  actions:
20
20
  author_id: Krijo postimin si
21
+ confirm_destroy: Je i sigurt që dëshiron ta fshish këtë postim?
21
22
  destroy: Fshij
22
23
  edit: Përpuno
23
24
  new: Postim i ri
@@ -5,7 +5,6 @@ sv:
5
5
  post:
6
6
  body: Innehåll
7
7
  decidim_author_id: Författare
8
- published_at: Publicerad
9
8
  title: Titel
10
9
  models:
11
10
  decidim/blogs/create_post_event: Nytt blogginlägg
@@ -18,38 +17,25 @@ sv:
18
17
  blogs:
19
18
  actions:
20
19
  author_id: Skapa inlägg som
21
- confirm_destroy: Är du säker på att du vill radera inlägget?
20
+ confirm_destroy: Vill du radera inlägget?
22
21
  destroy: Radera
23
22
  edit: Redigera
24
23
  new: Nytt inlägg
25
24
  title: Åtgärder
26
25
  admin:
27
26
  posts:
28
- create:
29
- invalid: Det gick inte att skapa inlägget.
30
- success: Inlägget har skapats.
31
- destroy:
32
- success: Inlägget har raderats.
33
27
  edit:
34
28
  save: Uppdatera
35
29
  title: Redigera inlägg
36
30
  index:
37
- not_published_yet: Ej publicerat.
38
31
  title: Inlägg
39
32
  new:
40
33
  create: Skapa
41
34
  title: Skapa inlägg
42
35
  update:
43
36
  invalid: Det gick inte att spara inlägget.
44
- success: Inlägget har sparats.
45
- admin_log:
46
- post:
47
- create: "%{user_name} skapade blogginlägget %{resource_name} i %{space_name}"
48
- delete: "%{user_name} raderade blogginlägget %{resource_name} från %{space_name}"
49
- update: "%{user_name} uppdaterade blogginlägget %{resource_name} i %{space_name}"
50
37
  content_blocks:
51
38
  highlighted_posts:
52
- last_published: Senast publicerade
53
39
  name: Inlägg
54
40
  see_all: Se alla inlägg
55
41
  last_activity:
@@ -60,33 +46,26 @@ sv:
60
46
  author: Författare
61
47
  body: Innehåll
62
48
  official_blog_post: Officiellt inlägg
63
- published_at: Publicerad
64
49
  title: Titel
65
- posts:
66
- index:
67
- count:
68
- one: "%{count} inlägg"
69
- other: "%{count} inlägg"
70
- empty: Det finns inga inlägg ännu.
71
50
  components:
72
51
  blogs:
73
52
  actions:
74
53
  comment: Kommentera
75
54
  create: Skapa
76
55
  destroy: Radera
77
- endorse: Gilla
56
+ endorse: Instäm
78
57
  update: Uppdatera
79
58
  name: Blogg
80
59
  settings:
81
60
  global:
82
61
  announcement: Meddelande
83
- comments_enabled: Aktivera kommentarer
84
- comments_max_length: Maximal kommentarslängd (ange 0 för att använda standardvärdet)
62
+ comments_enabled: Kommentarer aktiverade
63
+ comments_max_length: Maximal längd för kommentarer (Lämna 0 för standardvärde)
85
64
  step:
86
65
  announcement: Meddelande
87
- comments_blocked: Stäng av kommentarer
88
- endorsements_blocked: Blockera gilla-markeringar
89
- endorsements_enabled: Aktivera gilla-markeringar
66
+ comments_blocked: Kommentarer blockerade
67
+ endorsements_blocked: Instämmanden är blockerade
68
+ endorsements_enabled: Instämmanden tillåtna
90
69
  events:
91
70
  blogs:
92
71
  post_created:
@@ -17,6 +17,8 @@ tr:
17
17
  decidim:
18
18
  blogs:
19
19
  actions:
20
+ confirm_destroy: Bu yayını silmek istediğinize emin misiniz?
21
+ destroy: silmek
20
22
  edit: Düzenle
21
23
  new: Yeni posta
22
24
  title: Eylemler
@@ -13,6 +13,8 @@ uk:
13
13
  decidim:
14
14
  blogs:
15
15
  actions:
16
+ confirm_destroy: Ви дійсно бажаєте видалити цей проект?
17
+ destroy: Видалити
16
18
  edit: Редагувати
17
19
  new: Створити новий допис
18
20
  title: Дії
@@ -10,6 +10,8 @@ zh-CN:
10
10
  decidim:
11
11
  blogs:
12
12
  actions:
13
+ confirm_destroy: 您确定要删除此帖子?
14
+ destroy: 删除
13
15
  edit: 编辑
14
16
  new: 新建帖子
15
17
  title: 行动
@@ -17,6 +17,7 @@ zh-TW:
17
17
  blogs:
18
18
  actions:
19
19
  author_id: 發佈文章
20
+ confirm_destroy: 您確定要刪除此文章嗎?
20
21
  destroy: 刪除
21
22
  edit: 編輯
22
23
  new: 新貼文
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.version = Decidim::Blogs.version
11
11
  s.authors = ["Isaac Massot Gil"]
12
12
  s.email = ["isaac.mg@coditramuntana.com"]
13
- s.license = "AGPL-3.0-or-later"
13
+ s.license = "AGPL-3.0"
14
14
  s.homepage = "https://decidim.org"
15
15
  s.metadata = {
16
16
  "bug_tracker_uri" => "https://github.com/decidim/decidim/issues",
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  "homepage_uri" => "https://decidim.org",
20
20
  "source_code_uri" => "https://github.com/decidim/decidim"
21
21
  }
22
- s.required_ruby_version = "~> 3.1.0"
22
+ s.required_ruby_version = "~> 3.2.0"
23
23
 
24
24
  s.name = "decidim-blogs"
25
25
  s.summary = "Decidim blogs module"
@@ -2,7 +2,9 @@
2
2
 
3
3
  module Decidim
4
4
  module Blogs
5
- class BlogsType < Decidim::Core::ComponentType
5
+ class BlogsType < Decidim::Api::Types::BaseObject
6
+ implements Decidim::Core::ComponentInterface
7
+
6
8
  graphql_name "Blogs"
7
9
  description "A blogs component of a participatory space."
8
10
 
@@ -17,19 +17,6 @@ module Decidim
17
17
  field :title, Decidim::Core::TranslatedFieldType, "The title for this post", null: true
18
18
  field :body, Decidim::Core::TranslatedFieldType, "The body of this post", null: true
19
19
  field :published_at, Decidim::Core::DateTimeType, "The time this page was published", null: false
20
-
21
- def self.authorized?(object, context)
22
- context[:post] = object
23
-
24
- chain = [
25
- allowed_to?(:read, :blogpost, object, context),
26
- !object.hidden?
27
- ].all?
28
-
29
- super && chain
30
- rescue Decidim::PermissionAction::PermissionNotSetError
31
- false
32
- end
33
20
  end
34
21
  end
35
22
  end
@@ -14,22 +14,6 @@ FactoryBot.define do
14
14
  name { generate_component_name(participatory_space.organization.available_locales, :blogs, skip_injection:) }
15
15
  manifest_name { :blogs }
16
16
  participatory_space { create(:participatory_process, :with_steps, skip_injection:, organization:) }
17
-
18
- trait :with_endorsements_enabled do
19
- step_settings do
20
- {
21
- participatory_space.active_step.id => { endorsements_enabled: true }
22
- }
23
- end
24
- end
25
-
26
- trait :with_endorsements_disabled do
27
- step_settings do
28
- {
29
- participatory_space.active_step.id => { endorsements_enabled: false }
30
- }
31
- end
32
- end
33
17
  end
34
18
 
35
19
  factory :post, class: "Decidim::Blogs::Post" do
@@ -48,15 +32,9 @@ FactoryBot.define do
48
32
  create(:endorsement,
49
33
  resource: post,
50
34
  skip_injection: evaluator.skip_injection,
51
- author: build(:user, :confirmed, skip_injection: evaluator.skip_injection, organization: post.participatory_space.organization))
35
+ author: build(:user, skip_injection: evaluator.skip_injection, organization: post.participatory_space.organization))
52
36
  end
53
37
  end
54
38
  end
55
-
56
- trait :hidden do
57
- after :create do |post, evaluator|
58
- create(:moderation, hidden_at: Time.current, reportable: post, skip_injection: evaluator.skip_injection)
59
- end
60
- end
61
39
  end
62
40
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-pages version.
5
5
  module Blogs
6
6
  def self.version
7
- "0.28.5"
7
+ "0.29.0.rc1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-blogs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.5
4
+ version: 0.29.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Massot Gil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-12 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: decidim-admin
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.28.5
19
+ version: 0.29.0.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.28.5
26
+ version: 0.29.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-comments
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.28.5
33
+ version: 0.29.0.rc1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.28.5
40
+ version: 0.29.0.rc1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.28.5
47
+ version: 0.29.0.rc1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.28.5
54
+ version: 0.29.0.rc1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-admin
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 0.28.5
61
+ version: 0.29.0.rc1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 0.28.5
68
+ version: 0.29.0.rc1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-assemblies
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.28.5
75
+ version: 0.29.0.rc1
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.28.5
82
+ version: 0.29.0.rc1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: decidim-dev
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.28.5
89
+ version: 0.29.0.rc1
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.28.5
96
+ version: 0.29.0.rc1
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: decidim-participatory_processes
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.28.5
103
+ version: 0.29.0.rc1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.28.5
110
+ version: 0.29.0.rc1
111
111
  description: A Blog component for decidim's participatory spaces.
112
112
  email:
113
113
  - isaac.mg@coditramuntana.com
@@ -161,8 +161,6 @@ files:
161
161
  - config/locales/ar.yml
162
162
  - config/locales/bg-BG.yml
163
163
  - config/locales/bg.yml
164
- - config/locales/bn-BD.yml
165
- - config/locales/bs-BA.yml
166
164
  - config/locales/ca.yml
167
165
  - config/locales/cs-CZ.yml
168
166
  - config/locales/cs.yml
@@ -263,7 +261,7 @@ files:
263
261
  - lib/decidim/blogs/version.rb
264
262
  homepage: https://decidim.org
265
263
  licenses:
266
- - AGPL-3.0-or-later
264
+ - AGPL-3.0
267
265
  metadata:
268
266
  bug_tracker_uri: https://github.com/decidim/decidim/issues
269
267
  documentation_uri: https://docs.decidim.org/
@@ -278,14 +276,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
278
276
  requirements:
279
277
  - - "~>"
280
278
  - !ruby/object:Gem::Version
281
- version: 3.1.0
279
+ version: 3.2.0
282
280
  required_rubygems_version: !ruby/object:Gem::Requirement
283
281
  requirements:
284
- - - ">="
282
+ - - ">"
285
283
  - !ruby/object:Gem::Version
286
- version: '0'
284
+ version: 1.3.1
287
285
  requirements: []
288
- rubygems_version: 3.3.7
286
+ rubygems_version: 3.4.10
289
287
  signing_key:
290
288
  specification_version: 4
291
289
  summary: Decidim blogs module
@@ -1 +0,0 @@
1
- bn:
@@ -1,9 +0,0 @@
1
- ---
2
- bs:
3
- decidim:
4
- components:
5
- blogs:
6
- settings:
7
- step:
8
- endorsements_blocked: Podržavanja su onemogućena
9
- endorsements_enabled: Podržavanja su omogućena