decidim-assemblies 0.20.0 → 0.23.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/assemblies/assembly.svg +1 -3
  3. data/app/assets/javascripts/decidim/assemblies/orgchart.js.es6 +698 -0
  4. data/app/cells/decidim/assemblies/assembly_m/footer.erb +2 -2
  5. data/app/cells/decidim/assemblies/assembly_m_cell.rb +5 -5
  6. data/app/cells/decidim/assemblies/assembly_member/show.erb +4 -4
  7. data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies/show.erb +10 -11
  8. data/app/cells/decidim/assemblies/content_blocks/highlighted_assemblies_cell.rb +1 -0
  9. data/app/commands/decidim/assemblies/admin/create_assemblies_type.rb +45 -0
  10. data/app/commands/decidim/assemblies/admin/create_assembly.rb +1 -2
  11. data/app/commands/decidim/assemblies/admin/create_assembly_admin.rb +2 -1
  12. data/app/commands/decidim/assemblies/admin/create_assembly_member.rb +12 -3
  13. data/app/commands/decidim/assemblies/admin/destroy_assemblies_type.rb +45 -0
  14. data/app/commands/decidim/assemblies/admin/import_assembly.rb +72 -0
  15. data/app/commands/decidim/assemblies/admin/notify_role_assigned_to_assembly.rb +22 -0
  16. data/app/commands/decidim/assemblies/admin/update_assemblies_setting.rb +46 -0
  17. data/app/commands/decidim/assemblies/admin/update_assemblies_type.rb +46 -0
  18. data/app/commands/decidim/assemblies/admin/update_assembly.rb +11 -7
  19. data/app/commands/decidim/assemblies/admin/update_assembly_admin.rb +2 -1
  20. data/app/controllers/concerns/decidim/assemblies/admin/filterable.rb +30 -0
  21. data/app/controllers/decidim/assemblies/admin/assemblies_controller.rb +8 -23
  22. data/app/controllers/decidim/assemblies/admin/assemblies_settings_controller.rb +49 -0
  23. data/app/controllers/decidim/assemblies/admin/assemblies_types_controller.rb +107 -0
  24. data/app/controllers/decidim/assemblies/admin/assembly_exports_controller.rb +24 -0
  25. data/app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb +31 -0
  26. data/app/controllers/decidim/assemblies/admin/assembly_user_roles_controller.rb +2 -1
  27. data/app/controllers/decidim/assemblies/assemblies_controller.rb +6 -2
  28. data/app/controllers/decidim/assemblies/{assembly_widgets_controller.rb → widgets_controller.rb} +2 -2
  29. data/app/events/decidim/assemblies/create_assembly_member_event.rb +17 -0
  30. data/app/events/decidim/role_assigned_to_assembly_event.rb +28 -0
  31. data/app/forms/decidim/assemblies/admin/assemblies_setting_form.rb +14 -0
  32. data/app/forms/decidim/assemblies/admin/assemblies_type_form.rb +17 -0
  33. data/app/forms/decidim/assemblies/admin/assembly_form.rb +37 -19
  34. data/app/forms/decidim/assemblies/admin/assembly_import_form.rb +83 -0
  35. data/app/forms/decidim/assemblies/admin/assembly_user_role_form.rb +8 -2
  36. data/app/helpers/decidim/assemblies/admin/assemblies_helper.rb +6 -0
  37. data/app/helpers/decidim/assemblies/assemblies_helper.rb +6 -3
  38. data/app/helpers/decidim/assemblies/filter_assemblies_helper.rb +10 -7
  39. data/app/models/decidim/assemblies_setting.rb +17 -0
  40. data/app/models/decidim/assemblies_type.rb +27 -0
  41. data/app/models/decidim/assembly.rb +26 -3
  42. data/app/models/decidim/assembly_user_role.rb +1 -1
  43. data/app/permissions/decidim/assemblies/permissions.rb +60 -2
  44. data/app/presenters/decidim/assemblies/admin_log/assemblies_setting_presenter.rb +27 -0
  45. data/app/presenters/decidim/assemblies/admin_log/assemblies_type_presenter.rb +43 -0
  46. data/app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb +1 -2
  47. data/app/presenters/decidim/assemblies/assembly_presenter.rb +29 -0
  48. data/app/presenters/decidim/assemblies/assembly_stats_presenter.rb +1 -1
  49. data/app/presenters/decidim/log/value_types/assembly_type_presenter.rb +29 -0
  50. data/app/queries/decidim/assemblies/filtered_assemblies.rb +2 -2
  51. data/app/queries/decidim/assemblies/parent_assemblies_for_select.rb +42 -0
  52. data/app/serializers/decidim/assemblies/assembly_importer.rb +172 -0
  53. data/app/serializers/decidim/assemblies/assembly_serializer.rb +147 -0
  54. data/app/services/decidim/assemblies/assembly_search.rb +3 -3
  55. data/app/types/decidim/assemblies/assemblies_type_type.rb +17 -0
  56. data/app/types/decidim/assemblies/assembly_member_type.rb +29 -0
  57. data/app/types/decidim/assemblies/assembly_type.rb +67 -0
  58. data/app/views/decidim/assemblies/_filter_by_type.html.erb +11 -7
  59. data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +2 -6
  60. data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +18 -4
  61. data/app/views/decidim/assemblies/admin/assemblies_settings/_form.html.erb +10 -0
  62. data/app/views/decidim/assemblies/admin/assemblies_settings/edit.html.erb +6 -0
  63. data/app/views/decidim/assemblies/admin/assemblies_types/_form.html.erb +11 -0
  64. data/app/views/decidim/assemblies/admin/assemblies_types/edit.html.erb +6 -0
  65. data/app/views/decidim/assemblies/admin/assemblies_types/index.html.erb +43 -0
  66. data/app/views/decidim/assemblies/admin/assemblies_types/new.html.erb +7 -0
  67. data/app/views/decidim/assemblies/admin/assembly_imports/_form.html.erb +46 -0
  68. data/app/views/decidim/assemblies/admin/assembly_imports/new.html.erb +7 -0
  69. data/app/views/decidim/assemblies/admin/assembly_members/index.html.erb +30 -30
  70. data/app/views/decidim/assemblies/assemblies/_parent_assemblies.html.erb +2 -2
  71. data/app/views/decidim/assemblies/assemblies/_promoted_assembly.html.erb +3 -3
  72. data/app/views/decidim/assemblies/assemblies/index.html.erb +11 -8
  73. data/app/views/decidim/assemblies/assemblies/show.html.erb +11 -14
  74. data/app/views/decidim/assemblies/assembly_members/index.html.erb +1 -1
  75. data/app/views/layouts/decidim/admin/assemblies.html.erb +22 -0
  76. data/app/views/layouts/decidim/admin/assembly.html.erb +2 -2
  77. data/app/views/layouts/decidim/assembly.html.erb +1 -0
  78. data/config/locales/am-ET.yml +1 -0
  79. data/config/locales/ar.yml +60 -27
  80. data/config/locales/bg-BG.yml +7 -0
  81. data/config/locales/bg.yml +7 -0
  82. data/config/locales/ca.yml +101 -1
  83. data/config/locales/cs.yml +152 -52
  84. data/config/locales/da-DK.yml +1 -0
  85. data/config/locales/da.yml +1 -0
  86. data/config/locales/de.yml +99 -0
  87. data/config/locales/el-GR.yml +1 -0
  88. data/config/locales/el.yml +475 -0
  89. data/config/locales/en.yml +100 -0
  90. data/config/locales/eo.yml +1 -0
  91. data/config/locales/es-MX.yml +100 -0
  92. data/config/locales/es-PY.yml +100 -0
  93. data/config/locales/es.yml +100 -0
  94. data/config/locales/et-EE.yml +1 -0
  95. data/config/locales/et.yml +1 -0
  96. data/config/locales/eu.yml +11 -0
  97. data/config/locales/fi-plain.yml +97 -0
  98. data/config/locales/fi.yml +103 -6
  99. data/config/locales/fr-CA.yml +478 -0
  100. data/config/locales/fr.yml +100 -0
  101. data/config/locales/ga-IE.yml +1 -0
  102. data/config/locales/gl.yml +11 -0
  103. data/config/locales/hr-HR.yml +1 -0
  104. data/config/locales/hr.yml +1 -0
  105. data/config/locales/hu.yml +85 -2
  106. data/config/locales/id-ID.yml +11 -0
  107. data/config/locales/is-IS.yml +263 -0
  108. data/config/locales/is.yml +263 -0
  109. data/config/locales/it.yml +171 -74
  110. data/config/locales/ja-JP.yml +471 -0
  111. data/config/locales/ja.yml +471 -0
  112. data/config/locales/ko-KR.yml +1 -0
  113. data/config/locales/ko.yml +1 -0
  114. data/config/locales/lt-LT.yml +1 -0
  115. data/config/locales/lt.yml +1 -0
  116. data/config/locales/lv.yml +454 -0
  117. data/config/locales/mt-MT.yml +1 -0
  118. data/config/locales/mt.yml +1 -0
  119. data/config/locales/nl.yml +103 -6
  120. data/config/locales/no.yml +349 -7
  121. data/config/locales/om-ET.yml +1 -0
  122. data/config/locales/pl.yml +250 -151
  123. data/config/locales/pt-BR.yml +12 -1
  124. data/config/locales/pt.yml +217 -118
  125. data/config/locales/ro-RO.yml +441 -0
  126. data/config/locales/ru.yml +11 -0
  127. data/config/locales/sk-SK.yml +168 -0
  128. data/config/locales/sk.yml +172 -0
  129. data/config/locales/sl.yml +283 -0
  130. data/config/locales/so-SO.yml +1 -0
  131. data/config/locales/sr-CS.yml +73 -0
  132. data/config/locales/sv.yml +188 -88
  133. data/config/locales/ti-ER.yml +1 -0
  134. data/config/locales/tr-TR.yml +30 -0
  135. data/config/locales/uk.yml +11 -0
  136. data/config/locales/vi-VN.yml +1 -0
  137. data/config/locales/vi.yml +1 -0
  138. data/config/locales/zh-CN.yml +471 -0
  139. data/config/locales/zh-TW.yml +1 -0
  140. data/db/migrate/20200108113855_create_decidim_assembly_types.rb +19 -0
  141. data/db/migrate/20200108123050_migrate_decidim_assembly_types.rb +83 -0
  142. data/db/migrate/20200320105906_index_foreign_keys_in_decidim_assemblies.rb +7 -0
  143. data/db/migrate/20200320105907_index_foreign_keys_in_decidim_assembly_user_roles.rb +7 -0
  144. data/db/migrate/20200416132109_remove_legacy_decidim_assembly_type.rb +8 -0
  145. data/db/migrate/20200430202456_create_decidim_assemblies_settings.rb +10 -0
  146. data/db/seeds/city.jpeg +0 -0
  147. data/db/seeds/city2.jpeg +0 -0
  148. data/lib/decidim/assemblies/admin_engine.rb +10 -0
  149. data/lib/decidim/assemblies/engine.rb +8 -1
  150. data/lib/decidim/assemblies/participatory_space.rb +29 -15
  151. data/lib/decidim/assemblies/query_extensions.rb +40 -0
  152. data/lib/decidim/assemblies/test/factories.rb +32 -5
  153. data/lib/decidim/assemblies/version.rb +1 -1
  154. metadata +93 -13
  155. data/app/views/decidim/assemblies/assembly_widgets/show.html.erb +0 -11
