decidim-meetings 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/forms/decidim/meetings/admin/meeting_form.rb +6 -0
- data/app/helpers/decidim/meetings/meetings_helper.rb +2 -1
- data/app/services/decidim/meetings/meeting_search.rb +2 -2
- data/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +2 -2
- data/app/views/decidim/meetings/admin/meetings/index.html.erb +1 -1
- data/app/views/decidim/meetings/meetings/_tags.html.erb +2 -2
- data/lib/decidim/meetings/feature.rb +35 -39
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30ea072be2a343bf0bb84667728294c6dc3ded5a
|
4
|
+
data.tar.gz: 510360ace6994dd82f35d8f07ee1f4e2a3dc39b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d78cca584964606032e1b31cba81b0b5891ba48cbd6144df435bbc3b63b465a9077b8fdc7a9131d75463a95e0b76afcd0560011727cfc6547eb809ee43f9621
|
7
|
+
data.tar.gz: f616788bd5122d7672919ff032ea17c47eed4b7be6dee6be3bc8ac820156080482fef6d40425e02b00c14bf082bedcacdfc16374bd1f419bf58bce82cb2b0cd6
|
@@ -31,6 +31,12 @@ module Decidim
|
|
31
31
|
validates :scope, presence: true, if: ->(form) { form.decidim_scope_id.present? }
|
32
32
|
validates :category, presence: true, if: ->(form) { form.decidim_category_id.present? }
|
33
33
|
|
34
|
+
def map_model(model)
|
35
|
+
return unless model.categorization
|
36
|
+
|
37
|
+
self.decidim_category_id = model.categorization.decidim_category_id
|
38
|
+
end
|
39
|
+
|
34
40
|
def process_scope
|
35
41
|
current_feature.participatory_process.scope
|
36
42
|
end
|
@@ -6,6 +6,7 @@ module Decidim
|
|
6
6
|
module MeetingsHelper
|
7
7
|
include Decidim::ApplicationHelper
|
8
8
|
include Decidim::TranslationsHelper
|
9
|
+
include Decidim::ResourceHelper
|
9
10
|
|
10
11
|
# Public: truncates the meeting description
|
11
12
|
#
|
@@ -14,7 +15,7 @@ module Decidim
|
|
14
15
|
#
|
15
16
|
# Returns the meeting's description truncated.
|
16
17
|
def meeting_description(meeting, max_length = 120)
|
17
|
-
link =
|
18
|
+
link = resource_locator(meeting).path
|
18
19
|
description = translated_attribute(meeting.description)
|
19
20
|
tail = "... #{link_to(t("read_more", scope: "decidim.meetings"), link)}".html_safe
|
20
21
|
CGI.unescapeHTML html_truncate(description, max_length: max_length, tail: tail)
|
@@ -24,9 +24,9 @@ module Decidim
|
|
24
24
|
# Handle the date filter
|
25
25
|
def search_date
|
26
26
|
if options[:date] == "upcoming"
|
27
|
-
query.where("start_time >= ? ", Time.current).order(
|
27
|
+
query.where("start_time >= ? ", Time.current).order(start_time: :asc)
|
28
28
|
elsif options[:date] == "past"
|
29
|
-
query.where("start_time <= ? ", Time.current).order(
|
29
|
+
query.where("start_time <= ? ", Time.current).order(start_time: :desc)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -24,11 +24,11 @@
|
|
24
24
|
<div class="row column">
|
25
25
|
<% if @form.proposals %>
|
26
26
|
<%= form.select :proposal_ids,
|
27
|
-
@form.proposals.order(
|
27
|
+
@form.proposals.order(title: :asc).pluck(:title, :id),
|
28
28
|
{ include_blank: true },
|
29
29
|
{ multiple: true, class: "chosen-select" }
|
30
30
|
%>
|
31
31
|
<% end %>
|
32
32
|
</div>
|
33
33
|
</div>
|
34
|
-
</div>
|
34
|
+
</div>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</td>
|
47
47
|
<% end %>
|
48
48
|
<td class="table-list__actions">
|
49
|
-
<%= icon_link_to "eye",
|
49
|
+
<%= icon_link_to "eye", resource_locator(meeting).path, t("actions.preview", scope: "decidim.meetings"), class: "action-icon--preview", target: :blank %>
|
50
50
|
|
51
51
|
<% if can? :update, current_feature %>
|
52
52
|
<%= icon_link_to "pencil", edit_meeting_path(meeting), t("actions.edit", scope: "decidim.meetings"), class: "action-icon--edit" %>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<% if meeting.category.present? || meeting.scope.present? %>
|
2
2
|
<ul class="tags tags--meeting" >
|
3
3
|
<% if meeting.category.present? %>
|
4
|
-
<li><%= link_to translated_attribute(meeting.category.name),
|
4
|
+
<li><%= link_to translated_attribute(meeting.category.name), resource_locator(meeting).index(filter: { category_id: meeting.category.id }) %></li>
|
5
5
|
<% end %>
|
6
6
|
<% if !current_participatory_process.scope && meeting.scope.present? %>
|
7
|
-
<li><%= link_to meeting.scope.name,
|
7
|
+
<li><%= link_to meeting.scope.name, resource_locator(meeting).index(filter: { scope_id: [meeting.scope.id] }) %></li>
|
8
8
|
<% end %>
|
9
9
|
</ul>
|
10
10
|
<% end %>
|
@@ -23,47 +23,43 @@ Decidim.register_feature(:meetings) do |feature|
|
|
23
23
|
meetings.count
|
24
24
|
end
|
25
25
|
|
26
|
-
feature.seeds do
|
27
|
-
Decidim::
|
28
|
-
|
26
|
+
feature.seeds do |process|
|
27
|
+
feature = Decidim::Feature.create!(
|
28
|
+
name: Decidim::Features::Namer.new(process.organization.available_locales, :meetings).i18n_name,
|
29
|
+
published_at: Time.current,
|
30
|
+
manifest_name: :meetings,
|
31
|
+
participatory_process: process
|
32
|
+
)
|
29
33
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
34
|
+
3.times do
|
35
|
+
meeting = Decidim::Meetings::Meeting.create!(
|
36
|
+
feature: feature,
|
37
|
+
scope: process.organization.scopes.sample,
|
38
|
+
category: process.categories.sample,
|
39
|
+
title: Decidim::Faker::Localized.sentence(2),
|
40
|
+
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
41
|
+
Decidim::Faker::Localized.paragraph(3)
|
42
|
+
end,
|
43
|
+
location: Decidim::Faker::Localized.sentence,
|
44
|
+
location_hints: Decidim::Faker::Localized.sentence,
|
45
|
+
start_time: 3.weeks.from_now,
|
46
|
+
end_time: 3.weeks.from_now + 4.hours,
|
47
|
+
address: "#{Faker::Address.street_address} #{Faker::Address.zip} #{Faker::Address.city}",
|
48
|
+
latitude: Faker::Address.latitude,
|
49
|
+
longitude: Faker::Address.longitude
|
50
|
+
)
|
51
|
+
Decidim::Attachment.create!(
|
52
|
+
title: Decidim::Faker::Localized.sentence(2),
|
53
|
+
description: Decidim::Faker::Localized.sentence(5),
|
54
|
+
file: File.new(File.join(__dir__, "seeds", "city.jpeg")),
|
55
|
+
attached_to: meeting
|
56
|
+
)
|
57
|
+
Decidim::Attachment.create!(
|
58
|
+
title: Decidim::Faker::Localized.sentence(2),
|
59
|
+
description: Decidim::Faker::Localized.sentence(5),
|
60
|
+
file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")),
|
61
|
+
attached_to: meeting
|
35
62
|
)
|
36
|
-
|
37
|
-
3.times do
|
38
|
-
meeting = Decidim::Meetings::Meeting.create!(
|
39
|
-
feature: feature,
|
40
|
-
scope: process.organization.scopes.sample,
|
41
|
-
category: process.categories.sample,
|
42
|
-
title: Decidim::Faker::Localized.sentence(2),
|
43
|
-
description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
|
44
|
-
Decidim::Faker::Localized.paragraph(3)
|
45
|
-
end,
|
46
|
-
location: Decidim::Faker::Localized.sentence,
|
47
|
-
location_hints: Decidim::Faker::Localized.sentence,
|
48
|
-
start_time: 3.weeks.from_now,
|
49
|
-
end_time: 3.weeks.from_now + 4.hours,
|
50
|
-
address: "#{Faker::Address.street_address} #{Faker::Address.zip} #{Faker::Address.city}",
|
51
|
-
latitude: Faker::Address.latitude,
|
52
|
-
longitude: Faker::Address.longitude
|
53
|
-
)
|
54
|
-
Decidim::Attachment.create!(
|
55
|
-
title: Decidim::Faker::Localized.sentence(2),
|
56
|
-
description: Decidim::Faker::Localized.sentence(5),
|
57
|
-
file: File.new(File.join(__dir__, "seeds", "city.jpeg")),
|
58
|
-
attached_to: meeting
|
59
|
-
)
|
60
|
-
Decidim::Attachment.create!(
|
61
|
-
title: Decidim::Faker::Localized.sentence(2),
|
62
|
-
description: Decidim::Faker::Localized.sentence(5),
|
63
|
-
file: File.new(File.join(__dir__, "seeds", "Exampledocument.pdf")),
|
64
|
-
attached_to: meeting
|
65
|
-
)
|
66
|
-
end
|
67
63
|
end
|
68
64
|
end
|
69
65
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-meetings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.4.
|
21
|
+
version: 0.4.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.4.
|
28
|
+
version: 0.4.4
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rectify
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,56 +116,56 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - '='
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.4.
|
119
|
+
version: 0.4.4
|
120
120
|
type: :development
|
121
121
|
prerelease: false
|
122
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
123
|
requirements:
|
124
124
|
- - '='
|
125
125
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.4.
|
126
|
+
version: 0.4.4
|
127
127
|
- !ruby/object:Gem::Dependency
|
128
|
-
name: decidim-
|
128
|
+
name: decidim-admin
|
129
129
|
requirement: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
131
|
- - '='
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.4.
|
133
|
+
version: 0.4.4
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
137
|
requirements:
|
138
138
|
- - '='
|
139
139
|
- !ruby/object:Gem::Version
|
140
|
-
version: 0.4.
|
140
|
+
version: 0.4.4
|
141
141
|
- !ruby/object:Gem::Dependency
|
142
|
-
name: decidim-
|
142
|
+
name: decidim-proposals
|
143
143
|
requirement: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - '='
|
146
146
|
- !ruby/object:Gem::Version
|
147
|
-
version: 0.4.
|
147
|
+
version: 0.4.4
|
148
148
|
type: :development
|
149
149
|
prerelease: false
|
150
150
|
version_requirements: !ruby/object:Gem::Requirement
|
151
151
|
requirements:
|
152
152
|
- - '='
|
153
153
|
- !ruby/object:Gem::Version
|
154
|
-
version: 0.4.
|
154
|
+
version: 0.4.4
|
155
155
|
- !ruby/object:Gem::Dependency
|
156
156
|
name: decidim-results
|
157
157
|
requirement: !ruby/object:Gem::Requirement
|
158
158
|
requirements:
|
159
159
|
- - '='
|
160
160
|
- !ruby/object:Gem::Version
|
161
|
-
version: 0.4.
|
161
|
+
version: 0.4.4
|
162
162
|
type: :development
|
163
163
|
prerelease: false
|
164
164
|
version_requirements: !ruby/object:Gem::Requirement
|
165
165
|
requirements:
|
166
166
|
- - '='
|
167
167
|
- !ruby/object:Gem::Version
|
168
|
-
version: 0.4.
|
168
|
+
version: 0.4.4
|
169
169
|
description: A meetings component for decidim's participatory processes.
|
170
170
|
email:
|
171
171
|
- josepjaume@gmail.com
|