decidim-challenges 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +49 -0
- data/Rakefile +9 -0
- data/app/cells/decidim/challenges/challenge_cell.rb +21 -0
- data/app/cells/decidim/challenges/challenge_g/show.erb +47 -0
- data/app/cells/decidim/challenges/challenge_g_cell.rb +69 -0
- data/app/cells/decidim/problems/problem_cell.rb +21 -0
- data/app/cells/decidim/problems/problem_g/show.erb +35 -0
- data/app/cells/decidim/problems/problem_g_cell.rb +61 -0
- data/app/cells/decidim/solutions/solution_cell.rb +21 -0
- data/app/cells/decidim/solutions/solution_g/show.erb +30 -0
- data/app/cells/decidim/solutions/solution_g_cell.rb +84 -0
- data/app/commands/decidim/challenges/admin/create_challenge.rb +67 -0
- data/app/commands/decidim/challenges/admin/destroy_challenge.rb +49 -0
- data/app/commands/decidim/challenges/admin/export_challenge_surveys.rb +45 -0
- data/app/commands/decidim/challenges/admin/publish_challenge.rb +40 -0
- data/app/commands/decidim/challenges/admin/unpublish_challenge.rb +40 -0
- data/app/commands/decidim/challenges/admin/update_challenge.rb +72 -0
- data/app/commands/decidim/challenges/admin/update_surveys.rb +43 -0
- data/app/commands/decidim/challenges/survey_challenge.rb +67 -0
- data/app/commands/decidim/command_utils.rb +20 -0
- data/app/commands/decidim/problems/admin/create_problem.rb +66 -0
- data/app/commands/decidim/problems/admin/destroy_problem.rb +49 -0
- data/app/commands/decidim/problems/admin/publish_problem.rb +40 -0
- data/app/commands/decidim/problems/admin/unpublish_problem.rb +40 -0
- data/app/commands/decidim/problems/admin/update_problem.rb +69 -0
- data/app/commands/decidim/solutions/admin/create_solution.rb +65 -0
- data/app/commands/decidim/solutions/admin/destroy_solution.rb +43 -0
- data/app/commands/decidim/solutions/admin/publish_solution.rb +40 -0
- data/app/commands/decidim/solutions/admin/unpublish_solution.rb +40 -0
- data/app/commands/decidim/solutions/admin/update_solution.rb +67 -0
- data/app/commands/decidim/solutions/create_solution.rb +67 -0
- data/app/controllers/concerns/decidim/challenges/admin/filterable.rb +27 -0
- data/app/controllers/concerns/decidim/challenges/orderable_challenges.rb +37 -0
- data/app/controllers/concerns/decidim/problems/admin/filterable.rb +27 -0
- data/app/controllers/concerns/decidim/problems/orderable_problems.rb +37 -0
- data/app/controllers/concerns/decidim/solutions/admin/filterable.rb +27 -0
- data/app/controllers/concerns/decidim/solutions/orderable_solutions.rb +37 -0
- data/app/controllers/concerns/decidim/with_default_filters.rb +23 -0
- data/app/controllers/concerns/decidim/with_sdgs.rb +19 -0
- data/app/controllers/decidim/challenges/admin/application_controller.rb +15 -0
- data/app/controllers/decidim/challenges/admin/challenge_publications_controller.rb +53 -0
- data/app/controllers/decidim/challenges/admin/challenges_controller.rb +108 -0
- data/app/controllers/decidim/challenges/admin/survey_form_controller.rb +43 -0
- data/app/controllers/decidim/challenges/admin/surveys_controller.rb +104 -0
- data/app/controllers/decidim/challenges/application_controller.rb +13 -0
- data/app/controllers/decidim/challenges/challenges_controller.rb +70 -0
- data/app/controllers/decidim/challenges/surveys_controller.rb +61 -0
- data/app/controllers/decidim/problems/admin/application_controller.rb +15 -0
- data/app/controllers/decidim/problems/admin/problem_publications_controller.rb +53 -0
- data/app/controllers/decidim/problems/admin/problems_controller.rb +102 -0
- data/app/controllers/decidim/problems/application_controller.rb +13 -0
- data/app/controllers/decidim/problems/problems_controller.rb +62 -0
- data/app/controllers/decidim/sdgs/admin/application_controller.rb +15 -0
- data/app/controllers/decidim/sdgs/admin/sdgs_controller.rb +18 -0
- data/app/controllers/decidim/sdgs/application_controller.rb +13 -0
- data/app/controllers/decidim/sdgs/sdgs_controller.rb +24 -0
- data/app/controllers/decidim/solutions/admin/application_controller.rb +15 -0
- data/app/controllers/decidim/solutions/admin/solution_publications_controller.rb +53 -0
- data/app/controllers/decidim/solutions/admin/solutions_controller.rb +106 -0
- data/app/controllers/decidim/solutions/application_controller.rb +13 -0
- data/app/controllers/decidim/solutions/solutions_controller.rb +115 -0
- data/app/forms/decidim/challenges/admin/challenge_surveys_form.rb +35 -0
- data/app/forms/decidim/challenges/admin/challenges_form.rb +78 -0
- data/app/forms/decidim/problems/admin/problems_form.rb +90 -0
- data/app/forms/decidim/solutions/admin/solutions_form.rb +71 -0
- data/app/forms/decidim/solutions/solutions_form.rb +50 -0
- data/app/helpers/decidim/challenges/application_helper.rb +25 -0
- data/app/helpers/decidim/challenges/challenge_cells_helper.rb +57 -0
- data/app/helpers/decidim/challenges/challenges_helper.rb +39 -0
- data/app/helpers/decidim/problems/application_helper.rb +10 -0
- data/app/helpers/decidim/problems/problem_cells_helper.rb +23 -0
- data/app/helpers/decidim/problems/problems_helper.rb +24 -0
- data/app/helpers/decidim/sdgs/sdgs_helper.rb +28 -0
- data/app/helpers/decidim/show_filters_helper.rb +13 -0
- data/app/helpers/decidim/solutions/application_helper.rb +27 -0
- data/app/helpers/decidim/solutions/solution_cells_helper.rb +56 -0
- data/app/helpers/decidim/solutions/solutions_helper.rb +21 -0
- data/app/models/decidim/application_record.rb +8 -0
- data/app/models/decidim/challenges/challenge.rb +82 -0
- data/app/models/decidim/challenges/survey.rb +19 -0
- data/app/models/decidim/problems/problem.rb +118 -0
- data/app/models/decidim/sdgs/sdg.rb +47 -0
- data/app/models/decidim/solutions/application_record.rb +10 -0
- data/app/models/decidim/solutions/solution.rb +69 -0
- data/app/packs/entrypoints/decidim_challenges.js +4 -0
- data/app/packs/entrypoints/decidim_challenges.scss +1 -0
- data/app/packs/entrypoints/decidim_problems.js +1 -0
- data/app/packs/entrypoints/decidim_problems.scss +1 -0
- data/app/packs/entrypoints/decidim_sdgs.js +6 -0
- data/app/packs/entrypoints/decidim_sdgs.scss +3 -0
- data/app/packs/entrypoints/decidim_shared.js +1 -0
- data/app/packs/entrypoints/decidim_shared.scss +1 -0
- data/app/packs/entrypoints/decidim_solutions.js +4 -0
- data/app/packs/entrypoints/decidim_solutions.scss +1 -0
- data/app/packs/fonts/Oswald-Medium.ttf +0 -0
- data/app/packs/images/decidim/challenges/decidim_challenges_icon.svg +1 -0
- data/app/packs/images/decidim/sdgs/ods-01.svg +11 -0
- data/app/packs/images/decidim/sdgs/ods-02.svg +11 -0
- data/app/packs/images/decidim/sdgs/ods-03.svg +11 -0
- data/app/packs/images/decidim/sdgs/ods-04.svg +12 -0
- data/app/packs/images/decidim/sdgs/ods-05.svg +12 -0
- data/app/packs/images/decidim/sdgs/ods-06.svg +20 -0
- data/app/packs/images/decidim/sdgs/ods-07.svg +18 -0
- data/app/packs/images/decidim/sdgs/ods-08.svg +13 -0
- data/app/packs/images/decidim/sdgs/ods-09.svg +25 -0
- data/app/packs/images/decidim/sdgs/ods-10.svg +13 -0
- data/app/packs/images/decidim/sdgs/ods-11.svg +41 -0
- data/app/packs/images/decidim/sdgs/ods-12.svg +11 -0
- data/app/packs/images/decidim/sdgs/ods-13.svg +57 -0
- data/app/packs/images/decidim/sdgs/ods-14.svg +14 -0
- data/app/packs/images/decidim/sdgs/ods-15.svg +11 -0
- data/app/packs/images/decidim/sdgs/ods-16.svg +14 -0
- data/app/packs/images/decidim/sdgs/ods-17.svg +39 -0
- data/app/packs/images/decidim/sdgs/sdg-wheel.png +0 -0
- data/app/packs/images/decidim/sdgs/un_emblem_square.png +0 -0
- data/app/packs/src/decidim/challenges/add_challenge.js +3 -0
- data/app/packs/src/decidim/challenges/admin/challenges_form.js +3 -0
- data/app/packs/src/decidim/sdgs/filter.js +75 -0
- data/app/packs/stylesheets/decidim/challenges/challenges.scss +3 -0
- data/app/packs/stylesheets/decidim/problems/problems.scss +3 -0
- data/app/packs/stylesheets/decidim/sdgs/ods.scss +185 -0
- data/app/packs/stylesheets/decidim/sdgs/sdgs_filter/button.scss +27 -0
- data/app/packs/stylesheets/decidim/sdgs/sdgs_filter/modal.scss +60 -0
- data/app/packs/stylesheets/decidim/shared/_cards.scss +52 -0
- data/app/packs/stylesheets/decidim/shared/base.scss +9 -0
- data/app/packs/stylesheets/decidim/solutions/solutions.scss +3 -0
- data/app/permissions/decidim/challenges/admin/permissions.rb +88 -0
- data/app/permissions/decidim/challenges/permissions.rb +27 -0
- data/app/permissions/decidim/problems/admin/permissions.rb +52 -0
- data/app/permissions/decidim/problems/permissions.rb +16 -0
- data/app/permissions/decidim/solutions/admin/permissions.rb +58 -0
- data/app/permissions/decidim/solutions/permissions.rb +17 -0
- data/app/presenters/decidim/challenges/challenge_presenter.rb +134 -0
- data/app/presenters/decidim/problems/problem_presenter.rb +108 -0
- data/app/presenters/decidim/solutions/solution_presenter.rb +198 -0
- data/app/serializers/decidim/challenges/data_serializer.rb +46 -0
- data/app/serializers/decidim/challenges/survey_serializer.rb +37 -0
- data/app/types/decidim/challenges/challenge_type.rb +28 -0
- data/app/types/decidim/challenges/challenges_type.rb +32 -0
- data/app/types/decidim/problems/problem_type.rb +29 -0
- data/app/types/decidim/problems/problems_type.rb +32 -0
- data/app/types/decidim/solutions/solution_type.rb +25 -0
- data/app/types/decidim/solutions/solutions_type.rb +32 -0
- data/app/views/decidim/challenges/admin/challenges/_form.html.erb +78 -0
- data/app/views/decidim/challenges/admin/challenges/edit.html.erb +24 -0
- data/app/views/decidim/challenges/admin/challenges/index.html.erb +88 -0
- data/app/views/decidim/challenges/admin/challenges/new.html.erb +18 -0
- data/app/views/decidim/challenges/admin/surveys/_form.html.erb +9 -0
- data/app/views/decidim/challenges/admin/surveys/edit.html.erb +39 -0
- data/app/views/decidim/challenges/admin/surveys/index.html.erb +49 -0
- data/app/views/decidim/challenges/admin/surveys/show.html.erb +43 -0
- data/app/views/decidim/challenges/challenges/_challenge.html.erb +1 -0
- data/app/views/decidim/challenges/challenges/_challenges.html.erb +11 -0
- data/app/views/decidim/challenges/challenges/_related_problems.html.erb +14 -0
- data/app/views/decidim/challenges/challenges/_sidebar_data.html.erb +60 -0
- data/app/views/decidim/challenges/challenges/index.html.erb +29 -0
- data/app/views/decidim/challenges/challenges/index.js.erb +5 -0
- data/app/views/decidim/challenges/challenges/show.html.erb +41 -0
- data/app/views/decidim/problems/admin/problems/_form.html.erb +79 -0
- data/app/views/decidim/problems/admin/problems/edit.html.erb +24 -0
- data/app/views/decidim/problems/admin/problems/index.html.erb +93 -0
- data/app/views/decidim/problems/admin/problems/new.html.erb +18 -0
- data/app/views/decidim/problems/problems/_problem.html.erb +1 -0
- data/app/views/decidim/problems/problems/_problems.html.erb +11 -0
- data/app/views/decidim/problems/problems/_sidebar_data.html.erb +70 -0
- data/app/views/decidim/problems/problems/index.html.erb +28 -0
- data/app/views/decidim/problems/problems/index.js.erb +5 -0
- data/app/views/decidim/problems/problems/show.html.erb +38 -0
- data/app/views/decidim/sdgs/sdgs/_objectives.html.erb +320 -0
- data/app/views/decidim/sdgs/sdgs/_ods.html.erb +132 -0
- data/app/views/decidim/sdgs/sdgs/index.html.erb +64 -0
- data/app/views/decidim/sdgs/sdgs_filter/_filter_selector.html.erb +7 -0
- data/app/views/decidim/sdgs/sdgs_filter/_modal.html.erb +35 -0
- data/app/views/decidim/shared/_related_solutions.html.erb +14 -0
- data/app/views/decidim/solutions/admin/solutions/_documents.html.erb +13 -0
- data/app/views/decidim/solutions/admin/solutions/_form.html.erb +70 -0
- data/app/views/decidim/solutions/admin/solutions/_photos.html.erb +13 -0
- data/app/views/decidim/solutions/admin/solutions/edit.html.erb +24 -0
- data/app/views/decidim/solutions/admin/solutions/index.html.erb +97 -0
- data/app/views/decidim/solutions/admin/solutions/new.html.erb +18 -0
- data/app/views/decidim/solutions/admin/solutions/show.html.erb +114 -0
- data/app/views/decidim/solutions/solutions/_form.html.erb +22 -0
- data/app/views/decidim/solutions/solutions/_sidebar_data.html.erb +114 -0
- data/app/views/decidim/solutions/solutions/_solution.html.erb +1 -0
- data/app/views/decidim/solutions/solutions/_solutions.html.erb +13 -0
- data/app/views/decidim/solutions/solutions/index.html.erb +37 -0
- data/app/views/decidim/solutions/solutions/index.js.erb +5 -0
- data/app/views/decidim/solutions/solutions/new.html.erb +20 -0
- data/app/views/decidim/solutions/solutions/show.html.erb +72 -0
- data/config/assets.rb +27 -0
- data/config/i18n-tasks.yml +10 -0
- data/config/locales/ca.yml +1244 -0
- data/config/locales/cs.yml +668 -0
- data/config/locales/en.yml +1245 -0
- data/config/locales/es.yml +1250 -0
- data/config/locales/oc.yml +1229 -0
- data/db/migrate/20201014125000_create_decidim_challenges_challenges.rb +23 -0
- data/db/migrate/20201103155100_create_decidim_problems_problems.rb +25 -0
- data/db/migrate/20201116111200_create_decidim_solutions_solutions.rb +21 -0
- data/db/migrate/20210413083244_create_decidim_challenges_surveys.rb +14 -0
- data/db/migrate/20210413083507_add_survey_attributes_to_challenges.rb +7 -0
- data/db/migrate/20210413083604_add_questionnaire_to_existing_challenges.rb +15 -0
- data/db/migrate/20210413112229_add_challenge_reference_to_solutions.rb +7 -0
- data/db/migrate/20210427091033_remove_require_null_in_problems_for_solutions.rb +7 -0
- data/db/migrate/20220407110503_add_card_image_to_challenges.rb +7 -0
- data/db/migrate/20240919094714_add_public_fields_to_solutions.rb +10 -0
- data/lib/decidim/challenges/admin.rb +10 -0
- data/lib/decidim/challenges/admin_engine.rb +37 -0
- data/lib/decidim/challenges/component.rb +65 -0
- data/lib/decidim/challenges/engine.rb +39 -0
- data/lib/decidim/challenges/test/factories.rb +59 -0
- data/lib/decidim/challenges/version.rb +14 -0
- data/lib/decidim/challenges.rb +13 -0
- data/lib/decidim/problems/admin.rb +10 -0
- data/lib/decidim/problems/admin_engine.rb +25 -0
- data/lib/decidim/problems/component.rb +51 -0
- data/lib/decidim/problems/engine.rb +31 -0
- data/lib/decidim/problems/test/factories.rb +39 -0
- data/lib/decidim/sdgs/admin.rb +10 -0
- data/lib/decidim/sdgs/admin_engine.rb +28 -0
- data/lib/decidim/sdgs/component.rb +44 -0
- data/lib/decidim/sdgs/engine.rb +23 -0
- data/lib/decidim/sdgs/test/factories.rb +13 -0
- data/lib/decidim/solutions/admin.rb +10 -0
- data/lib/decidim/solutions/admin_engine.rb +25 -0
- data/lib/decidim/solutions/component.rb +52 -0
- data/lib/decidim/solutions/engine.rb +31 -0
- data/lib/decidim/solutions/test/factories.rb +28 -0
- metadata +316 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h1 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h1>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form edit_problem problem_form_admin" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f, locals: { title: t(".title") } %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
14
|
+
|
15
|
+
<% if problem.published? %>
|
16
|
+
<%= link_to t("actions.unpublish", scope: "decidim.problems.admin"), problem_publish_path(problem), method: :delete, class: "button button__sm button__secondary" %>
|
17
|
+
<% else %>
|
18
|
+
<%= link_to t("actions.publish", scope: "decidim.problems.admin"), problem_publish_path(problem), method: :post, class: "button button__sm button__secondary" %>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</div>
|
@@ -0,0 +1,93 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
<div class="card">
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<div>
|
6
|
+
<%= t(".title") %>
|
7
|
+
<span id="js-selected-problems-count" class="component-counter component-counter--inline" title="<%= t("decidim.problems.admin.problems.index.selected") %>"></span>
|
8
|
+
</div>
|
9
|
+
<div class="flex items-center gap-x-4">
|
10
|
+
<% if allowed_to? :create, :problem %>
|
11
|
+
<%= link_to t("actions.new_problem", scope: "decidim.problems.admin"),
|
12
|
+
new_problem_path,
|
13
|
+
class: "button button__sm button__secondary" %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render partial: "decidim/admin/components/resource_action" %>
|
17
|
+
</div>
|
18
|
+
</h1>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="table-scroll mt-16">
|
22
|
+
<table class="table-list">
|
23
|
+
<thead>
|
24
|
+
<tr>
|
25
|
+
<th>
|
26
|
+
<%= t("models.problem.fields.title", scope: "decidim.problems.admin") %>
|
27
|
+
</th>
|
28
|
+
<th>
|
29
|
+
<%= t("models.problem.fields.created_at", scope: "decidim.problems.admin") %>
|
30
|
+
</th>
|
31
|
+
<th>
|
32
|
+
<%= t("models.problem.fields.challenge", scope: "decidim.problems.admin") %>
|
33
|
+
</th>
|
34
|
+
<th>
|
35
|
+
<%= t("models.problem.fields.state", scope: "decidim.problems.admin") %>
|
36
|
+
</th>
|
37
|
+
<th>
|
38
|
+
<%= t("models.problem.fields.start_date", scope: "decidim.problems.admin") %>
|
39
|
+
</th>
|
40
|
+
<th>
|
41
|
+
<%= t("models.problem.fields.end_date", scope: "decidim.problems.admin") %>
|
42
|
+
</th>
|
43
|
+
<th>
|
44
|
+
<%= t("models.problem.fields.published", scope: "decidim.problems.admin") %>
|
45
|
+
</th>
|
46
|
+
<th class="table-list__actions"></th>
|
47
|
+
</tr>
|
48
|
+
</thead>
|
49
|
+
<tbody>
|
50
|
+
<% @problems.each do |problem| %>
|
51
|
+
<tr>
|
52
|
+
<td>
|
53
|
+
<%= translated_attribute(problem.title) %>
|
54
|
+
</td>
|
55
|
+
<td>
|
56
|
+
<%= l(problem.created_at, format: :decidim_short) if problem.created_at %>
|
57
|
+
</td>
|
58
|
+
<td>
|
59
|
+
<%= translated_attribute(problem.challenge.title) %>
|
60
|
+
</td>
|
61
|
+
<td>
|
62
|
+
<%= I18n.t(problem.state, scope: "decidim.problems.states") %>
|
63
|
+
</td>
|
64
|
+
<td>
|
65
|
+
<%= problem.start_date %>
|
66
|
+
</td>
|
67
|
+
<td>
|
68
|
+
<%= problem.end_date %>
|
69
|
+
</td>
|
70
|
+
<td>
|
71
|
+
<% if problem.published? %>
|
72
|
+
<strong class="text-success"><%= t("index.published", scope: "decidim.problems") %></strong>
|
73
|
+
<% else %>
|
74
|
+
<strong class="text-alert"><%= t("index.not_published", scope: "decidim.problems") %></strong>
|
75
|
+
<% end %>
|
76
|
+
</td>
|
77
|
+
<td class="table-list__actions">
|
78
|
+
<% if allowed_to? :edit, :problem %>
|
79
|
+
<%= icon_link_to "pencil-line", edit_problem_path(problem), t("actions.configure", scope: "decidim.problems.admin"), class: "action-icon--new" %>
|
80
|
+
<% end %>
|
81
|
+
<%= icon_link_to "eye-line", resource_locator(problem).path, t("actions.view", scope: "decidim.problems.admin"), class: "action-icon--preview", target: :blank %>
|
82
|
+
<% if allowed_to? :destroy, :problem, problem: problem %>
|
83
|
+
<%= icon_link_to "close-circle-line", problem, t("actions.destroy", scope: "decidim.problems.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.problems.admin", name: translated_attribute(problem.title)) } %>
|
84
|
+
<% end %>
|
85
|
+
</td>
|
86
|
+
</tr>
|
87
|
+
<% end %>
|
88
|
+
</tbody>
|
89
|
+
</table>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<%= decidim_paginate @problems %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h1 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h1>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form new_problem problem_form_admin" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f, locals: { title: t(".title") } %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= card_for problem, highlight: true, size: :g, has_sdgs: has_sdgs? %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if problems.empty? %>
|
2
|
+
<%= cell("decidim/announcement", params[:filter].present? ? t(".empty_filters") : t(".empty")) %>
|
3
|
+
<% else %>
|
4
|
+
<h2 class="h5 md:h3 decorator"><%= t("decidim.problems.problems.count.problems_count", count: problems.total_count) %></h2>
|
5
|
+
|
6
|
+
<%= order_selector available_orders, i18n_scope: "decidim.problems.problems.orders" %>
|
7
|
+
|
8
|
+
<%= render problems, locals: { has_sdgs: has_sdgs? } %>
|
9
|
+
|
10
|
+
<%= decidim_paginate problems %>
|
11
|
+
<% end %>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<div class="rounded p-4 bg-background mb-4 divide-y divide-gray-3 [&>*]:py-4 first:[&>*]:pt-0 last:[&>*]:pb-0">
|
2
|
+
<div class="text-gray-2 space-y-1.5">
|
3
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
4
|
+
<p class="uppercase text-xs"><%= t("status", scope: "activemodel.attributes.problem") %></p>
|
5
|
+
<p class="uppercase mb-4"><%= t(@problem.state, scope: "decidim.problems.states") %></p>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<% if @challenge_scope.present? %>
|
9
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
10
|
+
<p class="uppercase text-xs"><%= t("scope", scope: "activemodel.attributes.problem") %></p>
|
11
|
+
<p class="uppercase mb-4"><%= translated_attribute(@challenge_scope.name) %></p>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% if @problem.challenge.coordinating_entities.present? %>
|
16
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
17
|
+
<p class="uppercase text-xs"><%= t("coordinating_entities", scope: "activemodel.attributes.challenge") %></p>
|
18
|
+
<p class="uppercase mb-4"><%= present(@problem).challenge.coordinating_entities %></p>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<% if @problem.causes.present? %>
|
23
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
24
|
+
<p class="uppercase text-xs"><%= t("causes", scope: "activemodel.attributes.problem") %></p>
|
25
|
+
<p class="uppercase mb-4"><%= present(@problem).causes %></p>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<% if @problem.groups_affected.present? %>
|
30
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
31
|
+
<p class="uppercase text-xs"><%= t("groups_affected", scope: "activemodel.attributes.problem") %></p>
|
32
|
+
<p class="uppercase mb-4"><%= present(@problem).groups_affected %></p>
|
33
|
+
</div>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<% if @problem.decidim_sectorial_scope_id.present? %>
|
37
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
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 %></p>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<% if @problem.decidim_technological_scope_id.present? %>
|
44
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
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 %></p>
|
47
|
+
</div>
|
48
|
+
<% end %>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<% if @problem.challenge.sdg_code %>
|
52
|
+
<div class="text-sm flex flex-col items-center gap-1">
|
53
|
+
<p class="uppercase text-xs text-center"><%= t("sdg", scope: "activemodel.attributes.problem") %></p>
|
54
|
+
<div class="ods challenges flex items-center">
|
55
|
+
<div class="text-container show">
|
56
|
+
<p><%= t(@problem.challenge.sdg_code + ".logo.line1", scope: "decidim.components.sdgs") %></p>
|
57
|
+
<p><%= t(@problem.challenge.sdg_code + ".logo.line2", scope: "decidim.components.sdgs") %></p>
|
58
|
+
</div>
|
59
|
+
<% sdg_code = (1 + Decidim::Sdgs::Sdg.index_from_code(@problem.challenge.sdg_code.to_sym)).to_s.rjust(2, "0") %>
|
60
|
+
<%= image_pack_tag "media/images/ods-#{sdg_code}.svg", alt: "Logo ODS #{sdg_code}", class: "problem--view" %>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
<% end %>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<section class="layout-aside__section actions__secondary">
|
67
|
+
<%= resource_reference(current_participatory_space) %>
|
68
|
+
<%= render partial: "decidim/shared/follow_button", class: "text-center", locals: { followable: current_participatory_space, large: false } %>
|
69
|
+
<%= cell "decidim/share_button", nil %>
|
70
|
+
</section>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<% add_decidim_page_title(t("name", scope: "decidim.components.problems")) %>
|
2
|
+
|
3
|
+
<%= append_stylesheet_pack_tag "decidim_sdgs" %>
|
4
|
+
<%= append_stylesheet_pack_tag "decidim_problems" %>
|
5
|
+
|
6
|
+
<% content_for :aside do %>
|
7
|
+
<h1 id="problems-count" class="title-decorator"><%= component_name %></h1>
|
8
|
+
|
9
|
+
<% unless @component_settings.hide_filters %>
|
10
|
+
<%= render layout: "decidim/shared/filters", locals: { filter_sections:, has_sdgs: has_sdgs?, search_variable: :search_text_cont, skip_to_id: "problems" } do %>
|
11
|
+
<%= hidden_field_tag :order, order, id: nil, class: "order_filter" %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% if has_sdgs? %>
|
16
|
+
<%= filter_form_for filter do |form| %>
|
17
|
+
<%= sdgs_filter_selector(form) %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<%= render layout: "layouts/decidim/shared/layout_two_col" do %>
|
23
|
+
<section id="problems" class="layout-main__section layout-main__heading">
|
24
|
+
<%= render partial: "problems", locals: { has_sdgs: has_sdgs? } %>
|
25
|
+
</section>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%= render partial: "decidim/sdgs/sdgs_filter/modal" %>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<%= append_stylesheet_pack_tag "decidim_sdgs" %>
|
2
|
+
<%= append_stylesheet_pack_tag "decidim_problems" %>
|
3
|
+
|
4
|
+
<%= render layout: "layouts/decidim/shared/layout_item", locals: { back_path: problems_path } do %>
|
5
|
+
<section class="layout-main__section layout-main__heading">
|
6
|
+
<h1 class="h2 decorator">
|
7
|
+
<%= present(@problem).title(links: true, html_escape: true) %>
|
8
|
+
</h1>
|
9
|
+
</section>
|
10
|
+
|
11
|
+
<section class="layout-main__section content-block__description">
|
12
|
+
<%= render partial: "decidim/shared/share_modal" %>
|
13
|
+
|
14
|
+
<h3 class="h4">
|
15
|
+
<span class="title"><%= t("challenge", scope: "activemodel.attributes.problem") %></span>:
|
16
|
+
<%= link_to translated_attribute(@problem.challenge.title), Decidim::ResourceLocatorPresenter.new(@problem.challenge).path %></strong>
|
17
|
+
</h3>
|
18
|
+
|
19
|
+
<h3 class="h4"><%= t("description", scope: "activemodel.attributes.problem") %></h3>
|
20
|
+
<div class="rich-text-display">
|
21
|
+
<p><%= present(@problem).description %></p>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<% if present(@problem).tags.present? %>
|
25
|
+
<h3 class="h4"><%= t("tags", scope: "activemodel.attributes.problem") %></h3>
|
26
|
+
<p class="tags"><%= present(@problem).tags %></p>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<% if @problem.solutions.any? %>
|
30
|
+
<%= render partial: "decidim/shared/related_solutions", locals: {solutions: @problem.solutions} %>
|
31
|
+
<% end %>
|
32
|
+
</section>
|
33
|
+
|
34
|
+
<% content_for :aside do %>
|
35
|
+
<%= render partial: "sidebar_data" %>
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
38
|
+
|