@@ -0,0 +1,147 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This class serializes an Assembly so it can be exported to CSV, JSON or other formats.
6
+ class AssemblySerializer < Decidim::Exporters::Serializer
7
+ include Decidim::ApplicationHelper
8
+ include Decidim::ResourceHelper
9
+ include Decidim::TranslationsHelper
10
+
11
+ # Public: Initializes the serializer with a assembly.
12
+ def initialize(assembly)
13
+ @assembly = assembly
14
+ end
15
+
16
+ # Public: Exports a hash with the serialized data for this assembly.
17
+ def serialize
18
+ {
19
+ id: assembly.id,
20
+ slug: assembly.slug,
21
+ hashtag: assembly.hashtag,
22
+ decidim_organization_id: assembly.decidim_organization_id,
23
+ title: assembly.title,
24
+ subtitle: assembly.subtitle,
25
+ short_description: assembly.short_description,
26
+ description: assembly.description,
27
+ remote_hero_image_url: Decidim::Assemblies::AssemblyPresenter.new(assembly).hero_image_url,
28
+ remote_banner_image_url: Decidim::Assemblies::AssemblyPresenter.new(assembly).banner_image_url,
29
+ promoted: assembly.promoted,
30
+ developer_group: assembly.developer_group,
31
+ meta_scope: assembly.meta_scope,
32
+ local_area: assembly.local_area,
33
+ target: assembly.target,
34
+ decidim_scope_id: assembly.decidim_scope_id,
35
+ paticipatory_scope: assembly.participatory_scope,
36
+ participatory_structure: assembly.participatory_structure,
37
+ show_statistics: assembly.show_statistics,
38
+ scopes_enabled: assembly.scopes_enabled,
39
+ private_space: assembly.private_space,
40
+ reference: assembly.reference,
41
+ purpose_of_action: assembly.purpose_of_action,
42
+ composition: assembly.composition,
43
+ duration: assembly.duration,
44
+ participatory_scope: assembly.participatory_scope,
45
+ included_at: assembly.included_at,
46
+ closing_date: assembly.closing_date,
47
+ created_by: assembly.created_by,
48
+ creation_date: assembly.creation_date,
49
+ closing_date_reason: assembly.closing_date_reason,
50
+ internal_organisation: assembly.internal_organisation,
51
+ is_transparent: assembly.is_transparent,
52
+ special_features: assembly.special_features,
53
+ twitter_handler: assembly.twitter_handler,
54
+ instagram_handler: assembly.instagram_handler,
55
+ facebook_handler: assembly.facebook_handler,
56
+ youtube_handler: assembly.youtube_handler,
57
+ github_handler: assembly.github_handler,
58
+ created_by_other: assembly.created_by_other,
59
+ decidim_assemblies_type_id: assembly.decidim_assemblies_type_id,
60
+ area: {
61
+ id: assembly.area.try(:id),
62
+ name: assembly.area.try(:name) || empty_translatable
63
+ },
64
+ scope: {
65
+ id: assembly.scope.try(:id),
66
+ name: assembly.scope.try(:name) || empty_translatable
67
+ },
68
+
69
+ assembly_categories: serialize_categories,
70
+ attachments: {
71
+ attachment_collections: serialize_attachment_collections,
72
+ files: serialize_attachments
73
+ },
74
+ components: serialize_components
75
+ }
76
+ end
77
+
78
+ private
79
+
80
+ attr_reader :assembly
81
+
82
+ def serialize_categories
83
+ return unless assembly.categories.first_class.any?
84
+
85
+ assembly.categories.first_class.map do |category|
86
+ {
87
+ id: category.try(:id),
88
+ name: category.try(:name),
89
+ description: category.try(:description),
90
+ parent_id: category.try(:parent_id),
91
+ subcategories: serialize_subcategories(category.subcategories)
92
+ }
93
+ end
94
+ end
95
+
96
+ def serialize_subcategories(subcategories)
97
+ return unless subcategories.any?
98
+
99
+ subcategories.map do |subcategory|
100
+ {
101
+ id: subcategory.try(:id),
102
+ name: subcategory.try(:name),
103
+ description: subcategory.try(:description),
104
+ parent_id: subcategory.try(:parent_id)
105
+ }
106
+ end
107
+ end
108
+
109
+ def serialize_attachment_collections
110
+ return unless assembly.attachment_collections.any?
111
+
112
+ assembly.attachment_collections.map do |collection|
113
+ {
114
+ id: collection.try(:id),
115
+ name: collection.try(:name),
116
+ weight: collection.try(:weight),
117
+ description: collection.try(:description)
118
+ }
119
+ end
120
+ end
121
+
122
+ def serialize_attachments
123
+ return unless assembly.attachments.any?
124
+
125
+ assembly.attachments.map do |attachment|
126
+ {
127
+ id: attachment.try(:id),
128
+ title: attachment.try(:title),
129
+ weight: attachment.try(:weight),
130
+ description: attachment.try(:description),
131
+ attachment_collection: {
132
+ name: attachment.attachment_collection.try(:name),
133
+ weight: attachment.attachment_collection.try(:weight),
134
+ description: attachment.attachment_collection.try(:description)
135
+ },
136
+ remote_file_url: Decidim::AttachmentPresenter.new(attachment).attachment_file_url
137
+ }
138
+ end
139
+ end
140
+
141
+ def serialize_components
142
+ serializer = Decidim::Exporters::ParticipatorySpaceComponentsSerializer.new(@assembly)
143
+ serializer.serialize
144
+ end
145
+ end
146
+ end
147
+ end
@@ -8,10 +8,10 @@ module Decidim
8
8
  super(Assembly.all, options)
