decidim-meetings 0.22.0 → 0.23.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/decidim_meetings_manifest.js +1 -0
  3. data/app/assets/javascripts/decidim/meetings/admin/meetings_form.js.es6 +3 -0
  4. data/app/assets/javascripts/decidim/meetings/meetings_form.js.es6 +9 -0
  5. data/app/cells/decidim/meetings/content_blocks/upcoming_events_cell.rb +2 -1
  6. data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +1 -1
  7. data/app/cells/decidim/meetings/meeting_cell.rb +1 -1
  8. data/app/cells/decidim/meetings/meeting_list_item_cell.rb +2 -2
  9. data/app/cells/decidim/meetings/meeting_m_cell.rb +9 -1
  10. data/app/cells/decidim/meetings/meetings_map/show.erb +0 -2
  11. data/app/cells/decidim/meetings/meetings_map_cell.rb +3 -1
  12. data/app/commands/decidim/meetings/admin/close_meeting.rb +1 -2
  13. data/app/commands/decidim/meetings/admin/copy_meeting.rb +38 -28
  14. data/app/commands/decidim/meetings/admin/create_meeting.rb +36 -24
  15. data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +2 -1
  16. data/app/commands/decidim/meetings/admin/update_meeting.rb +9 -3
  17. data/app/commands/decidim/meetings/create_meeting.rb +78 -0
  18. data/app/commands/decidim/meetings/update_meeting.rb +94 -0
  19. data/app/controllers/decidim/meetings/admin/application_controller.rb +1 -1
  20. data/app/controllers/decidim/meetings/admin/meetings_controller.rb +11 -7
  21. data/app/controllers/decidim/meetings/admin/registration_form_controller.rb +4 -0
  22. data/app/controllers/decidim/meetings/meetings_controller.rb +76 -13
  23. data/app/controllers/decidim/meetings/registrations_controller.rb +1 -1
  24. data/app/controllers/decidim/meetings/versions_controller.rb +14 -0
  25. data/app/controllers/decidim/meetings/{meeting_widgets_controller.rb → widgets_controller.rb} +2 -2
  26. data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +2 -8
  27. data/app/forms/decidim/meetings/admin/meeting_form.rb +24 -23
  28. data/app/forms/decidim/meetings/meeting_form.rb +78 -0
  29. data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -6
  30. data/app/helpers/decidim/meetings/application_helper.rb +25 -0
  31. data/app/helpers/decidim/meetings/meetings_helper.rb +12 -0
  32. data/app/models/decidim/meetings/agenda.rb +3 -0
  33. data/app/models/decidim/meetings/agenda_item.rb +3 -0
  34. data/app/models/decidim/meetings/meeting.rb +69 -23
  35. data/app/models/decidim/meetings/minutes.rb +3 -0
  36. data/app/models/decidim/meetings/service.rb +13 -0
  37. data/app/permissions/decidim/meetings/admin/permissions.rb +2 -0
  38. data/app/permissions/decidim/meetings/permissions.rb +20 -0
  39. data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +5 -1
  40. data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +3 -4
  41. data/app/presenters/decidim/meetings/meeting_presenter.rb +7 -3
  42. data/app/presenters/decidim/meetings/official_author_presenter.rb +14 -0
  43. data/app/queries/decidim/meetings/filtered_meetings.rb +1 -1
  44. data/app/services/decidim/meetings/diff_renderer.rb +21 -0
  45. data/app/services/decidim/meetings/meeting_search.rb +3 -25
  46. data/app/types/decidim/meetings/meeting_type.rb +1 -1
  47. data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +2 -9
  48. data/app/views/decidim/meetings/admin/meetings/_form.html.erb +4 -11
  49. data/app/views/decidim/meetings/admin/meetings/edit.html.erb +1 -1
  50. data/app/views/decidim/meetings/admin/meetings/index.html.erb +4 -2
  51. data/app/views/decidim/meetings/directory/meetings/index.js.erb +11 -4
  52. data/app/views/decidim/meetings/meetings/_count.html.erb +1 -0
  53. data/app/views/decidim/meetings/meetings/_filters.html.erb +8 -10
  54. data/app/views/decidim/meetings/meetings/_form.html.erb +51 -0
  55. data/app/views/decidim/meetings/meetings/edit.html.erb +25 -0
  56. data/app/views/decidim/meetings/meetings/index.html.erb +15 -0
  57. data/app/views/decidim/meetings/meetings/index.js.erb +13 -4
  58. data/app/views/decidim/meetings/meetings/new.html.erb +25 -0
  59. data/app/views/decidim/meetings/meetings/show.html.erb +24 -9
  60. data/app/views/decidim/meetings/versions/index.html.erb +8 -0
  61. data/app/views/decidim/meetings/versions/show.html.erb +10 -0
  62. data/config/locales/am-ET.yml +1 -0
  63. data/config/locales/ar.yml +0 -8
  64. data/config/locales/bg-BG.yml +0 -8
  65. data/config/locales/bg.yml +21 -0
  66. data/config/locales/ca.yml +49 -7
  67. data/config/locales/cs.yml +57 -13
  68. data/config/locales/da.yml +1 -0
  69. data/config/locales/de.yml +113 -71
  70. data/config/locales/el.yml +2 -7
  71. data/config/locales/en.yml +49 -7
  72. data/config/locales/eo.yml +1 -0
  73. data/config/locales/es-MX.yml +49 -7
  74. data/config/locales/es-PY.yml +50 -8
  75. data/config/locales/es.yml +50 -8
  76. data/config/locales/et.yml +1 -0
  77. data/config/locales/eu.yml +0 -8
  78. data/config/locales/fi-plain.yml +49 -7
  79. data/config/locales/fi.yml +168 -126
  80. data/config/locales/fr-CA.yml +57 -7
  81. data/config/locales/fr.yml +57 -7
  82. data/config/locales/gl.yml +3 -7
  83. data/config/locales/hr.yml +1 -0
  84. data/config/locales/hu.yml +2 -7
  85. data/config/locales/id-ID.yml +0 -8
  86. data/config/locales/is-IS.yml +0 -7
  87. data/config/locales/is.yml +228 -0
  88. data/config/locales/it.yml +47 -7
  89. data/config/locales/ja-JP.yml +48 -9
  90. data/config/locales/ja.yml +496 -0
  91. data/config/locales/ko-KR.yml +1 -0
  92. data/config/locales/ko.yml +1 -0
  93. data/config/locales/lt.yml +1 -0
  94. data/config/locales/{lv-LV.yml → lv.yml} +2 -2
  95. data/config/locales/mt.yml +1 -0
  96. data/config/locales/nl.yml +49 -7
  97. data/config/locales/no.yml +34 -8
  98. data/config/locales/om-ET.yml +1 -0
  99. data/config/locales/pl.yml +193 -149
  100. data/config/locales/pt-BR.yml +1 -9
  101. data/config/locales/pt.yml +47 -7
  102. data/config/locales/ro-RO.yml +48 -7
  103. data/config/locales/ru.yml +0 -8
  104. data/config/locales/si-LK.yml +1 -0
  105. data/config/locales/sk.yml +2 -7
  106. data/config/locales/sl.yml +25 -2
  107. data/config/locales/so-SO.yml +1 -0
  108. data/config/locales/sv.yml +56 -8
  109. data/config/locales/sw-KE.yml +1 -0
  110. data/config/locales/ti-ER.yml +1 -0
  111. data/config/locales/tr-TR.yml +154 -98
  112. data/config/locales/uk.yml +0 -7
  113. data/config/locales/vi-VN.yml +1 -0
  114. data/config/locales/vi.yml +1 -0
  115. data/config/locales/zh-CN.yml +496 -0
  116. data/config/locales/zh-TW.yml +1 -0
  117. data/db/migrate/20200526110940_add_author_to_meetings.rb +30 -0
  118. data/db/migrate/20200702123209_create_meeting_services_table.rb +13 -0
  119. data/db/migrate/20200702123210_move_meeting_services_to_own_model.rb +31 -0
  120. data/db/migrate/20200827153856_add_commentable_counter_cache_to_meetings.rb +9 -0
  121. data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +29 -0
  122. data/db/migrate/20201111133246_add_salt_to_decidim_meetings.rb +8 -0
  123. data/lib/decidim/api/services_interface.rb +1 -7
  124. data/lib/decidim/meetings/admin_engine.rb +2 -0
  125. data/lib/decidim/meetings/component.rb +63 -11
  126. data/lib/decidim/meetings/engine.rb +3 -2
  127. data/lib/decidim/meetings/meeting_serializer.rb +1 -1
  128. data/lib/decidim/meetings/test/factories.rb +45 -8
  129. data/lib/decidim/meetings/version.rb +1 -1
  130. metadata +62 -22
  131. data/app/presenters/decidim/meetings/admin_log/value_types/organizer_presenter.rb +0 -70
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ #
6
+ # A dummy presenter to abstract out the author of an official meeting.
7
+ #
8
+ class OfficialAuthorPresenter < Decidim::OfficialAuthorPresenter
9
+ def name
10
+ I18n.t("decidim.meetings.models.meeting.fields.official_meeting")
11
+ end
12
+ end
13
+ end
14
+ end
@@ -27,7 +27,7 @@ module Decidim
27
27
  # Finds the Projects scoped to an array of components and filtered
