decidim-assemblies 0.10.1 → 0.11.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/config/decidim_assemblies_manifest.js +1 -0
  4. data/app/assets/javascripts/decidim/assemblies/admin/assemblies.js.es6 +57 -4
  5. data/app/assets/javascripts/decidim/assemblies/assemblies.js.es6 +18 -0
  6. data/app/commands/decidim/assemblies/admin/copy_assembly.rb +9 -9
  7. data/app/commands/decidim/assemblies/admin/create_assembly.rb +33 -1
  8. data/app/commands/decidim/assemblies/admin/create_assembly_admin.rb +2 -2
  9. data/app/commands/decidim/assemblies/admin/update_assembly.rb +31 -1
  10. data/app/constraints/decidim/assemblies/{current_feature.rb → current_component.rb} +7 -7
  11. data/app/controllers/decidim/assemblies/admin/assemblies_controller.rb +17 -6
  12. data/app/controllers/decidim/assemblies/admin/{feature_permissions_controller.rb → component_permissions_controller.rb} +2 -2
  13. data/app/controllers/decidim/assemblies/admin/{features_controller.rb → components_controller.rb} +2 -2
  14. data/app/controllers/decidim/assemblies/admin/participatory_space_private_users_controller.rb +26 -0
  15. data/app/controllers/decidim/assemblies/assemblies_controller.rb +10 -4
  16. data/app/controllers/decidim/assemblies/assembly_widgets_controller.rb +1 -1
  17. data/app/forms/decidim/assemblies/admin/assembly_copy_form.rb +1 -1
  18. data/app/forms/decidim/assemblies/admin/assembly_form.rb +63 -2
  19. data/app/helpers/decidim/assemblies/admin/assemblies_helper.rb +20 -0
  20. data/app/helpers/decidim/assemblies/assemblies_helper.rb +51 -0
  21. data/app/models/decidim/assemblies/abilities/admin/admin_ability.rb +1 -0
  22. data/app/models/decidim/assemblies/abilities/admin/assembly_admin_ability.rb +3 -3
  23. data/app/models/decidim/assemblies/abilities/admin/assembly_moderator_ability.rb +1 -1
  24. data/app/models/decidim/assembly.rb +102 -2
  25. data/app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb +20 -1
  26. data/app/presenters/decidim/assemblies/assembly_stats_presenter.rb +9 -9
  27. data/app/presenters/decidim/log/value_types/assembly_presenter.rb +28 -0
  28. data/app/queries/decidim/assemblies/organization_prioritized_assemblies.rb +3 -2
  29. data/app/queries/decidim/assemblies/organization_published_assemblies.rb +3 -1
  30. data/app/queries/decidim/assemblies/visible_assemblies.rb +20 -0
  31. data/app/views/decidim/assemblies/_assembly.html.erb +1 -1
  32. data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +76 -1
  33. data/app/views/decidim/assemblies/admin/assemblies/edit.html.erb +3 -4
  34. data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +20 -4
  35. data/app/views/decidim/assemblies/admin/assemblies/new.html.erb +2 -2
  36. data/app/views/decidim/assemblies/admin/assembly_copies/_form.html.erb +1 -1
  37. data/app/views/decidim/assemblies/admin/assembly_copies/new.html.erb +1 -1
  38. data/app/views/decidim/assemblies/admin/assembly_user_roles/edit.html.erb +1 -1
  39. data/app/views/decidim/assemblies/admin/assembly_user_roles/index.html.erb +1 -1
  40. data/app/views/decidim/assemblies/admin/assembly_user_roles/new.html.erb +1 -1
  41. data/app/views/decidim/assemblies/assemblies/_nav_breadcumb.html.erb +11 -0
  42. data/app/views/decidim/assemblies/assemblies/_promoted_assembly.html.erb +1 -1
  43. data/app/views/decidim/assemblies/assemblies/_statistics.html.erb +1 -1
  44. data/app/views/decidim/assemblies/assemblies/index.html.erb +1 -1
  45. data/app/views/decidim/assemblies/assemblies/show.html.erb +129 -7
  46. data/app/views/decidim/assemblies/assembly_widgets/show.html.erb +1 -1
  47. data/app/views/layouts/decidim/_assembly_header.html.erb +13 -13
  48. data/app/views/layouts/decidim/admin/assemblies.html.erb +1 -1
  49. data/app/views/layouts/decidim/admin/assembly.html.erb +15 -10
  50. data/app/views/layouts/decidim/assembly.html.erb +2 -2
  51. data/config/locales/ca.yml +71 -1
  52. data/config/locales/en.yml +71 -1
  53. data/config/locales/es.yml +71 -1
  54. data/config/locales/eu.yml +71 -1
  55. data/config/locales/fi.yml +71 -1
  56. data/config/locales/fr.yml +88 -18
  57. data/config/locales/gl.yml +71 -1
  58. data/config/locales/it.yml +71 -1
  59. data/config/locales/nl.yml +105 -35
  60. data/config/locales/pl.yml +71 -1
  61. data/config/locales/pt-BR.yml +71 -1
  62. data/config/locales/pt.yml +71 -1
  63. data/config/locales/ru.yml +0 -1
  64. data/config/locales/sv.yml +71 -1
  65. data/config/locales/uk.yml +0 -1
  66. data/db/migrate/20180124083729_add_private_to_assemblies.rb +7 -0
  67. data/db/migrate/20180226103942_add_parent_child_relation_to_assemblies.rb +22 -0
  68. data/db/migrate/20180302121116_add_fields_to_assemblies.rb +25 -0
  69. data/lib/decidim/assemblies/admin_engine.rb +11 -5
  70. data/lib/decidim/assemblies/engine.rb +7 -7
  71. data/lib/decidim/assemblies/participatory_space.rb +89 -34
  72. data/lib/decidim/assemblies/test/factories.rb +24 -0
  73. data/lib/decidim/assemblies/version.rb +1 -1
  74. metadata +23 -13