9
9
  end
10
10
 
11
- def search_assembly_type
12
- return query if assembly_type == "all"
11
+ def search_type_id
12
+ return query if type_id.blank?
13
13
 
14
- query.where(assembly_type: assembly_type)
14
+ query.where(decidim_assemblies_type_id: type_id)
15
15
  end
16
16
  end
17
17
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This type represents an AssembliesType.
6
+ AssembliesTypeType = GraphQL::ObjectType.define do
7
+ name "AssembliesType"
8
+ description "An assemblies type"
9
+
10
+ field :id, !types.ID, "The assemblies type's unique ID"
11
+ field :title, !Decidim::Core::TranslatedFieldType, "The title of this assemblies type."
12
+ field :createdAt, !Decidim::Core::DateTimeType, "The time this assemblies type was created", property: :created_at
13
+ field :updatedAt, !Decidim::Core::DateTimeType, "The time this assemblies type was updated", property: :updated_at
14
+ field :assemblies, !types[Decidim::Assemblies::AssemblyType], "Assemblies with this assemblies type"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This type represents a assembly.
6
+ AssemblyMemberType = GraphQL::ObjectType.define do
7
+ name "AssemblyMember"
8
+ description "An assembly member"
9
+
10
+ field :id, !types.ID, "Internal ID of the member"
11
+ field :fullName, types.String, "Full name of the member", property: :full_name
12
+ field :position, types.String, "Position of the member in the assembly"
13
+
14
+ field :user, Decidim::Core::UserType, "The corresponding decidim user", property: :user
15
+
16
+ field :createdAt, Decidim::Core::DateTimeType, "The time this member was created", property: :created_at
17
+ field :updatedAt, Decidim::Core::DateTimeType, "The time this member was updated", property: :updated_at
18
+
19
+ field :weight, types.Int, "Order of appearance in which it should be represented"
20
+ field :gender, types.String, "Gender of the member"
21
+ # field :birthday, Decidim::Core::DateType, "Birthday date of the member" # non-public currently
22
+ field :birthplace, types.String, "Birthplace of the member"
23
+ field :designationDate, Decidim::Core::DateType, "Date of designation of the member", property: :designation_date
24
+ # field :designationMode, types.String, "Mode in which the member was designated", property: :designation_mode # non-public currently
25
+ field :positionOther, types.String, "Custom position name", property: :position_other
26
+ field :ceasedDate, Decidim::Core::DateType, "Date of cease for the member", property: :ceased_date
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This type represents a assembly.
6
+ AssemblyType = GraphQL::ObjectType.define do
7
+ interfaces [
8
+ -> { Decidim::Core::ParticipatorySpaceInterface },
9
+ -> { Decidim::Core::AttachableInterface },
10
+ -> { Decidim::Core::ParticipatorySpaceResourceableInterface }
11
+ ]
12
+
13
+ name "Assembly"
14
+ description "An assembly"
15
+
16
+ field :id, !types.ID, "The internal ID for this assembly"
17
+ field :subtitle, Decidim::Core::TranslatedFieldType, "The subtitle of this assembly"
18
+ field :shortDescription, Decidim::Core::TranslatedFieldType, "The sort description of this assembly", property: :short_description
19
+ field :description, Decidim::Core::TranslatedFieldType, "The description of this assembly"
20
+ field :slug, !types.String, "The slug of this assembly"
21
+ field :hashtag, types.String, "The hashtag for this assembly"
22
+ field :createdAt, !Decidim::Core::DateTimeType, "The time this assembly was created", property: :created_at
23
+ field :updatedAt, !Decidim::Core::DateTimeType, "The time this assembly was updated", property: :updated_at
24
+ field :publishedAt, !Decidim::Core::DateTimeType, "The time this assembly was published", property: :published_at
25
+ field :reference, !types.String, "Reference for this assembly"
26
+ field :categories, !types[Decidim::Core::CategoryType], "Categories for this assembly"
27
+
28
+ field :heroImage, types.String, "The hero image for this assembly", property: :hero_image
29
+ field :bannerImage, types.String, "The banner image for this assembly", property: :banner_image
30
+ field :promoted, types.Boolean, "If this assembly is promoted (therefore in the homepage)"
31
+ field :developerGroup, Decidim::Core::TranslatedFieldType, "The promoter group of this assembly", property: :developer_group
32
+ field :metaScope, Decidim::Core::TranslatedFieldType, "The scope metadata of this assembly", property: :meta_scope
33
+ field :localArea, Decidim::Core::TranslatedFieldType, "The organization area of this assembly", property: :local_area
34
+ field :target, Decidim::Core::TranslatedFieldType, "Who participates in this assembly"
35
+ field :participatoryScope, Decidim::Core::TranslatedFieldType, "What is decided on this assembly", property: :participatory_scope
36
+ field :participatoryStructure, Decidim::Core::TranslatedFieldType, "How it is decided on this assembly", property: :participatory_structure
37
+ field :showStatistics, types.Boolean, "If this assembly should show statistics", property: :show_statistics
38
+ field :scopesEnabled, types.Boolean, "If this assembly has scopes enabled", property: :scopes_enabled
39
+ field :privateSpace, types.Boolean, "If this assembly is a private space", property: :private_space
40
+ field :area, Decidim::Core::AreaApiType, "Area of this assembly"
41
+ field :parent, Decidim::Assemblies::AssemblyType, "The parent assembly of this assembly"
42
+ field :parentsPath, types.String, "Assembly hierarchy representation", property: :parents_path
43
+ field :childrenCount, types.Int, "Number of children assemblies", property: :children_count
44
+ field :purposeOfAction, Decidim::Core::TranslatedFieldType, "Purpose of action", property: :purpose_of_action
45
+ field :composition, Decidim::Core::TranslatedFieldType, "Composition of this assembly"
46
+ field :assemblyType, Decidim::Assemblies::AssembliesTypeType, "Type of the assembly", property: :assembly_type
47
+ field :creationDate, Decidim::Core::DateType, "Creation date of this assembly", property: :creation_date
48
+ field :createdBy, types.String, "The creator of this assembly", property: :created_by
49
+ field :createdByOther, Decidim::Core::TranslatedFieldType, "Custom creator", property: :created_by_other
50
+ field :duration, Decidim::Core::DateType, "Duration of this assembly"
51
+ field :includedAt, Decidim::Core::DateType, "Included at", property: :included_at
52
+ field :closingDate, Decidim::Core::DateType, "Closing date of the assembly", property: :closing_date
53
+ field :closingDateReason, Decidim::Core::TranslatedFieldType, "Closing date reason of this assembly", property: :closing_date_reason
54
+ field :internalOrganisation, Decidim::Core::TranslatedFieldType, "Internal organisation of this assembly", property: :internal_organisation
55
+ field :isTransparent, types.Boolean, "If this assembly is transparent", property: :is_transparent
56
+ field :specialFeatures, Decidim::Core::TranslatedFieldType, "Special features of this assembly", property: :special_features
57
+ field :twitterHandler, types.String, "Twitter handler", property: :twitter_handler
58
+ field :instagramHandler, types.String, "Instagram handler", property: :instagram_handler
59
+ field :facebookHandler, types.String, "Facebook handler", property: :facebook_handler
60
+ field :youtubeHandler, types.String, "Youtube handler", property: :youtube_handler
61
+ field :githubHandler, types.String, "Github handler", property: :github_handler
62
+
63
+ field :members, !types[Decidim::Assemblies::AssemblyMemberType], "Members of this assembly"
64
+ field :children, !types[Decidim::Assemblies::AssemblyType], "Childrens of this assembly"
65
+ end
66
+ end
67
+ end
@@ -1,15 +1,19 @@
1
1
  <div id="assemblies-filter" class="inline-filters">
