decidim-meetings 0.21.0 → 0.23.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/config/decidim_meetings_manifest.js +2 -0
- data/app/assets/images/decidim/gamification/badges/attended_meetings.svg +1 -106
- data/app/assets/images/decidim/meetings/icon.svg +1 -5
- data/app/assets/javascripts/decidim/meetings/admin/destroy_meeting_alert.js.es6 +16 -0
- data/app/assets/javascripts/decidim/meetings/admin/meetings_form.js.es6 +3 -0
- data/app/assets/javascripts/decidim/meetings/meetings_form.js.es6 +9 -0
- data/app/cells/decidim/meetings/content_blocks/upcoming_events_cell.rb +2 -1
- data/app/cells/decidim/meetings/highlighted_meetings_for_component/show.erb +7 -7
- data/app/cells/decidim/meetings/highlighted_meetings_for_component_cell.rb +1 -1
- data/app/cells/decidim/meetings/join_meeting_button/show.erb +2 -2
- data/app/cells/decidim/meetings/meeting_cell.rb +1 -0
- data/app/cells/decidim/meetings/meeting_list_item/show.erb +3 -3
- data/app/cells/decidim/meetings/meeting_list_item_cell.rb +1 -1
- data/app/cells/decidim/meetings/meeting_m/date.erb +1 -1
- data/app/cells/decidim/meetings/meeting_m/footer.erb +1 -1
- data/app/cells/decidim/meetings/meeting_m/multiple_dates.erb +1 -1
- data/app/cells/decidim/meetings/meeting_m_cell.rb +9 -1
- data/app/cells/decidim/meetings/meeting_s/show.erb +6 -6
- data/app/cells/decidim/meetings/meetings_map/show.erb +0 -2
- data/app/cells/decidim/meetings/meetings_map_cell.rb +3 -1
- data/app/commands/decidim/meetings/admin/close_meeting.rb +1 -2
- data/app/commands/decidim/meetings/admin/copy_meeting.rb +38 -28
- data/app/commands/decidim/meetings/admin/create_meeting.rb +36 -24
- data/app/commands/decidim/meetings/admin/destroy_meeting.rb +6 -1
- data/app/commands/decidim/meetings/admin/invite_user_to_join_meeting.rb +2 -1
- data/app/commands/decidim/meetings/admin/update_meeting.rb +9 -3
- data/app/commands/decidim/meetings/create_meeting.rb +78 -0
- data/app/commands/decidim/meetings/update_meeting.rb +94 -0
- data/app/controllers/decidim/meetings/admin/application_controller.rb +1 -1
- data/app/controllers/decidim/meetings/admin/meeting_closes_controller.rb +2 -0
- data/app/controllers/decidim/meetings/admin/meetings_controller.rb +21 -7
- data/app/controllers/decidim/meetings/admin/registration_form_controller.rb +4 -0
- data/app/controllers/decidim/meetings/meetings_controller.rb +76 -13
- data/app/controllers/decidim/meetings/registrations_controller.rb +1 -1
- data/app/controllers/decidim/meetings/versions_controller.rb +14 -0
- data/app/controllers/decidim/meetings/{meeting_widgets_controller.rb → widgets_controller.rb} +2 -2
- data/app/forms/decidim/meetings/admin/close_meeting_form.rb +7 -1
- data/app/forms/decidim/meetings/admin/meeting_copy_form.rb +2 -8
- data/app/forms/decidim/meetings/admin/meeting_form.rb +24 -23
- data/app/forms/decidim/meetings/meeting_form.rb +78 -0
- data/app/helpers/decidim/meetings/admin/application_helper.rb +1 -6
- data/app/helpers/decidim/meetings/application_helper.rb +26 -0
- data/app/helpers/decidim/meetings/map_helper.rb +2 -1
- data/app/helpers/decidim/meetings/meetings_helper.rb +13 -1
- data/app/models/decidim/meetings/agenda.rb +3 -0
- data/app/models/decidim/meetings/agenda_item.rb +3 -0
- data/app/models/decidim/meetings/meeting.rb +79 -23
- data/app/models/decidim/meetings/minutes.rb +3 -0
- data/app/models/decidim/meetings/service.rb +13 -0
- data/app/permissions/decidim/meetings/admin/permissions.rb +2 -0
- data/app/permissions/decidim/meetings/permissions.rb +20 -0
- data/app/presenters/decidim/meetings/admin_log/invite_presenter.rb +5 -1
- data/app/presenters/decidim/meetings/admin_log/meeting_presenter.rb +3 -4
- data/app/presenters/decidim/meetings/meeting_presenter.rb +21 -6
- data/app/presenters/decidim/meetings/official_author_presenter.rb +14 -0
- data/app/queries/decidim/meetings/filtered_meetings.rb +1 -1
- data/app/queries/decidim/meetings/metrics/meetings_metric_manage.rb +2 -8
- data/app/services/decidim/meetings/calendar/meeting_to_event.rb +1 -1
- data/app/services/decidim/meetings/diff_renderer.rb +21 -0
- data/app/services/decidim/meetings/meeting_search.rb +3 -25
- data/app/types/decidim/meetings/meeting_type.rb +1 -1
- data/app/views/decidim/meetings/_calendar_modal.html.erb +4 -4
- data/app/views/decidim/meetings/admin/invites/index.html.erb +2 -2
- data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +1 -6
- data/app/views/decidim/meetings/admin/meeting_closes/proposals_picker.html.erb +1 -0
- data/app/views/decidim/meetings/admin/meeting_copies/_form.html.erb +2 -9
- data/app/views/decidim/meetings/admin/meetings/_form.html.erb +5 -12
- data/app/views/decidim/meetings/admin/meetings/edit.html.erb +1 -1
- data/app/views/decidim/meetings/admin/meetings/index.html.erb +22 -3
- data/app/views/decidim/meetings/admin/registrations/_form.html.erb +4 -0
- data/app/views/decidim/meetings/directory/meetings/index.html.erb +5 -3
- data/app/views/decidim/meetings/directory/meetings/index.js.erb +11 -4
- data/app/views/decidim/meetings/meetings/_count.html.erb +1 -0
- data/app/views/decidim/meetings/meetings/_filters.html.erb +13 -7
- data/app/views/decidim/meetings/meetings/_form.html.erb +51 -0
- data/app/views/decidim/meetings/meetings/_linked_meetings.html.erb +2 -2
- data/app/views/decidim/meetings/meetings/_meeting_agenda.html.erb +2 -2
- data/app/views/decidim/meetings/meetings/_meeting_minutes.html.erb +8 -8
- data/app/views/decidim/meetings/meetings/edit.html.erb +25 -0
- data/app/views/decidim/meetings/meetings/index.html.erb +16 -1
- data/app/views/decidim/meetings/meetings/index.js.erb +13 -4
- data/app/views/decidim/meetings/meetings/new.html.erb +25 -0
- data/app/views/decidim/meetings/meetings/show.html.erb +32 -8
- data/app/views/decidim/meetings/versions/index.html.erb +8 -0
- data/app/views/decidim/meetings/versions/show.html.erb +10 -0
- data/app/views/decidim/participatory_processes/participatory_process_groups/_meeting.html.erb +2 -2
- data/app/views/decidim/participatory_spaces/_conference_venues.html.erb +1 -1
- data/app/views/decidim/participatory_spaces/_upcoming_meeting_for_card.html.erb +1 -3
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/ar.yml +0 -8
- data/config/locales/bg-BG.yml +21 -0
- data/config/locales/bg.yml +21 -0
- data/config/locales/ca.yml +60 -7
- data/config/locales/cs.yml +68 -9
- data/config/locales/da-DK.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +128 -71
- data/config/locales/el.yml +448 -0
- data/config/locales/en.yml +61 -8
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +60 -7
- data/config/locales/es-PY.yml +61 -8
- data/config/locales/es.yml +61 -8
- data/config/locales/et-EE.yml +1 -0
- data/config/locales/et.yml +1 -0
- data/config/locales/eu.yml +0 -8
- data/config/locales/fi-plain.yml +60 -7
- data/config/locales/fi.yml +183 -130
- data/config/locales/fr-CA.yml +504 -0
- data/config/locales/fr.yml +60 -7
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +3 -7
- data/config/locales/hr-HR.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +11 -7
- data/config/locales/id-ID.yml +0 -8
- data/config/locales/is-IS.yml +0 -9
- data/config/locales/is.yml +228 -0
- data/config/locales/it.yml +58 -7
- data/config/locales/ja-JP.yml +494 -0
- data/config/locales/ja.yml +496 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt-LT.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +452 -0
- data/config/locales/mt-MT.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +52 -7
- data/config/locales/no.yml +35 -9
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +210 -147
- data/config/locales/pt-BR.yml +2 -10
- data/config/locales/pt.yml +232 -177
- data/config/locales/ro-RO.yml +500 -0
- data/config/locales/ru.yml +0 -8
- data/config/locales/si-LK.yml +1 -0
- data/config/locales/sk-SK.yml +463 -0
- data/config/locales/sk.yml +458 -0
- data/config/locales/sl.yml +33 -0
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sr-CS.yml +13 -0
- data/config/locales/sv.yml +67 -13
- data/config/locales/sw-KE.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/tr-TR.yml +154 -98
- data/config/locales/uk.yml +0 -9
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +496 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200320105922_index_foreign_keys_in_decidim_meetings_registrations.rb +7 -0
- data/db/migrate/20200526110940_add_author_to_meetings.rb +30 -0
- data/db/migrate/20200702123209_create_meeting_services_table.rb +13 -0
- data/db/migrate/20200702123210_move_meeting_services_to_own_model.rb +31 -0
- data/db/migrate/20200827153856_add_commentable_counter_cache_to_meetings.rb +9 -0
- data/db/migrate/20201016065302_fix_meetings_registration_terms.rb +29 -0
- data/db/migrate/20201111133246_add_salt_to_decidim_meetings.rb +8 -0
- data/lib/decidim/api/services_interface.rb +1 -7
- data/lib/decidim/meetings/admin_engine.rb +5 -1
- data/lib/decidim/meetings/component.rb +63 -11
- data/lib/decidim/meetings/engine.rb +3 -6
- data/lib/decidim/meetings/meeting_serializer.rb +1 -1
- data/lib/decidim/meetings/seeds/city.jpeg +0 -0
- data/lib/decidim/meetings/test/factories.rb +46 -8
- data/lib/decidim/meetings/version.rb +1 -1
- data/lib/tasks/decidim_meetings.rake +16 -0
- metadata +88 -23
- data/app/presenters/decidim/meetings/admin_log/value_types/organizer_presenter.rb +0 -70
@@ -6,6 +6,9 @@ module Decidim
|
|
6
6
|
class Minutes < Meetings::ApplicationRecord
|
7
7
|
include Decidim::Traceable
|
8
8
|
include Decidim::Loggable
|
9
|
+
include Decidim::TranslatableResource
|
10
|
+
|
11
|
+
translatable_fields :description
|
9
12
|
|
10
13
|
belongs_to :meeting, foreign_key: "decidim_meeting_id", class_name: "Decidim::Meetings::Meeting"
|
11
14
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Meetings
|
5
|
+
class Service < Meetings::ApplicationRecord
|
6
|
+
include Decidim::Traceable
|
7
|
+
include Decidim::TranslatableResource
|
8
|
+
|
9
|
+
translatable_fields :title, :description
|
10
|
+
belongs_to :meeting, foreign_key: "decidim_meeting_id", class_name: "Decidim::Meetings::Meeting"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -37,6 +37,8 @@ module Decidim
|
|
37
37
|
def allowed_meeting_action?
|
38
38
|
return unless permission_action.subject == :meeting
|
39
39
|
|
40
|
+
return disallow! if meeting && !meeting.official?
|
41
|
+
|
40
42
|
case permission_action.action
|
41
43
|
when :close, :copy, :destroy, :export_registrations, :update, :read_invites
|
42
44
|
toggle_allow(meeting.present?)
|
@@ -19,6 +19,12 @@ module Decidim
|
|
19
19
|
toggle_allow(can_leave_meeting?)
|
20
20
|
when :decline_invitation
|
21
21
|
toggle_allow(can_decline_invitation?)
|
22
|
+
when :create
|
23
|
+
toggle_allow(can_create_meetings?)
|
24
|
+
when :update
|
25
|
+
toggle_allow(can_update_meeting?)
|
26
|
+
when :register
|
27
|
+
toggle_allow(can_register_invitation_meeting?)
|
22
28
|
end
|
23
29
|
|
24
30
|
permission_action
|
@@ -43,6 +49,20 @@ module Decidim
|
|
43
49
|
meeting.registrations_enabled? &&
|
44
50
|
meeting.invites.where(user: user).exists?
|
45
51
|
end
|
52
|
+
|
53
|
+
def can_create_meetings?
|
54
|
+
component_settings&.creation_enabled_for_participants?
|
55
|
+
end
|
56
|
+
|
57
|
+
def can_update_meeting?
|
58
|
+
component_settings&.creation_enabled_for_participants? &&
|
59
|
+
meeting.authored_by?(user)
|
60
|
+
end
|
61
|
+
|
62
|
+
def can_register_invitation_meeting?
|
63
|
+
meeting.can_register_invitation?(user) &&
|
64
|
+
authorized?(:register, resource: meeting)
|
65
|
+
end
|
46
66
|
end
|
47
67
|
end
|
48
68
|
end
|
@@ -24,9 +24,13 @@ module Decidim
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
# Tries to use the attendee name from the invitation (resource).
|
28
|
+
# If invitation does not exist anymore use the one in extras.
|
27
29
|
def i18n_params
|
30
|
+
attendee_name = action_log.resource ? action_log.resource.user.name : action_log.extra["attendee_name"]
|
28
31
|
super.merge(
|
29
|
-
|
32
|
+
# before Decidim v0.23.0 attendee_name was not being copied into the extras so it may be nil
|
33
|
+
attendee_name: attendee_name || "????"
|
30
34
|
)
|
31
35
|
end
|
32
36
|
end
|
@@ -33,8 +33,7 @@ module Decidim
|
|
33
33
|
start_date: :date,
|
34
34
|
title: "Decidim::Meetings::AdminLog::ValueTypes::MeetingTitleDescriptionPresenter",
|
35
35
|
private_meeting: :boolean,
|
36
|
-
transparent: :boolean
|
37
|
-
organizer_id: "Decidim::Meetings::AdminLog::ValueTypes::OrganizerPresenter"
|
36
|
+
transparent: :boolean
|
38
37
|
}
|
39
38
|
end
|
40
39
|
|
@@ -51,8 +50,8 @@ module Decidim
|
|
51
50
|
"activemodel.attributes.meeting"
|
52
51
|
end
|
53
52
|
|
54
|
-
def
|
55
|
-
|
53
|
+
def diff_actions
|
54
|
+
super + %w(close)
|
56
55
|
end
|
57
56
|
end
|
58
57
|
end
|
@@ -18,8 +18,7 @@ module Decidim
|
|
18
18
|
return unless meeting
|
19
19
|
|
20
20
|
handle_locales(meeting.title, all_locales) do |content|
|
21
|
-
|
22
|
-
renderer = Decidim::ContentRenderers::HashtagRenderer.new(content)
|
21
|
+
renderer = Decidim::ContentRenderers::HashtagRenderer.new(decidim_html_escape(content))
|
23
22
|
renderer.render(links: links).html_safe
|
24
23
|
end
|
25
24
|
end
|
@@ -28,7 +27,7 @@ module Decidim
|
|
28
27
|
return unless meeting
|
29
28
|
|
30
29
|
handle_locales(meeting.description, all_locales) do |content|
|
31
|
-
renderer = Decidim::ContentRenderers::HashtagRenderer.new(content)
|
30
|
+
renderer = Decidim::ContentRenderers::HashtagRenderer.new(decidim_sanitize(content))
|
32
31
|
renderer.render(links: links).html_safe
|
33
32
|
end
|
34
33
|
end
|
@@ -66,12 +65,28 @@ module Decidim
|
|
66
65
|
false
|
67
66
|
end
|
68
67
|
|
68
|
+
def proposals
|
69
|
+
return unless meeting
|
70
|
+
|
71
|
+
@proposals ||= meeting.authored_proposals.load
|
72
|
+
end
|
73
|
+
|
74
|
+
def formatted_proposals_titles
|
75
|
+
return unless meeting
|
76
|
+
|
77
|
+
proposals.map.with_index { |proposal, index| "#{index + 1}) #{proposal.title}\n" }
|
78
|
+
end
|
79
|
+
|
69
80
|
private
|
70
81
|
|
71
|
-
def handle_locales(content, all_locales)
|
82
|
+
def handle_locales(content, all_locales, &block)
|
72
83
|
if all_locales
|
73
|
-
content.each_with_object({}) do |(
|
74
|
-
parsed_content[
|
84
|
+
content.each_with_object({}) do |(key, value), parsed_content|
|
85
|
+
parsed_content[key] = if key == "machine_translations"
|
86
|
+
handle_locales(value, all_locales, &block)
|
87
|
+
else
|
88
|
+
block.call(value)
|
89
|
+
end
|
75
90
|
end
|
76
91
|
else
|
77
92
|
yield(translated_attribute(content))
|
@@ -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
|
@@ -9,9 +9,6 @@ module Decidim
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def save
|
12
|
-
return @registry if @registry
|
13
|
-
|
14
|
-
@registry = []
|
15
12
|
cumulative.each do |key, cumulative_value|
|
16
13
|
next if cumulative_value.zero?
|
17
14
|
|
@@ -21,10 +18,8 @@ module Decidim
|
|
21
18
|
organization: @organization, decidim_category_id: category_id,
|
22
19
|
participatory_space_type: space_type, participatory_space_id: space_id)
|
23
20
|
record.assign_attributes(cumulative: cumulative_value, quantity: quantity_value)
|
24
|
-
|
21
|
+
record.save!
|
25
22
|
end
|
26
|
-
@registry.each(&:save!)
|
27
|
-
@registry
|
28
23
|
end
|
29
24
|
|
30
25
|
private
|
@@ -35,8 +30,7 @@ module Decidim
|
|
35
30
|
spaces = Decidim.participatory_space_manifests.flat_map do |manifest|
|
36
31
|
manifest.participatory_spaces.call(@organization).public_spaces
|
37
32
|
end
|
38
|
-
|
39
|
-
@query = Decidim::Meetings::Meeting.where(component: components).joins(:component)
|
33
|
+
@query = Decidim::Meetings::Meeting.where(component: visible_component_ids_from_spaces(spaces)).joins(:component)
|
40
34
|
.left_outer_joins(:category).visible
|
41
35
|
@query = @query.where("decidim_meetings_meetings.created_at <= ?", end_time)
|
42
36
|
@query = @query.group("decidim_categorizations.decidim_category_id",
|
@@ -39,7 +39,7 @@ module Decidim
|
|
39
39
|
@event.dtstart = Icalendar::Values::DateTime.new(meeting.start_time.utc, "tzid" => "UTC")
|
40
40
|
@event.dtend = Icalendar::Values::DateTime.new(meeting.end_time.utc, "tzid" => "UTC")
|
41
41
|
@event.summary = present(meeting).title
|
42
|
-
@event.description = strip_tags(present(meeting).description)
|
42
|
+
@event.description = strip_tags(CGI.unescapeHTML(present(meeting).description))
|
43
43
|
@event.location = meeting.address
|
44
44
|
@event.geo = [meeting.latitude, meeting.longitude]
|
45
45
|
@event.url = url_for(meeting)
|
@@ -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
|
-
|
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 :
|
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?
|
@@ -1,13 +1,13 @@
|
|
1
|
-
<button class="button button--title
|
1
|
+
<button class="button button--title share-link text-center calendar" data-open="calendarShare">
|
2
2
|
<%= t(".export_calendar") %>
|
3
|
-
<%= icon "share", class: "icon--after" %>
|
3
|
+
<%= icon "share", class: "icon--after", role: "img", "aria-hidden": true %>
|
4
4
|
</button>
|
5
5
|
<div class="reveal" id="calendarShare" data-reveal>
|
6
6
|
<div class="reveal__header">
|
7
|
-
<
|
7
|
+
<h2 class="reveal__title"><%= t(".calendar_url") %>:</h2>
|
8
8
|
<button class="close-button" data-close aria-label="<%= t(".close_window") %>" type="button">
|
9
9
|
<span aria-hidden="true">×</span>
|
10
10
|
</button>
|
11
11
|
</div>
|
12
|
-
<input type="text" value="<%= "#{path}" %>" readonly>
|
12
|
+
<input type="text" value="<%= "#{path}" %>" readonly title="<%= t(".calendar_url") %>">
|
13
13
|
</div>
|
@@ -45,8 +45,8 @@
|
|
45
45
|
<%= search_field_tag :q, @query,label: false, class: "input-group-field", placeholder: t(".search") %>
|
46
46
|
<%= hidden_field_tag :state, @state %>
|
47
47
|
<div class="input-group-button">
|
48
|
-
<button type="submit" class="button
|
49
|
-
<%= icon "magnifying-glass", aria_label: t(".search") %>
|
48
|
+
<button type="submit" class="button">
|
49
|
+
<%= icon "magnifying-glass", aria_label: t(".search"), role: "img" %>
|
50
50
|
</button>
|
51
51
|
</div>
|
52
52
|
</div>
|
@@ -22,12 +22,7 @@
|
|
22
22
|
</div>
|
23
23
|
</div>
|
24
24
|
<div class="row column">
|
25
|
-
|
26
|
-
<%= form.select :proposal_ids,
|
27
|
-
@form.proposals.order(title: :asc).map{|proposal| [decidim_html_escape(present(proposal).title), proposal.id]},
|
28
|
-
{ include_blank: true },
|
29
|
-
{ multiple: true, class: "chosen-select" } %>
|
30
|
-
<% end %>
|
25
|
+
<%= proposals_picker(form, :proposals, proposals_picker_meeting_meeting_closes_path(meeting)) %>
|
31
26
|
</div>
|
32
27
|
</div>
|
33
28
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= cell "decidim/proposals/proposals_picker", current_component %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
</div>
|
5
5
|
|
6
6
|
<div class="card-section">
|
7
|
-
<div class="row column
|
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.
|
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
|
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.
|
15
|
+
<%= form.geocoding_field :address %>
|
16
16
|
<p class="help-text"><%= t(".address_help") %></p>
|
17
17
|
</div>
|
18
18
|
|
@@ -36,24 +36,17 @@
|
|
36
36
|
</div>
|
37
37
|
</div>
|
38
38
|
<div class="row">
|
39
|
-
<% if
|
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
|
|
45
45
|
<div class="columns xlarge-6">
|
46
|
-
<%= form.categories_select :decidim_category_id, current_participatory_space.categories,
|
46
|
+
<%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: "", disable_parents: false %>
|
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">
|