@@ -11,6 +11,7 @@ module Decidim
11
11
 
12
12
  can :manage, Assembly
13
13
  can :manage, Decidim::AssemblyUserRole
14
+ can :manage, Decidim::ParticipatorySpacePrivateUser
14
15
  end
15
16
  end
16
17
  end
@@ -23,8 +23,8 @@ module Decidim
23
23
  end
24
24
 
25
25
  def define_assembly_abilities
26
- can :manage, Feature do |feature|
27
- can_manage_assembly?(feature.participatory_space)
26
+ can :manage, Component do |component|
27
+ can_manage_assembly?(component.participatory_space)
28
28
  end
29
29
 
30
30
  can :manage, Category do |category|
@@ -48,7 +48,7 @@ module Decidim
48
48
  end
49
49
 
50
50
  can [:unreport, :hide], Reportable do |reportable|
51
- can_manage_assembly?(reportable.feature.participatory_space)
51
+ can_manage_assembly?(reportable.component.participatory_space)
52
52
  end
53
53
  end
54
54
  end
@@ -19,7 +19,7 @@ module Decidim
19
19
  end
20
20
 
21
21
  can [:unreport, :hide], Reportable do |reportable|
22
- can_manage_assembly?(reportable.feature.participatory_space)
22
+ can_manage_assembly?(reportable.component.participatory_space)
23
23
  end
24
24
  end
25
25
 
@@ -3,7 +3,22 @@
3
3
  module Decidim
4
4
  # Interaction between a user and an organization can be done via an Assembly.
5
5
  # It's a unit of action from the Organization point of view that groups
6
- # several features (proposals, debates...) that can be enabled or disabled.
6
+ # several components (proposals, debates...) that can be enabled or disabled.
7
+ #
8
+ # An assembly can have children. This is implemented using a PostgreSQL extension: LTREE
9
+ # The LTREE extension allows us to save, query on and manipulate trees (hierarchical data
10
+ # structures). It uses the path enumeration algorithm, which calls for each node in the
11
+ # tree to record the path from the root you would have to follow to reach that node.
12
+ #
13
+ # We use the `parents_path` column to save the path and query the tree. Example:
14
+ #
15
+ # A (root assembly) parent = null, parents_path = A
16
+ # B (root assembly) parent = null, parents_path = B
17
+ # |- C (child assembly of B, descendant of B) parent = B, parents_path = B.C
18
+ # |- D (child assembly of C, descendant of B,C) parent = C, parents_path = B.C.D
19
+ # |- E (child assembly of C, descendant of B,C) parent = C, parents_path = B.C.E
20
+ # |- F (child assembly of E, descendant of B,C,E) parent = E, parents_path = B.C.E.F
21
+ #
7
22
  class Assembly < ApplicationRecord
8
23
  include Decidim::HasAttachments
9
24
  include Decidim::HasAttachmentCollections
@@ -14,6 +29,12 @@ module Decidim
14
29
  include Decidim::HasReference
15
30
  include Decidim::Traceable
