decidim-challenges 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/commands/decidim/challenges/survey_challenge.rb +1 -1
- data/app/forms/decidim/solutions/solutions_form.rb +1 -1
- data/app/models/decidim/challenges/challenge.rb +1 -1
- data/app/models/decidim/problems/problem.rb +1 -1
- data/app/serializers/decidim/solutions/solution_serializer.rb +10 -2
- data/app/views/decidim/challenges/admin/challenges/edit.html.erb +1 -1
- data/app/views/decidim/problems/admin/problems/edit.html.erb +1 -1
- data/app/views/decidim/problems/problems/_sidebar_data.html.erb +2 -2
- data/app/views/decidim/problems/problems/show.html.erb +0 -1
- data/app/views/decidim/sdgs/sdgs/index.html.erb +2 -2
- data/app/views/decidim/sdgs/sdgs_filter/_modal.html.erb +1 -4
- data/app/views/decidim/solutions/admin/solutions/_form.html.erb +1 -1
- data/app/views/decidim/solutions/admin/solutions/edit.html.erb +1 -1
- data/app/views/decidim/solutions/admin/solutions/show.html.erb +1 -2
- data/app/views/decidim/solutions/solutions/_sidebar_data.html.erb +2 -2
- data/app/views/decidim/solutions/solutions/show.html.erb +1 -1
- data/lib/decidim/challenges/version.rb +2 -2
- metadata +6 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46bea652eb21f13814310b3f2010678bf606a89eb0b6f643d52b7618ada9b22f
|
4
|
+
data.tar.gz: 0b54f8699e24dbdb5960300a36fad5d42e0c5a52dfa67d4302a4fc2395a58623
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5aeda521250172c335e590e38a3375ce529c2553db76348dd291829fd42ef8cd6dd5d5d19a67a7b15c20906c6e50315e652a9ab12e4b5e86ab45df30abb21a7
|
7
|
+
data.tar.gz: 62661ef946f28d42006ebb6d1a29f296955bbed4672aaf07295bf0b92e9b0dd6ebd1200e9dc26721eb27cae04819f0a5a1055b2dcace77ff0be28877f4dd7b56
|
@@ -41,7 +41,7 @@ module Decidim
|
|
41
41
|
def answer_questionnaire
|
42
42
|
return unless questionnaire?
|
43
43
|
|
44
|
-
Decidim::Forms::AnswerQuestionnaire.call(survey_form,
|
44
|
+
Decidim::Forms::AnswerQuestionnaire.call(survey_form, challenge.questionnaire) do
|
45
45
|
on(:invalid) do
|
46
46
|
raise ActiveRecord::Rollback
|
47
47
|
end
|
@@ -32,7 +32,7 @@ module Decidim
|
|
32
32
|
self.description = translated_attribute(model.description)
|
33
33
|
|
34
34
|
self.documents = model.attachments
|
35
|
-
|
35
|
+
nil unless model.categorization
|
36
36
|
end
|
37
37
|
|
38
38
|
# Finds the Challenge from the given decidim_challenges_challenge_id
|
@@ -25,7 +25,7 @@ module Decidim
|
|
25
25
|
has_many :surveys, class_name: "Decidim::Challenges::Survey", foreign_key: "decidim_challenge_id", dependent: :destroy
|
26
26
|
|
27
27
|
VALID_STATES = [:proposal, :execution, :finished].freeze
|
28
|
-
enum state
|
28
|
+
enum :state, VALID_STATES
|
29
29
|
|
30
30
|
has_many :problems,
|
31
31
|
class_name: "Decidim::Problems::Problem",
|
@@ -11,7 +11,7 @@ module Decidim
|
|
11
11
|
|
12
12
|
def serialize
|
13
13
|
{
|
14
|
-
title_label => resource.title
|
14
|
+
title_label => localized(resource.title),
|
15
15
|
description_label => sanitized_description,
|
16
16
|
status_label => resource&.project_status,
|
17
17
|
challenge_label => translated_challenge_title,
|
@@ -23,6 +23,14 @@ module Decidim
|
|
23
23
|
|
24
24
|
private
|
25
25
|
|
26
|
+
def localized(value)
|
27
|
+
if value.is_a?(Hash)
|
28
|
+
value[I18n.locale.to_s] || ""
|
29
|
+
else
|
30
|
+
value.to_s
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
26
34
|
def sanitize(text)
|
27
35
|
ActionController::Base.helpers.strip_tags(text)
|
28
36
|
end
|
@@ -60,7 +68,7 @@ module Decidim
|
|
60
68
|
end
|
61
69
|
|
62
70
|
def sanitized_description
|
63
|
-
sanitize(resource.description
|
71
|
+
sanitize(localized(resource.description))
|
64
72
|
end
|
65
73
|
end
|
66
74
|
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="item__edit-sticky">
|
12
12
|
<div class="item__edit-sticky-container">
|
13
13
|
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
14
|
-
|
14
|
+
|
15
15
|
<% if challenge.published? %>
|
16
16
|
<%= link_to t("actions.unpublish", scope: "decidim.challenges.admin"), challenge_publish_path(challenge), method: :delete, class: "button button__sm button__secondary" %>
|
17
17
|
<% else %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="item__edit-sticky">
|
12
12
|
<div class="item__edit-sticky-container">
|
13
13
|
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
14
|
-
|
14
|
+
|
15
15
|
<% if problem.published? %>
|
16
16
|
<%= link_to t("actions.unpublish", scope: "decidim.problems.admin"), problem_publish_path(problem), method: :delete, class: "button button__sm button__secondary" %>
|
17
17
|
<% else %>
|
@@ -36,14 +36,14 @@
|
|
36
36
|
<% if @problem.decidim_sectorial_scope_id.present? %>
|
37
37
|
<div class="text-sm flex flex-col items-center gap-1">
|
38
38
|
<p class="uppercase text-xs"><%= t("decidim_sectorial_scope_id", scope: "activemodel.attributes.problem") %></p>
|
39
|
-
<p class="uppercase mb-4"><%= translated_attribute current_organization.scopes.find_by(id: @problem.decidim_sectorial_scope_id).name
|
39
|
+
<p class="uppercase mb-4"><%= translated_attribute current_organization.scopes.find_by(id: @problem.decidim_sectorial_scope_id).name %></p>
|
40
40
|
</div>
|
41
41
|
<% end %>
|
42
42
|
|
43
43
|
<% if @problem.decidim_technological_scope_id.present? %>
|
44
44
|
<div class="text-sm flex flex-col items-center gap-1">
|
45
45
|
<p class="uppercase text-xs"><%= t("decidim_sectorial_scope_id", scope: "activemodel.attributes.problem") %></p>
|
46
|
-
<p class="uppercase mb-4"><%= translated_attribute current_organization.scopes.find_by(id: @problem.decidim_technological_scope_id).name
|
46
|
+
<p class="uppercase mb-4"><%= translated_attribute current_organization.scopes.find_by(id: @problem.decidim_technological_scope_id).name %></p>
|
47
47
|
</div>
|
48
48
|
<% end %>
|
49
49
|
</div>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
idx+= 1
|
16
16
|
idx_str= idx.to_s.rjust(2, "0") %>
|
17
17
|
<div class="sdg-cell" data-value="<%= sdg_code %>">
|
18
|
-
<%= image_pack_tag "media/images/ods-#{idx_str}.svg", alt: "Logo SDG #{idx_str}"%>
|
18
|
+
<%= image_pack_tag "media/images/ods-#{idx_str}.svg", alt: "Logo SDG #{idx_str}" %>
|
19
19
|
<div class="text">
|
20
20
|
<p><%= "#{idx_str}. #{t_sdg(sdg_code)}" %></p>
|
21
21
|
</div>
|
@@ -28,8 +28,5 @@
|
|
28
28
|
<a class="button button__sm md:button__lg button__secondary" data-close="" role="button"><%= t(".close") %></a>
|
29
29
|
</div>
|
30
30
|
</div>
|
31
|
-
|
32
31
|
</div>
|
33
32
|
</div>
|
34
|
-
|
35
|
-
|
@@ -56,7 +56,7 @@
|
|
56
56
|
<%= form.hidden_field :decidim_challenges_challenge_id, value: @form.try(:challenge) ? @form.try(:challenge).id : '' %>
|
57
57
|
<% else %>
|
58
58
|
<%= form.hidden_field :decidim_problems_problem_id, value: @form.try(:problem) ? @form.try(:problem).id : '' %>
|
59
|
-
<div class="card-section"
|
59
|
+
<div class="card-section">
|
60
60
|
<div class="row column">
|
61
61
|
<%= form.select :decidim_challenges_challenge_id,
|
62
62
|
@form.select_challenge_collection,
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div class="item__edit-sticky">
|
12
12
|
<div class="item__edit-sticky-container">
|
13
13
|
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
14
|
-
|
14
|
+
|
15
15
|
<% if solution.published? %>
|
16
16
|
<%= link_to t("actions.unpublish", scope: "decidim.solutions.admin"), solution_publish_path(solution), method: :delete, class: "button button__sm button__secondary" %>
|
17
17
|
<% else %>
|
@@ -42,7 +42,7 @@
|
|
42
42
|
<div class="row column">
|
43
43
|
<span class="component__show-description"><%= t ".description" %></span>
|
44
44
|
<p class="component__show-text">
|
45
|
-
<%= decidim_sanitize_editor_admin translated_attribute solution.description
|
45
|
+
<%= decidim_sanitize_editor_admin translated_attribute solution.description %>
|
46
46
|
</p>
|
47
47
|
</div>
|
48
48
|
</div>
|
@@ -111,4 +111,3 @@
|
|
111
111
|
<% end %>
|
112
112
|
</div>
|
113
113
|
</div>
|
114
|
-
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<p class="uppercase mb-4"><%= t(@solution.challenge.state, scope: "decidim.challenges.states") %></p>
|
15
15
|
<% else %>
|
16
16
|
<p class="uppercase mb-4"><%= t(@solution.project_status, scope: "decidim.solutions.solutions.form.project_statuses") %></p>
|
17
|
-
<% end %>
|
17
|
+
<% end %>
|
18
18
|
</div>
|
19
19
|
<% end %>
|
20
20
|
</div>
|
@@ -77,7 +77,7 @@
|
|
77
77
|
</div>
|
78
78
|
<% end %>
|
79
79
|
</div>
|
80
|
-
|
80
|
+
|
81
81
|
<% if has_problem? %>
|
82
82
|
<% if @solution.problem.challenge.sdg_code %>
|
83
83
|
<div class="text-sm flex flex-col items-center gap-1">
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<% if has_problem? %>
|
15
15
|
<h3 class="h4">
|
16
16
|
<span class="title"><%= t("problem", scope: "activemodel.attributes.solution") %></span>:
|
17
|
-
<%= link_to translated_attribute(@solution.problem.title), Decidim::ResourceLocatorPresenter.new(@solution.problem).path %><br
|
17
|
+
<%= link_to translated_attribute(@solution.problem.title), Decidim::ResourceLocatorPresenter.new(@solution.problem).path %><br>
|
18
18
|
<span class="title"><%= t("challenge", scope: "activemodel.attributes.problem") %></span>:
|
19
19
|
<%= link_to translated_attribute(@solution.problem.challenge.title), Decidim::ResourceLocatorPresenter.new(@solution.problem.challenge).path %></strong>
|
20
20
|
</h3>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decidim-challenges
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Valls
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: decidim-core
|
@@ -16,42 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.29'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: decidim
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.27'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0.27'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: decidim-dev
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.27'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0.27'
|
26
|
+
version: '0.29'
|
55
27
|
description: Articulates the collective action of diverse actors in order to address
|
56
28
|
shared challenges and the problems that derive from them across the territory.
|
57
29
|
email:
|
@@ -303,14 +275,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
303
275
|
requirements:
|
304
276
|
- - ">="
|
305
277
|
- !ruby/object:Gem::Version
|
306
|
-
version: 3.
|
278
|
+
version: 3.2.9
|
307
279
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
308
280
|
requirements:
|
309
281
|
- - ">="
|
310
282
|
- !ruby/object:Gem::Version
|
311
283
|
version: '0'
|
312
284
|
requirements: []
|
313
|
-
rubygems_version: 3.
|
285
|
+
rubygems_version: 3.4.19
|
314
286
|
signing_key:
|
315
287
|
specification_version: 4
|
316
288
|
summary: A decidim challenges module
|