28
28
  # by a range of dates.
29
29
  def query
30
- meetings = Decidim::Meetings::Meeting.where(component: @components)
30
+ meetings = Decidim::Meetings::Meeting.not_hidden.where(component: @components)
31
31
  meetings = meetings.where("created_at >= ?", @start_at) if @start_at.present?
32
32
  meetings = meetings.where("created_at <= ?", @end_at) if @end_at.present?
33
33
  meetings
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Meetings
5
+ class DiffRenderer < BaseDiffRenderer
6
+ def attribute_types
7
+ {
8
+ title: :string,
9
+ description: :html,
10
+ address: :string,
11
+ location: :string,
12
+ location_hints: :string,
13
+ start_time: :date,
14
+ end_time: :date,
15
+ decidim_user_group_id: :user_group,
16
+ decidim_scope_id: :scope
17
+ }
18
+ end
19
+ end
20
+ end
21
+ end
@@ -6,6 +6,8 @@ module Decidim
6
6
  # `current_component` param with a `Decidim::Component` in order to
7
7
  # find the meetings.
8
8
  class MeetingSearch < ResourceSearch
9
+ text_search_fields :title, :description
10
+
9
11
  # Public: Initializes the service.
10
12
  # component - A Decidim::Component to get the meetings from.
11
13
  # page - The page number to paginate the results.