2
- <label>
3
- <span><%= help_text %></span>
4
- <button id="button-text" data-toggle="inline-filter-sort"><%= current_filter_name %></button>
2
+ <% if available_filters.any? %>
5
3
  <div id="inline-filter-sort" class="dropdown-pane" data-position="bottom" data-alignment="right" data-dropdown data-auto-focus="true">
6
4
  <ul class="list-reset">
7
- <% available_filters.each do |filter| %>
8
- <%= link_to filter_link(filter), remote: true do %>
9
- <li><%= filter_name(filter) %></li>
5
+ <% available_filters.each do |title, id| %>
6
+ <li>
7
+ <%= link_to filter_link(id), remote: true do %>
8
+ <%= title %>
10
9
  <% end %>
10
+ </li>
11
11
  <% end %>
12
12
  </ul>
13
13
  </div>
14
- </label>
14
+ <label>
15
+ <span><%= help_text %></span>
16
+ <button id="button-text" data-toggle="inline-filter-sort"><%= current_filter_name %></button>
17
+ </label>
18
+ <% end %>
15
19
  </div>
@@ -157,7 +157,7 @@
157
157
  <div class="row column">
158
158
  <%= form.select :parent_id,
159
159
  options_from_collection_for_select(
160
- parent_assemblies,
160
+ parent_assemblies_for_select,
161
161
  :id,
162
162
  :translated_title,
163
163
  selected: current_assembly.try(:parent_id)
@@ -196,16 +196,12 @@
196
196
  </div>
197
197
 
198
198
  <div class="row column">
199
- <%= form.select :assembly_type,
199
+ <%= form.select :decidim_assemblies_type_id,
200
200
  @form.assembly_types_for_select,
201
201
  { include_blank: t(".select_an_assembly_type") },
202
202
  { multiple: false } %>
203
203
  </div>
204
204
 
205
- <div class="row column" id="assembly_type_other">
206
- <%= form.translated :text_field, :assembly_type_other %>
207
- </div>
208
-
209
205
  <div class="row column">
210
206
  <% if @form.processes_for_select %>
211
207
  <%= form.select :participatory_processes_ids,
@@ -1,4 +1,4 @@
1
- <div class="card" id="assemblies">
1
+ <div class="card with-overflow" id="assemblies">
2
2
  <div class="card-divider">
3
3
  <h2 class="card-title">
4
4
  <% parent_assembly.self_and_ancestors.each do |assembly| %>
@@ -8,6 +8,12 @@
8
8
 
9
9
  <%= t("assemblies", scope: "decidim.admin.titles") %>
10
10
 
11
+ <% if allowed_to? :import, :assembly %>
12
+ <%= link_to t("actions.import_assembly", scope: "decidim.admin"),
13
+ new_import_path,
14
+ class: "button tiny button--title" %>
15
+ <% end %>
16
+
11
17
  <% if allowed_to? :create, :assembly %>
12
18
  <%= link_to t("actions.new_assembly", scope: "decidim.admin"),
13
19
  new_assembly_path(parent_id: parent_assembly&.id),
@@ -15,6 +21,7 @@
15
21
  <% end %>
16
22
  </h2>
17
23
  </div>
24
+ <%= admin_filter_selector %>
18
25
  <div class="card-section">
19
26
  <div class="table-scroll">
20
27
  <table class="table-list">
@@ -37,15 +44,18 @@
37
44
  </thead>
38
45
  <tbody>
39
46
  <% @assemblies.each do |assembly| %>
47
+ <% next unless allowed_to? :list, :assembly, assembly: assembly %>
40
48
  <tr>
41
49
  <td>
42
50
  <% if assembly.promoted? %>
43
51
  <span data-tooltip class="icon-state icon-highlight" aria-haspopup="true" data-disable-hover="false" title="<%= t("models.assembly.fields.promoted", scope: "decidim.admin") %>">
44
- <%= icon "star" %>
52
+ <%= icon "star", role: "img", "aria-hidden": true %>
45
53
  </span>
46
54
  <% end %>
47
55
  <% if allowed_to? :update, :assembly, assembly: assembly %>
48
56
  <%= link_to translated_attribute(assembly.title), edit_assembly_path(assembly) %><br>
57
+ <% elsif allowed_to? :read, :component, assembly: assembly %>
58
+ <%= link_to translated_attribute(assembly.title), components_path(assembly) %><br>
49
59
  <% elsif allowed_to? :preview, :assembly, assembly: assembly %>
50
60
  <%= link_to translated_attribute(assembly.title), decidim_assemblies.assembly_path(assembly) %><br>
51
61
  <% elsif allowed_to? :read, :moderation, assembly: assembly %>
@@ -55,7 +65,7 @@
55
65
  <% end %>
56
66
  </td>
57
67
  <td>
58
- <%= l(assembly.created_at, format: :short) %>
68
+ <%= l(assembly.creation_date, format: :decidim_short) if assembly.creation_date %>
59
69
  </td>
60
70
  <td class="table-list__state">
61
71
  <% if assembly.private_space? %>
@@ -72,6 +82,10 @@
72
82
  <% end %>
73
83
  </td>
74
84
  <td class="table-list__actions">
85
+ <% if allowed_to? :create, :assembly, assembly: assembly %>
86
+ <%= icon_link_to "data-transfer-download", assembly_export_path(assembly), t("actions.export", scope: "decidim.admin"), method: :post, class: "action-icon--export" %>
87
+ <% end %>
88
+
75
89
  <% if allowed_to? :create, :assembly, assembly: assembly %>
76
90
  <%= icon_link_to "clipboard", new_assembly_copy_path(assembly), t("actions.duplicate", scope: "decidim.admin"), class: "action-icon--copy" %>
77
91
  <% end %>
@@ -82,7 +96,7 @@
82
96
 
83
97
  <% if assembly.children.count.positive? || allowed_to?(:create, :assembly) %>
84
98
  <%= icon_link_to "dial",
85
- decidim_admin_assemblies.assemblies_path(parent_id: assembly.id),
99
+ url_for(query_params_with(parent_id_eq: assembly.id)),
86
100
  t("decidim.admin.titles.assemblies"),
87
101
  class: "action-icon--dial #{'highlighted' if assembly.children.count.positive?}" %>
88
102
  <% end %>
@@ -0,0 +1,10 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= t(".title") %></h2>
4
+ </div>
5
+ <div class="card-section">
6
+ <div class="row column">
7
+ <%= form.check_box :enable_organization_chart %>
8
+ </div>
9
+ </div>
10
+ </div>
@@ -0,0 +1,6 @@
1
+ <%= decidim_form_for(@form, html: { class: "form edit_assemblies_settings" }, url: assemblies_settings_path, method: :put) do |f| %>
2
+ <%= render partial: "form", object: f %>
3
+ <div class="button--double form-general-submit">
4
+ <%= f.submit t(".update") %>
5
+ </div>
6
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= t(".title") %></h2>
4
+ </div>
5
+
6
+ <div class="card-section">
7
+ <div class="row column">
8
+ <%= form.translated :text_field, :title, autofocus: true %>
9
+ </div>
10
+ </div>
11
+ </div>
@@ -0,0 +1,6 @@
1
+ <%= decidim_form_for(@form, html: { class: "form edit_assembly_type" }) do |f| %>
2
+ <%= render partial: "form", object: f %>
3
+ <div class="button--double form-general-submit">
4
+ <%= f.submit t("assemblies.edit.update", scope: "decidim.admin"), class: "button" %>
5
+ </div>
6
+ <% end %>