16
31
  include Decidim::Loggable
32
+ include Decidim::ParticipatorySpaceResourceable
33
+ include Decidim::HasPrivateUsers
34
+
35
+ SOCIAL_HANDLERS = [:twitter, :facebook, :instagram, :youtube, :github].freeze
36
+ ASSEMBLY_TYPES = %w(government executive consultative_advisory participatory working_group commission others).freeze
37
+ CREATED_BY = %w(city_council public others).freeze
17
38
 
18
39
  belongs_to :organization,
19
40
  foreign_key: "decidim_organization_id",
@@ -28,7 +49,10 @@ module Decidim
28
49
  dependent: :destroy,
29
50
  as: :participatory_space
30
51
 
31
- has_many :features, as: :participatory_space, dependent: :destroy
52
+ has_many :components, as: :participatory_space, dependent: :destroy
53
+
54
+ has_many :children, foreign_key: "parent_id", class_name: "Decidim::Assembly", inverse_of: :parent, dependent: :destroy
55
+ belongs_to :parent, foreign_key: "parent_id", class_name: "Decidim::Assembly", inverse_of: :children, optional: true, counter_cache: :children_count
32
56
 
33
57
  validates :slug, uniqueness: { scope: :organization }
34
58
  validates :slug, presence: true, format: { with: Decidim::Assembly.slug_format }
@@ -36,6 +60,15 @@ module Decidim
36
60
  mount_uploader :hero_image, Decidim::HeroImageUploader
37
61
  mount_uploader :banner_image, Decidim::BannerImageUploader
38
62
 
