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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a5afd4c00927d61b89f5ac7ecb1b275c779a06c
4
- data.tar.gz: f0ddf2eb804d82e0b8c60f851b674b7d6b247749
3
+ metadata.gz: 30ea072be2a343bf0bb84667728294c6dc3ded5a
4
+ data.tar.gz: 510360ace6994dd82f35d8f07ee1f4e2a3dc39b0
5
5
  SHA512:
6
- metadata.gz: d2a9982af80b38b4bb8ab066e69c9dadd881b60ae4e001171ade331eaad12bcc05269b1319b95eddd7631d836fea1af6312b2040e523a7d7d3a114b5d26a1e99
7
- data.tar.gz: 01f9e7122b86284eeeba8c337d071e3c5538754cb2370616f2e5c8bedc97f559eb468efbca621b19e326509dab54285a27f49b58dbfba559f1c67cd56099265c
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 = decidim_meetings.meeting_path(meeting, feature_id: meeting.feature, participatory_process_id: meeting.feature.participatory_process)
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("start_time ASC")
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("start_time DESC")
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("title ASC").pluck(:title, :id),
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", decidim_meetings.meeting_path(id: meeting, feature_id: current_feature, participatory_process_id: current_participatory_process), t("actions.preview", scope: "decidim.meetings"), class: "action-icon--preview", target: :blank %>
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), decidim_meetings.meetings_path(filter: { category_id: meeting.category.id }) %></li>
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, decidim_meetings.meetings_path(filter: { scope_id: [meeting.scope.id] }) %></li>
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::ParticipatoryProcess.find_each do |process|
28
- next unless process.steps.any?
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
- feature = Decidim::Feature.create!(
31
- name: Decidim::Features::Namer.new(process.organization.available_locales, :meetings).i18n_name,
32
- published_at: Time.current,
33
- manifest_name: :meetings,
34
- participatory_process: process
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.3
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.3
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.3
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.3
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.3
126
+ version: 0.4.4
127
127
  - !ruby/object:Gem::Dependency
128
- name: decidim-proposals
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.3
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.3
140
+ version: 0.4.4
141
141
  - !ruby/object:Gem::Dependency
142
- name: decidim-admin
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.3
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.3
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.3
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.3
168
+ version: 0.4.4
169
169
  description: A meetings component for decidim's participatory processes.
170
170
  email:
171
171
  - josepjaume@gmail.com