@@ -15,20 +17,9 @@ module Decidim
15
17
  super(scope, options)
16
18
  end
17
19
 
18
- # Handle the search_text filter
19
- def search_search_text
20
- query
21
- .where(localized_search_text_in(:title), text: "%#{search_text}%")
22
- .or(query.where(localized_search_text_in(:description), text: "%#{search_text}%"))
23
- end
24
-
25
20
  # Handle the date filter
26
21
  def search_date
27
- if options[:date] == "upcoming"
28
- query.where("end_time >= ? ", Time.current).order(start_time: :asc)
29
- elsif options[:date] == "past"
30
- query.where("end_time <= ? ", Time.current).order(start_time: :desc)
31
- end
22
+ apply_scopes(%w(upcoming past), date)
32
23
  end
33
24
 
34
25
  def search_space
@@ -36,19 +27,6 @@ module Decidim
36
27
 
37
28
  query.joins(:component).where(decidim_components: { participatory_space_type: options[:space].classify })
38
29
  end
39
-
40
- private
41
-
42
- # Internal: builds the needed query to search for a text in the organization's
43
- # available locales. Note that it is intended to be used as follows:
44
- #
45
- # Example:
46
- # Resource.where(localized_search_text_for(:title, text: "my_query"))
47
- #
48
- # The Hash with the `:text` key is required or it won't work.
49
- def localized_search_text_in(field)
50
- options[:organization].available_locales.map { |l| "#{field} ->> '#{l}' ILIKE :text" }.join(" OR ")
51
- end
52
30
  end
53
31
  end
54
32
  end