63
+ scope :visible_for, lambda { |user|
64
+ joins("LEFT JOIN decidim_participatory_space_private_users ON
65
+ decidim_participatory_space_private_users.privatable_to_id = #{table_name}.id")
66
+ .where("(private_space = ? and decidim_participatory_space_private_users.decidim_user_id = ?)
67
+ or private_space = ? or (private_space = ? and is_transparent = ?)", true, user, false, true, true)
68
+ }
69
+
70
+ after_create :set_parents_path
71
+ after_update :set_parents_path, :update_children_paths, if: :saved_change_to_parent_id?
39
72
  # Scope to return only the promoted assemblies.
40
73
  #
41
74
  # Returns an ActiveRecord::Relation.
@@ -54,5 +87,72 @@ module Decidim
54
87
  def to_param
55
88
  slug
56
89
  end
90
+
91
+ def self_and_ancestors
92
+ self.class.where("#{self.class.table_name}.parents_path @> ?", parents_path).order("string_to_array(#{self.class.table_name}.parents_path::text, '.')")
93
+ end
94
+
95
+ def ancestors
96
+ self_and_ancestors.where.not(id: id)
97
+ end
98
+
99
+ def self.private_assemblies
100
+ where(private_space: true)
101
+ end
102
+
103
+ def self.public_spaces
104
+ super.where(private_space: false).or(Decidim::Assembly.where(private_space: true).where(is_transparent: true))
105
+ end
106
+
107
+ private
108
+
109
+ # When an assembly changes their parent, we need to update the parents_path attribute
110
+ # E.g. If we have the following tree:
111
+ #
112
+ # A (root assembly) parent = null, parents_path = A
113
+ # B (root assembly) parent = null, parents_path = B
114
+ # |- C (child assembly of B, descendant of B) parent = B, parents_path = B.C
115
+ # |- D (child assembly of C, descendant of B,C) parent = C, parents_path = B.C.D
116
+ #
117
+ # And we change the parent of C to A, this function updates their parents_path attribute:
118
+ #
119
+ # |- C (child assembly of *A*, descendant of *A*) parent = *A*, parents_path = *A*.C
120
+ #
121
+ # Note: updating parents_path in their descendants is done in the `update_children_paths` function.
122
+ #
123
+ # rubocop:disable Rails/SkipsModelValidations
124
+ def set_parents_path
125
+ update_column(:parents_path, [parent&.parents_path, id].select(&:present?).join("."))
126
+ end
127
+ # rubocop:enable Rails/SkipsModelValidations
128
+
129
+ # When an assembly changes their parent, we need to update the parents_path attribute on their descendants
130
+ # E.g. If we have the following tree:
131
+ #
132
+ # A (root assembly) parent = null, parents_path = A
133
+ # B (root assembly) parent = null, parents_path = B
134
+ # |- C (child assembly of B, descendant of B) parent = B, parents_path = B.C
135
+ # |- D (child assembly of C, descendant of B,C) parent = C, parents_path = B.C.D
136
+ # |- E (child assembly of C, descendant of B,C) parent = C, parents_path = B.C.E
137
+ # |- F (child assembly of E, descendant of B,C,E) parent = E, parents_path = B.C.E.F
138
+ #
139
+ # And we change the parent of C to A, this function updates the parents_path attribute in their
140
+ # descendants assemblies (D, E and F):
141
+ #
142
+ # |- D (child assembly of C, descendant of *A*,C) parent = C, parents_path = *A*.C.D
143
+ # |- E (child assembly of C, descendant of *A*,C) parent = C, parents_path = *A*.C.E
144
+ # |- F (child assembly of E, descendant of *A*,C,E) parent = E, parents_path = *A*.C.E.F
145
+ #
146
+ # Note: updating parents_path of C (the assembly in which we have changed the parent) is done in the `set_parents_path` function.
147
+ #
148
+ # rubocop:disable Rails/SkipsModelValidations
149
+ def update_children_paths
150
+ self.class.where(
151
+ ["#{self.class.table_name}.parents_path <@ :old_path AND #{self.class.table_name}.id != :id", old_path: parents_path_before_last_save, id: id]
152
+ ).update_all(
153
+ ["parents_path = :new_path || subpath(parents_path, nlevel(:old_path))", new_path: parents_path, old_path: parents_path_before_last_save]
154
+ )
155
+ end
156
+ # rubocop:enable Rails/SkipsModelValidations
57
157
  end
58
158
  end
@@ -35,7 +35,26 @@ module Decidim
35
35
  slug: :default,
36
36
  subtitle: :i18n,
37
37
  target: :i18n,
38
- title: :i18n
38
+ title: :i18n,
39
+ purpose_of_action: :i18n,
40
+ assembly_type: :string,
41
+ assembly_type_other: :i8n,
42
+ creation_date: :date,
43
+ created_by: :string,
44
+ created_by_other: :i18n,
45
+ duration: :date,
46
+ included_at: :date,
47
+ closing_date: :date,
48
+ closing_date_reason: :i18n,
49
+ internal_organisation: :i18n,
50
+ is_transparent: :boolean,
51
+ special_features: :i18n,
52
+ twitter_handler: :string,
53
+ facebook_handler: :string,
54
+ instagram_handler: :string,
55
+ youtube_handler: :string,
56
+ github_handler: :string,
57
+ parent_id: :assembly
39
58
  }
40
59
  end
41
60
 
@@ -9,8 +9,8 @@ module Decidim
9
9
 
10
10
  # Public: Render a collection of primary stats.
11
11
  def highlighted
12
- highlighted_stats = feature_stats(priority: StatsRegistry::HIGH_PRIORITY)
13
- highlighted_stats = highlighted_stats.concat(feature_stats(priority: StatsRegistry::MEDIUM_PRIORITY))
12
+ highlighted_stats = component_stats(priority: StatsRegistry::HIGH_PRIORITY)
13
+ highlighted_stats = highlighted_stats.concat(component_stats(priority: StatsRegistry::MEDIUM_PRIORITY))
14
14
  highlighted_stats = highlighted_stats.reject(&:empty?)
15
15
  highlighted_stats = highlighted_stats.reject { |_manifest, _name, data| data.zero? }
16
16
  grouped_highlighted_stats = highlighted_stats.group_by { |stats| stats.first.name }
@@ -30,22 +30,22 @@ module Decidim
30
30
 
31
31
  private
32
32
 
33
- def feature_stats(conditions)
34
- Decidim.feature_manifests.map do |feature_manifest|
35
- feature_manifest.stats.filter(conditions).with_context(published_features).map { |name, data| [feature_manifest, name, data] }.flatten
33
+ def component_stats(conditions)
34
+ Decidim.component_manifests.map do |component_manifest|
35
+ component_manifest.stats.filter(conditions).with_context(published_components).map { |name, data| [component_manifest, name, data] }.flatten
36
36
  end
37
37
  end
38
38
 
39
- def render_stats_data(feature_manifest, name, data, index)
39
+ def render_stats_data(component_manifest, name, data, index)
40
40
  safe_join([
41
- index.zero? ? manifest_icon(feature_manifest) : " /&nbsp".html_safe,
41
+ index.zero? ? manifest_icon(component_manifest) : " /&nbsp".html_safe,
42
42
  content_tag(:span, "#{number_with_delimiter(data)} " + I18n.t(name, scope: "decidim.assemblies.statistics"),
43
43
  class: "#{name} process_stats-text")
44
44
  ])
45
45
  end
46
46
 
47
- def published_features
48
- @published_features ||= Feature.where(participatory_space: assembly).published
47
+ def published_components
48
+ @published_components ||= Component.where(participatory_space: assembly).published
49
49
  end
50
50
  end
51
51
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Log
5
+ module ValueTypes
6
+ # This class presents the given value as a Decidim::Assembly. Check
7
+ # the `DefaultPresenter` for more info on how value
8
+ # presenters work.
9
+ class AssemblyPresenter < DefaultPresenter
10
+ # Public: Presents the value as a Decidim::Assembly. If the assembly
11
+ # can be found, it shows its title. Otherwise it shows its ID.
12
+ #
13
+ # Returns an HTML-safe String.
14
+ def present
15
+ return unless value
16
+ return h.translated_attribute(assembly.title) if assembly
17
+ I18n.t("not_found", id: value, scope: "decidim.log.value_types.assembly_presenter")
18
+ end
19
+
20
+ private
21
+
22
+ def assembly
23
+ @assembly ||= Decidim::Assembly.find_by(id: value)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -5,13 +5,14 @@ module Decidim
5
5
  # This query class filters public assemblies given an organization in a
6
6
  # meaningful prioritized order.
7
7
  class OrganizationPrioritizedAssemblies < Rectify::Query
8
- def initialize(organization)
8
+ def initialize(organization, user = nil)
9
9
  @organization = organization
10
+ @user = user
10
11
  end
11
12
 
12
13
  def query
13
14
  Rectify::Query.merge(
14
- OrganizationPublishedAssemblies.new(@organization),
15
+ OrganizationPublishedAssemblies.new(@organization, @user),
15
16
  PrioritizedAssemblies.new
16
17
  ).query
17
18
  end
@@ -4,13 +4,15 @@ module Decidim
4
4
  module Assemblies
5
5
  # This query class filters published assemblies given an organization.
6
6
  class OrganizationPublishedAssemblies < Rectify::Query
7
- def initialize(organization)
7
+ def initialize(organization, user = nil)
8
8
  @organization = organization
9
+ @user = user
9
10
  end
10
11
 
11
12
  def query
12
13
  Rectify::Query.merge(
13
14
  OrganizationAssemblies.new(@organization),
15
+ VisibleAssemblies.new(@user),
14
16
  PublishedAssemblies.new
15
17
  ).query
16
18
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Assemblies
5
+ # This query class filters assemblies given a current_user.
6
+ class VisibleAssemblies < Rectify::Query
7
+ def initialize(user)
8
+ @user = user
9
+ end
10
+
11
+ def query
12
+ if @user
13
+ Decidim::Assembly.visible_for(@user.id)
14
+ else
15
+ Decidim::Assembly.public_spaces
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -8,7 +8,7 @@
8
8
  <%= link_to assembly_path(assembly), class: "card__link" do %>
9
9
  <h4 class="card__title"><%= translated_attribute assembly.title %></h4>
10
10
  <% end %>
11
- <p class="card__desc"><%= decidim_sanitize html_truncate(translated_attribute(assembly.short_description), length: 630, separator: '...') %></p>
11
+ <p class="card__desc"><%= decidim_sanitize html_truncate(translated_attribute(assembly.short_description), length: 630, separator: "...") %></p>
12
12
  </div>
13
13
  <div class="card__footer">
14
14
  <div class="card__support">
@@ -1,5 +1,7 @@
1
1
  <%= javascript_include_tag "decidim/slug_form" %>
2
2
 
3
+ <%= form.hidden_field :parent_id, value: @form.parent_id %>
4
+
3
5
  <div class="card">
4
6
  <div class="card-divider">
5
7
  <h2 class="card-title"><%= t "assemblies.form.title", scope: "decidim.admin" %></h2>
@@ -76,7 +78,7 @@
76
78
  </div>
77
79
 
78
80
  <div class="row column">
79
- <%= form.select :area_id, option_groups_from_collection_for_select(current_organization.area_types, :areas, :translated_name, :id, :translated_name, current_assembly.try(:decidim_area_id)), include_blank: t(".select_an_area") %>
81
+ <%= form.select :area_id, option_groups_from_collection_for_select(current_organization.area_types, :areas, :translated_name, :id, :translated_name, current_assembly.try(:decidim_area_id)), include_blank: t(".select_an_area") %>
80
82
  </div>
81
83
 
82
84
  <div class="row column">
@@ -90,6 +92,79 @@
90
92
  <div class="row column">
91
93
  <%= form.check_box :show_statistics %>
92
94
  </div>
95
+
96
+ <div class="row column">
97
+ <% if @form.processes_for_select %>
98
+ <%= form.select :participatory_processes_ids,
99
+ options_for_select(@form.processes_for_select, selected: processes_selected ),
100
+ { include_blank: false },
101
+ { multiple: true, class: "chosen-select" } %>
102
+ <% end %>
103
+ </div>
104
+
105
+ <div class="row column">
106
+ <%= form.translated :editor, :purpose_of_action %>
107
+ </div>
108
+
109
+ <div class="row column">
110
+ <%= form.translated :editor, :composition %>
111
+ </div>
112
+
113
+ <div class="row column">
114
+ <%= form.select :assembly_type, @form.assembly_types_for_select, { include_blank: t(".select_an_assembly_type") }, { multiple: false } %>
115
+ </div>
116
+
117
+ <div class="row column" id="assembly_type_other">
118
+ <%= form.translated :text_field, :assembly_type_other %>
119
+ </div>
120
+
121
+ <div class="row column">
122
+ <%= form.date_field :creation_date %>
123
+ </div>
124
+
125
+ <div class="row column">
126
+ <%= form.select :created_by, @form.created_by_for_select, { include_blank: t(".select_a_created_by") }, { multiple: false } %>
127
+ </div>
128
+
129
+ <div class="row column" id="created_by_other">
130
+ <%= form.translated :text_field, :created_by_other %>
131
+ </div>
132
+
133
+ <div class="row column">
134
+ <%= form.date_field :duration %>
135
+ </div>
136
+
137
+ <div class="row column">
138
+ <%= form.date_field :included_at %>
139
+ </div>
140
+
141
+ <div class="row column" id="closing_date_div">
142
+ <%= form.date_field :closing_date %>
143
+ </div>
144
+
145
+ <div class="row column" id="closing_date_reason_div">
146
+ <%= form.translated :editor, :closing_date_reason %>
147
+ </div>
148
+
149
+ <div class="row column">
150
+ <%= form.translated :editor, :internal_organisation %>
151
+ </div>
152
+
153
+ <div class="row column" id="private_space">
154
+ <%= form.check_box :private_space %>
155
+ </div>
156
+
157
+ <div class="row column" id="is_transparent">
158
+ <%= form.check_box :is_transparent %>
159
+ </div>
160
+
161
+ <div class="row column" id="special_features">
162
+ <%= form.translated :editor, :special_features %>
163
+ </div>
164
+
165
+ <div class="columns xlarge-6">
166
+ <%= form.social_field :text_field, :social_handlers, Decidim::Assembly::SOCIAL_HANDLERS, label: t("social_handlers", scope: "decidim.assemblies.admin.assemblies.form") %>
167
+ </div>
93
168
  </div>
94
169
  </div>
95
170
 
@@ -1,7 +1,7 @@
1
- <%= decidim_form_for(@form, html: { class: "form edit_assembly" }) do |f| %>
2
- <%= render partial: 'form', object: f %>
1
+ <%= decidim_form_for(@form, html: { class: "form edit_assembly assembly_form_admin" }) do |f| %>
2
+ <%= render partial: "form", object: f %>
3
3
  <div class="button--double form-general-submit">
4
- <%= f.submit t("assemblies.edit.update", scope: "decidim.admin"), class: "button" %>
4
+ <%= f.submit t("assemblies.edit.update", scope: "decidim.admin"), class: "button" %>
5
5
 
6
6
  <% if can? :publish, current_assembly %>
7
7
  <% if current_assembly.published? %>
@@ -16,4 +16,3 @@
16
16
  <% end %>
17
17
  </div>
18
18
  <% end %>
19
-
@@ -1,7 +1,11 @@
1
1
  <div class="card" id="assemblies">
2
2
  <div class="card-divider">
3
3
  <h2 class="card-title">
4
- <%= t "decidim.admin.titles.assemblies" %><%= link_to t("actions.new", scope: "decidim.admin", name: t("models.assembly.name", scope: "decidim.admin")), ['new', 'assembly'], class: 'button tiny button--title' if can? :create, Decidim::Assembly %>
4
+ <% parent_assembly.self_and_ancestors.each do |assembly| %>
5
+ <%= link_to "#{translated_attribute(assembly.title)} > ", edit_assembly_path(assembly) %>
6
+ <% end if parent_assembly %>
7
+ <%= t "decidim.admin.titles.assemblies" %>
8
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.assembly.name", scope: "decidim.admin")), new_assembly_path(parent_id: parent_assembly&.id), class: "button tiny button--title" if can? :create, Decidim::Assembly %>
5
9
  </h2>
6
10
  </div>
7
11
  <div class="card-section">
@@ -11,6 +15,7 @@
11
15
  <tr>
12
16
  <th><%= t("models.assembly.fields.title", scope: "decidim.admin") %></th>
13
17
  <th><%= t("models.assembly.fields.created_at", scope: "decidim.admin") %></th>
18
+ <th><%= t("models.assembly.fields.private", scope: "decidim.admin") %></th>
14
19
  <th class="table-list__actions"><%= t("models.assembly.fields.published", scope: "decidim.admin") %></th>
15
20
  <th></th>
16
21
  </tr>
@@ -20,7 +25,7 @@
20
25
  <tr>
21
26
  <td>
22
27
  <% if assembly.promoted? %>
23
- <span data-tooltip class="icon-state icon-highlight" aria-haspopup="true" data-disable-hover="false" title="<%= t("models.assembly.fields.promoted", scope: "decidim.admin") %>">
28
+ <span data-tooltip class="icon-state icon-highlight" aria-haspopup="true" data-disable-hover="false" title="<%= t("models.assembly.fields.promoted", scope: "decidim.admin") %>">
24
29
  <%= icon "star" %>
25
30
  </span>
26
31
  <% end %>
@@ -37,11 +42,18 @@
37
42
  <td>
38
43
  <%= l assembly.created_at, format: :short %>
39
44
  </td>
45
+ <td class="table-list__state">
46
+ <% if assembly.private_space? %>
47
+ <strong class="text-alert"><%= t("assemblies.index.private", scope: "decidim.admin") %></strong>
48
+ <% else %>
49
+ <strong class="text-success"><%= t("assemblies.index.public", scope: "decidim.admin") %></strong>
50
+ <% end %>
51
+ </td>
40
52
  <td class="table-list__state">
41
53
  <% if assembly.published? %>
42
- <strong class="text-success"><%= t('assemblies.index.published', scope: "decidim.admin") %></strong>
54
+ <strong class="text-success"><%= t("assemblies.index.published", scope: "decidim.admin") %></strong>
43
55
  <% else %>
44
- <strong class="text-alert"><%= t('assemblies.index.not_published', scope: "decidim.admin") %></strong>
56
+ <strong class="text-alert"><%= t("assemblies.index.not_published", scope: "decidim.admin") %></strong>
45
57
  <% end %>
46
58
  </td>
47
59
  <td class="table-list__actions">
@@ -53,6 +65,10 @@
53
65
  <%= icon_link_to "pencil", edit_assembly_path(assembly), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
54
66
  <% end %>
55
67
 
68
+ <% if assembly.children_count > 0 || can?(:create, assembly) %>
69
+ <%= icon_link_to "dial", decidim_admin_assemblies.assemblies_path(parent_id: assembly.id), t("decidim.admin.titles.assemblies"), class: "action-icon--dial" %>
70
+ <% end %>
71
+
56
72
  <% if can? :preview, assembly %>
57
73
  <%= icon_link_to "eye", decidim_assemblies.assembly_path(assembly), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview" %>
58
74
  <% end %>
@@ -2,8 +2,8 @@
2
2
  <%= t "assemblies.new.title", scope: "decidim.admin" %>
3
3
  </h2>
4
4
 
5
- <%= decidim_form_for(@form, html: { class: "form new_assembly" }) do |f| %>
6
- <%= render partial: 'form', object: f %>
5
+ <%= decidim_form_for(@form, html: { class: "form new_assembly assembly_form_admin" }) do |f| %>
6
+ <%= render partial: "form", object: f %>
7
7
 
8
8
  <div class="button--double form-general-submit">
9
9
  <%= f.submit t("assemblies.new.create", scope: "decidim.admin") %>
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
 
29
29
  <div class="columns xlarge-6">
30
- <%= form.check_box :copy_features %>
30
+ <%= form.check_box :copy_components %>
31
31
  </div>
32
32
  </div>
33
33
  </div>
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: assembly_copies_path(current_assembly), method: :post, html: { class: "form copy_assembly" }) do |f| %>
2
- <%= render partial: 'form', object: f, locals: { title: t('assembly_copies.new.title', scope: "decidim.admin"), select: t('assembly_copies.new.select', scope: "decidim.admin")} %>
2
+ <%= render partial: "form", object: f, locals: { title: t("assembly_copies.new.title", scope: "decidim.admin"), select: t("assembly_copies.new.select", scope: "decidim.admin")} %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("assembly_copies.new.copy", scope: "decidim.admin") %>
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, url: assembly_user_role_path(@user_role.assembly, @user_role), html: { class: "form edit_assembly_user_roles" }) do |f| %>
2
- <%= render partial: 'form', object: f, locals: { title: t('assembly_user_roles.edit.title', scope: "decidim.admin") } %>
2
+ <%= render partial: "form", object: f, locals: { title: t("assembly_user_roles.edit.title", scope: "decidim.admin") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("assembly_user_roles.edit.update", scope: "decidim.admin") %>
@@ -3,7 +3,7 @@
3
3
  <h2 class="card-title">
4
4
  <%= t("assembly_user_roles.index.assembly_admins_title", scope: "decidim.admin") %>
5
5
  <% if can? :create, Decidim::AssemblyUserRole %>
6
- <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.assembly_user_role.name", scope: "decidim.admin")), new_assembly_user_role_path(current_assembly), class: 'button tiny button--title new' %>
6
+ <%= link_to t("actions.new", scope: "decidim.admin", name: t("models.assembly_user_role.name", scope: "decidim.admin")), new_assembly_user_role_path(current_assembly), class: "button tiny button--title new" %>
7
7
  <% end %>
8
8
  </h2>
9
9
  </div>
@@ -1,5 +1,5 @@
1
1
  <%= decidim_form_for(@form, html: { class: "form new_assembly_user_role" }) do |f| %>
2
- <%= render partial: 'form', object: f, locals: { title: t('assembly_user_roles.new.title', scope: "decidim.admin") } %>
2
+ <%= render partial: "form", object: f, locals: { title: t("assembly_user_roles.new.title", scope: "decidim.admin") } %>
3
3
 
4
4
  <div class="button--double form-general-submit">
5
5
  <%= f.submit t("assembly_user_roles.new.create", scope: "decidim.admin") %>
@@ -0,0 +1,11 @@
1
+ <div class="lines-breadcrumb">
2
+ <% root = assemblies.shift %>
3
+ <%= link_to translated_attribute(root.title), assembly_path(root) %>
4
+
5
+ <% assemblies.each do |assembly| %>
6
+ <span class="breadcrumb--separator">></span>
7
+ <div>
8
+ <%= link_to translated_attribute(assembly.title), assembly_path(assembly) %>
9
+ </div>
10
+ <% end %>
11
+ </div>
@@ -5,7 +5,7 @@
5
5
  <%= link_to assembly_path(promoted_assembly), class: "card__link" do %>
6
6
  <h2 class="card__title"><%= translated_attribute promoted_assembly.title %></h2>
7
7
  <% end %>
8
- <%= decidim_sanitize html_truncate(translated_attribute(promoted_assembly.short_description), length: 630, separator: '...') %>
8
+ <%= decidim_sanitize html_truncate(translated_attribute(promoted_assembly.short_description), length: 630, separator: "...") %>
9
9
  <%= link_to assembly_path(promoted_assembly), class: "button secondary small hollow card__button" do %>
10
10
  <%= t("assemblies.promoted_assembly.more_info", scope: "layouts.decidim") %>
11
11
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <section class="extended" id="assembly-statistics" class="statistics">
2
2
  <div class="row column">
3
- <h4 class="section-heading"><%= t("statistics.headline", scope: "decidim.assemblies", assembly: translated_attribute(current_participatory_space.title)) %></h3>
3
+ <h4 class="section-heading"><%= t("statistics.headline", scope: "decidim.assemblies") %></h3>
4
4
  </div>
5
5
  <div class="row">
6
6
  <div class="columns small-centered mediumlarge-12 large-12 process_stats">
@@ -2,7 +2,7 @@
2
2
 
3
3
  <main class="wrapper">
4
4
  <% if promoted_assemblies.any? %>
5
- <section id ="highlighted-assemblies" class="row section">
5
+ <section id="highlighted-assemblies" class="row section">
6
6
  <h1 class="section-heading"><%= t("assemblies.index.promoted_assemblies", scope: "layouts.decidim") %></h1>
7
7
  <%= render partial: "promoted_assembly", collection: promoted_assemblies, as: :promoted_assembly %>
8
8
  </section>