@@ -23,7 +23,7 @@ module Decidim
23
23
  field :description, Decidim::Core::TranslatedFieldType, "The description of this meeting."
24
24
  field :startTime, !Decidim::Core::DateTimeType, "The time this meeting starts", property: :start_time
25
25
  field :endTime, !Decidim::Core::DateTimeType, "The time this meeting ends", property: :end_time
26
- field :organizer, Decidim::Core::AuthorInterface, "If specified, the organizer of this meeting"
26
+ field :author, Decidim::Core::AuthorInterface, "If specified, the author of this meeting"
27
27
  field :agenda, AgendaType, "Agenda for this meeting, if available" do
28
28
  resolve ->(meeting, _args, _ctx) {
29
29
  meeting.agenda if meeting.agenda&.visible?
@@ -4,7 +4,7 @@
4
4
  </div>
5
5
 
6
6
  <div class="card-section">
7
- <div class="row column hashtags__container">
7
+ <div class="row column hashtags__container">
8
8
  <%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true, value: @meeting.present? ? present(@meeting).title(all_locales: true) : @form.title.with_indifferent_access %>
9
9
  </div>
10
10
 
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
 
15
15
  <div class="row column">
16
- <%= form.text_field :address %>
16
+ <%= form.geocoding_field :address %>
17
17
  </div>
18
18
 
19
19
  <div class="row column">
@@ -34,13 +34,6 @@
34
34
  </div>
35
35
  </div>
36
36
 
37
- <div class="row column">
38
- <% prompt_options = { url: decidim_admin.users_organization_url, text: t(".select_organizer") } %>
39
- <%= form.autocomplete_select(:organizer_id, form.object.organizer.presence, { multiple: false }, prompt_options) do |user|
40
- { value: user.id, label: "#{user.name} (@#{user.nickname})" }
41
- end %>
42
- </div>
43
-
44
37
  <div class="row column" id="private_meeting">
45
38
  <%= form.check_box :private_meeting %>
46
39
  </div>
@@ -3,7 +3,7 @@
3
3
  <h2 class="card-title"><%= title %></h2>
4
4
  </div>
5
5
  <div class="card-section">
6
- <div class="row column hashtags__container">
6
+ <div class="row column hashtags__container">
7
7
  <%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true %>
8
8
  </div>
9
9
 
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
 
14
14
  <div class="row column">
15
- <%= form.text_field :address %>
15
+ <%= form.geocoding_field :address %>
16
16
  <p class="help-text"><%= t(".address_help") %></p>
17
17
  </div>
18
18
 
@@ -36,9 +36,9 @@
36
36
  </div>
37
37
  </div>
38
38
  <div class="row">
39
- <% if current_participatory_space.has_subscopes? %>
39
+ <% if current_component.has_subscopes? %>
40
40
  <div class="columns xlarge-6">
41
- <%= scopes_picker_field form, :decidim_scope_id %>
41
+ <%= scopes_picker_field form, :decidim_scope_id, root: current_component.scope %>
42
42
  </div>
43
43
  <% end %>
44
44
 
@@ -47,13 +47,6 @@
47
47
  </div>
48
48
  </div>
49
49
 
50
- <div class="row column">
51
- <% prompt_options = { url: decidim_admin.users_organization_url, text: t(".select_organizer") } %>
52
- <%= form.autocomplete_select(:organizer_id, form.object.organizer.presence, { multiple: false }, prompt_options) do |user|
53
- { value: user.id, label: "#{user.name} (@#{user.nickname})" }
54
- end %>
55
- </div>
56
-
57
50
  <div class="row column" id="private_meeting">
58
51
  <%= form.check_box :private_meeting %>
59
52
  </div>
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for(@form, html: { class: "form edit_meeting" }) do |f| %>
1
+ <%= decidim_form_for(@form, url: { action: "update" }, html: { class: "form edit_meeting" }) do |f| %>
2
2
  <%= render partial: "form", object: f %>
3
3
 
4
4
  <div class="button--double form-general-submit">
@@ -18,9 +18,10 @@
18
18
  <th><%= t("models.meeting.fields.start_time", scope: "decidim.meetings") %></th>
19
19
  <th><%= t("models.meeting.fields.end_time", scope: "decidim.meetings") %></th>
20
20
  <th><%= t("models.meeting.fields.closed", scope: "decidim.meetings") %></th>
21
- <% if Decidim.geocoder.present? %>
21
+ <% if Decidim::Map.available?(:static, :geocoding) %>
22
22
  <th><%= t("models.meeting.fields.map", scope: "decidim.meetings") %></th>
23
23
  <% end %>
24
+ <%= th_resource_scope_label %>
24
25
  <th class="actions"><%= t("actions.title", scope: "decidim.meetings") %></th>
25
26
  </tr>
26
27
  </thead>
@@ -43,11 +44,12 @@
43
44
  <td>
44
45
  <%= humanize_boolean meeting.closed? %>
45
46
  </td>
46
- <% if Decidim.geocoder.present? %>
47
+ <% if Decidim::Map.available?(:static, :geocoding) %>
47
48
  <td>
48
49
  <%= static_map_link(meeting) %>
49
50
  </td>
50
51
  <% end %>
52
+ <%= td_resource_scope_for(meeting.scope) %>
51
53
  <td class="table-list__actions">
52
54
  <%= icon_link_to "eye", resource_locator(meeting).path, t("actions.preview", scope: "decidim.meetings"), class: "action-icon--preview", target: :blank %>
53
55
 
@@ -5,7 +5,14 @@ $meetings.html('<%= j(render partial: "meetings").strip.html_safe %>');
5
5
  var $dropdownMenu = $('.dropdown.menu', $meetings);
6
6
  $dropdownMenu.foundation();
7
7
 
8
- window.Decidim.currentMap = window.Decidim.loadMap(
9
- 'map',
10
- JSON.parse('<%= escape_javascript meetings_data_for_map(search.results).to_json.html_safe %>')
11
- );
8
+ var markerData = JSON.parse('<%= escape_javascript meetings_data_for_map(search.results).to_json.html_safe %>');
9
+
10
+ var $map = $("#map");
11
+ var controller = $map.data("map-controller");
12
+ if (controller) {
13
+ controller.clearMarkers();
14
+ controller.addMarkers(markerData);
15
+ } else {
16
+ // @deprecated Legacy support
17
+ window.Decidim.currentMap = window.Decidim.loadMap('map', markerData);
18
+ }
@@ -0,0 +1 @@
1
+ <%= t(".meetings_count", count: search.results.count) %>
@@ -15,20 +15,18 @@
15
15
  </div>
16
16
 
17
17
  <% unless @forced_past_meetings %>
18
- <%= form.collection_radio_buttons :date, [["upcoming", t(".upcoming")], ["past", t(".past")]], :first, :last, legend_title: t(".date") %>
18
+ <%= form.check_boxes_tree :date, filter_date_values, legend_title: t(".date") %>
19
19
  <% end %>
20
20
 
21
- <% if current_participatory_space.has_subscopes? %>
22
- <%= scopes_picker_filter form, :scope_id %>
21
+ <% if current_component.has_subscopes? %>
22
+ <%= form.check_boxes_tree :scope_id, filter_scopes_values, legend_title: t(".scope") %>
23
23
  <% end %>
24
24
 
25
25
  <% if current_component.categories.any? %>
26
- <%= form.categories_select :category_id,
27
- current_component.categories,
28
- legend_title: t(".category"),
29
- disable_parents: false,
30
- label: "",
31
- prompt: t(".category_prompt"),
32
- aria_label: t(".category") %>
26
+ <%= form.check_boxes_tree :category_id, filter_categories_values, legend_title: t(".category") %>
27
+ <% end %>
28
+
29
+ <% if component_settings.creation_enabled_for_participants? %>
30
+ <%= form.check_boxes_tree :origin, filter_origin_values, legend_title: t(".origin") %>
33
31
  <% end %>
34
32
  <% end %>
@@ -0,0 +1,51 @@
1
+ <div class="field hashtags__container">
2
+ <%= form.text_field :title, autofocus: true, class: "js-hashtags", hashtaggable: true %>
3
+ </div>
4
+
5
+ <div class="field hashtags__container">
6
+ <%= text_editor_for(form, :description, hashtaggable: true) %>
7
+ </div>
8
+
9
+ <div class="field">
10
+ <%= form.geocoding_field :address %>
11
+ <p class="help-text"><%= t(".address_help") %></p>
12
+ </div>
13
+
14
+ <div class="field">
15
+ <%= form.text_area :location %>
16
+ <p class="help-text"><%= t(".location_help") %></p>
17
+ </div>
18
+
19
+ <div class="field">
20
+ <%= form.text_area :location_hints %>
21
+ <p class="help-text"><%= t(".location_hints_help") %></p>
22
+ </div>
23
+
24
+ <div class="field">
25
+ <%= form.datetime_field :start_time %>
26
+ </div>
27
+
28
+ <div class="field">
29
+ <%= form.datetime_field :end_time %>
30
+ </div>
31
+
32
+ <% if current_participatory_space.has_subscopes? %>
33
+ <div class="field">
34
+ <%= scopes_picker_field form, :decidim_scope_id %>
35
+ </div>
36
+ <% end %>
37
+
38
+ <div class="field">
39
+ <%= form.categories_select :decidim_category_id, current_participatory_space.categories, prompt: t(".select_a_category"), disable_parents: false %>
40
+ </div>
41
+
42
+ <div class="field">
43
+ <%= form.select(
44
+ :user_group_id,
45
+ Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.map{|g| [g.name, g.id]},
46
+ prompt: current_user.name,
47
+ label: t(".create_as")
48
+ ) %>
49
+ </div>
50
+
51
+ <%= javascript_include_tag "decidim/meetings/meetings_form" %>
@@ -0,0 +1,25 @@
1
+ <div class="row">
2
+ <div class="columns large-3">
3
+ <%= link_to :back do %>
4
+ <%= icon "chevron-left", class: "icon--small", role: "img" %>
5
+ <%= t(".back") %>
6
+ <% end %>
7
+ </div>
8
+
9
+ <div class="columns large-6">
10
+ <h2 class="section-heading"><%= t(".title") %></h2>
11
+ <div class="card">
12
+ <div class="card__content">
13
+ <%= decidim_form_for(@form) do |f| %>
14
+ <%= render partial: "form", object: f %>
15
+
16
+ <div class="actions">
17
+ <%= f.submit t(".update"), class: "button expanded", data: { disable: true } %>
18
+ </div>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="columns large-3"></div>
25
+ </div>
@@ -2,6 +2,21 @@
2
2
 
3
3
  <%= cell "decidim/meetings/meetings_map", search.results %>
4
4
 
5
+ <div class="row columns">
6
+ <div class="title-action">
7
+ <h3 id="meetings-count" class="title-action__title section-heading">
8
+ <%= render partial: "count" %>
9
+ </h3>
10
+
11
+ <% if allowed_to?(:create, :meeting) %>
12
+ <%= action_authorized_link_to :create, new_meeting_path, class: "title-action__action button small", data: { "redirect_url" => new_meeting_path } do %>
13
+ <%= t("new_meeting", scope: "decidim.meetings.meetings.index") %>
14
+ <%= icon "plus", role: "img" %>
15
+ <% end %>
16
+ <% end %>
17
+ </div>
18
+ </div>
19
+
5
20
  <div class="row">
6
21
  <div class="columns mediumlarge-4 large-3">
7
22
  <%= render partial: "filters_small_view" %>
@@ -1,11 +1,20 @@
1
1
  var $meetings = $('#meetings');
2
+ var $meetingsCount = $('#meetings-count');
2
3
 
3
4
  $meetings.html('<%= j(render partial: "meetings").strip.html_safe %>');
5
+ $meetingsCount.html('<%= j(render partial: "count").strip.html_safe %>');
4
6
 
5
7
  var $dropdownMenu = $('.dropdown.menu', $meetings);
6
8
  $dropdownMenu.foundation();
7
9
 
8
- window.Decidim.currentMap = window.Decidim.loadMap(
9
- 'map',
10
- JSON.parse('<%= escape_javascript meetings_data_for_map(search.results.select(&:geocoded?)).to_json.html_safe %>')
11
- );
10
+ var markerData = JSON.parse('<%= escape_javascript meetings_data_for_map(search.results.select(&:geocoded?)).to_json.html_safe %>');
11
+
12
+ var $map = $("#map");
13
+ var controller = $map.data("map-controller");
14
+ if (controller) {
15
+ controller.clearMarkers();
16
+ controller.addMarkers(markerData);
17
+ } else {
18
+ // @deprecated Legacy support
19
+ window.Decidim.currentMap = window.Decidim.loadMap('map', markerData);
20
+ }
@@ -0,0 +1,25 @@
1
+ <div class="row">
2
+ <div class="columns large-3">
3
+ <%= link_to :back do %>
4
+ <%= icon "chevron-left", class: "icon--small", role: "img" %>
5
+ <%= t(".back") %>
6
+ <% end %>
7
+ </div>
8
+
9
+ <div class="columns large-6">
10
+ <h2 class="section-heading"><%= t(".title") %></h2>
11
+ <div class="card">
12
+ <div class="card__content">
13
+ <%= decidim_form_for(@form) do |f| %>
14
+ <%= render partial: "form", object: f %>
15
+
16
+ <div class="actions">
17
+ <%= f.submit t(".create"), class: "button expanded", data: { disable: true } %>
18
+ </div>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="columns large-3"></div>
25
+ </div>
@@ -16,20 +16,26 @@ edit_link(
16
16
  %>
17
17
 
18
18
  <div class="row column view-header">
19
-
20
- <%= link_to :meetings, class: "small hollow" do %>
21
- <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
22
- <%= t(".back") %>
23
- <% end %>
19
+ <div class="m-bottom">
20
+ <%= link_to meetings_path(filter_link_params), class: "small hollow" do %>
21
+ <%= icon "chevron-left", class: "icon--small", role: "img", "aria-hidden": true %>
22
+ <%= t(".back") %>
23
+ <% end %>
24
+ </div>
24
25
 
25
26
  <h2 class="heading2"><%= present(meeting).title(links: true) %></h2>
26
- <% if meeting.organizer.present? %>
27
- <%= cell "decidim/author", present(meeting.organizer) %>
28
- <% end %>
27
+
28
+ <%= cell "decidim/author", author_presenter_for(meeting.normalized_author), has_actions: true, from: meeting, context: { extra_classes: ["author-data--small"] } %>
29
+
29
30
  </div>
30
31
  <div class="row">
31
32
  <div class="columns section view-side mediumlarge-4 mediumlarge-push-8
32
33
  large-3 large-push-9">
34
+
35
+ <% if allowed_to?(:update, :meeting, meeting: meeting) %>
36
+ <%= link_to t(".edit_meeting"), edit_meeting_path(meeting), class: "button secondary hollow expanded button-sc button--icon follow-button" %>
37
+ <% end %>
38
+
33
39
  <div class="card extra">
34
40
  <div class="card__content">
35
41
  <div class="extra__date">
@@ -98,8 +104,9 @@ edit_link(
98
104
  <% end %>
99
105
 
100
106
  <%= resource_reference(meeting) %>
107
+ <%= resource_version(meeting, versions_path: meeting_versions_path(meeting)) %>
101
108
  <%= render partial: "decidim/shared/share_modal" %>
102
- <%= embed_modal_for meeting_meeting_widget_url(meeting, format: :js) %>
109
+ <%= embed_modal_for meeting_widget_url(meeting, format: :js) %>
103
110
  </div>
104
111
  <div class="columns mediumlarge-8 mediumlarge-pull-4">
105
112
  <div class="section">
@@ -155,3 +162,11 @@ edit_link(
155
162
  <%= attachments_for meeting %>
156
163
  <%= comments_for meeting %>
157
164
  <%= pad_iframe_for meeting %>
165
+
166
+ <%=
167
+ render partial: "decidim/shared/flag_modal", locals: {
168
+ reportable: meeting,
169
+ form: @report_form,
170
+ url: decidim.report_path(sgid: meeting.to_sgid.to_s)
171
+ }
172
+ %>