decidim-accountability 0.27.9 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/accountability/content_blocks/highlighted_results_cell.rb +3 -8
- data/app/cells/decidim/accountability/highlighted_results/show.erb +3 -1
- data/app/cells/decidim/accountability/highlighted_results_for_component/show.erb +19 -19
- data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +29 -6
- data/app/cells/decidim/accountability/project/show.erb +11 -0
- data/app/cells/decidim/accountability/project/timeline.erb +22 -0
- data/app/cells/decidim/accountability/project_cell.rb +75 -0
- data/app/cells/decidim/accountability/result_activity_cell.rb +1 -4
- data/app/cells/decidim/accountability/result_card_cell.rb +21 -0
- data/app/cells/decidim/accountability/result_cell.rb +2 -2
- data/app/cells/decidim/accountability/result_l/extra_data.erb +3 -0
- data/app/cells/decidim/accountability/result_l_cell.rb +30 -0
- data/app/cells/decidim/accountability/result_metadata/project_aside.erb +6 -0
- data/app/cells/decidim/accountability/result_metadata/show_footer.erb +11 -0
- data/app/cells/decidim/accountability/result_metadata/versions.erb +1 -0
- data/app/cells/decidim/accountability/result_metadata_cell.rb +136 -0
- data/app/cells/decidim/accountability/results/show.erb +7 -0
- data/app/cells/decidim/accountability/results_cell.rb +14 -0
- data/app/cells/decidim/accountability/status/show.erb +9 -0
- data/app/cells/decidim/accountability/status/status.erb +16 -0
- data/app/cells/decidim/accountability/status_cell.rb +91 -0
- data/app/commands/decidim/accountability/admin/import_projects_to_accountability.rb +37 -0
- data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +2 -2
- data/app/controllers/decidim/accountability/admin/import_results_controller.rb +18 -6
- data/app/controllers/decidim/accountability/admin/projects_import_controller.rb +31 -0
- data/app/controllers/decidim/accountability/admin/results_controller.rb +4 -5
- data/app/controllers/decidim/accountability/admin/statuses_controller.rb +3 -3
- data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +3 -3
- data/app/controllers/decidim/accountability/results_controller.rb +20 -2
- data/app/events/decidim/accountability/proposal_linked_event.rb +18 -1
- data/app/events/decidim/accountability/result_progress_updated_event.rb +18 -2
- data/app/forms/decidim/accountability/admin/import_results_form.rb +22 -0
- data/app/forms/decidim/accountability/admin/result_import_projects_form.rb +51 -0
- data/app/helpers/decidim/accountability/admin/application_helper.rb +1 -0
- data/app/helpers/decidim/accountability/application_helper.rb +43 -2
- data/app/helpers/decidim/accountability/breadcrumb_helper.rb +10 -0
- data/app/jobs/decidim/accountability/admin/import_projects_job.rb +72 -0
- data/app/mailers/decidim/accountability/import_projects_mailer.rb +25 -0
- data/app/models/decidim/accountability/result.rb +1 -1
- data/app/packs/entrypoints/decidim_accountability.js +4 -1
- data/app/packs/entrypoints/decidim_accountability_admin_imports.js +3 -0
- data/app/packs/images/decidim/accountability/breadcrumb_arrow.svg +3 -0
- data/app/packs/src/decidim/accountability/admin/imports.js +15 -0
- data/app/packs/stylesheets/accountability.scss +169 -0
- data/app/permissions/decidim/accountability/admin/permissions.rb +17 -6
- data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +2 -2
- data/app/presenters/decidim/accountability/admin_log/status_presenter.rb +2 -2
- data/app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb +2 -2
- data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +1 -1
- data/app/services/decidim/accountability/results_calculator.rb +1 -1
- data/app/services/decidim/accountability/results_csv_importer.rb +2 -2
- data/app/views/decidim/accountability/admin/import_results/new.html.erb +27 -23
- data/app/views/decidim/accountability/admin/projects_import/new.html.erb +45 -0
- data/app/views/decidim/accountability/admin/results/_form.html.erb +46 -46
- data/app/views/decidim/accountability/admin/results/edit.html.erb +18 -7
- data/app/views/decidim/accountability/admin/results/index.html.erb +102 -91
- data/app/views/decidim/accountability/admin/results/new.html.erb +18 -8
- data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
- data/app/views/decidim/accountability/admin/statuses/_form.html.erb +15 -17
- data/app/views/decidim/accountability/admin/statuses/edit.html.erb +16 -6
- data/app/views/decidim/accountability/admin/statuses/index.html.erb +33 -36
- data/app/views/decidim/accountability/admin/statuses/new.html.erb +16 -6
- data/app/views/decidim/accountability/admin/timeline_entries/_form.html.erb +12 -14
- data/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb +17 -6
- data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +35 -34
- data/app/views/decidim/accountability/admin/timeline_entries/new.html.erb +17 -6
- data/app/views/decidim/accountability/import_projects_mailer/import.html.erb +2 -0
- data/app/views/decidim/accountability/results/_home_categories.html.erb +28 -73
- data/app/views/decidim/accountability/results/_linked_results.html.erb +3 -12
- data/app/views/decidim/accountability/results/_project.html.erb +29 -0
- data/app/views/decidim/accountability/results/_projects_aside.html.erb +40 -0
- data/app/views/decidim/accountability/results/_scope_filters.html.erb +27 -27
- data/app/views/decidim/accountability/results/_search.html.erb +15 -9
- data/app/views/decidim/accountability/results/_stats_box.html.erb +3 -3
- data/app/views/decidim/accountability/results/home.html.erb +34 -8
- data/app/views/decidim/accountability/results/index.html.erb +15 -15
- data/app/views/decidim/accountability/results/index.js.erb +3 -0
- data/app/views/decidim/accountability/results/show.html.erb +9 -10
- data/app/views/decidim/accountability/versions/show.html.erb +13 -10
- data/app/views/decidim/participatory_spaces/_result.html.erb +4 -4
- data/config/assets.rb +2 -2
- data/config/locales/ar.yml +23 -61
- data/config/locales/bg.yml +0 -96
- data/config/locales/ca.yml +54 -31
- data/config/locales/cs.yml +58 -29
- data/config/locales/da.yml +1 -36
- data/config/locales/de.yml +59 -36
- data/config/locales/el.yml +62 -29
- data/config/locales/en.yml +55 -31
- data/config/locales/es-MX.yml +52 -29
- data/config/locales/es-PY.yml +52 -29
- data/config/locales/es.yml +55 -32
- data/config/locales/eu.yml +53 -30
- data/config/locales/fi-plain.yml +51 -28
- data/config/locales/fi.yml +54 -31
- data/config/locales/fr-CA.yml +51 -28
- data/config/locales/fr.yml +52 -29
- data/config/locales/ga-IE.yml +0 -4
- data/config/locales/gl.yml +0 -41
- data/config/locales/hu.yml +41 -29
- data/config/locales/id-ID.yml +1 -30
- data/config/locales/is-IS.yml +0 -32
- data/config/locales/it.yml +0 -43
- data/config/locales/ja.yml +55 -39
- data/config/locales/kaa.yml +20 -1
- data/config/locales/ko.yml +0 -188
- data/config/locales/lb.yml +1 -42
- data/config/locales/lt.yml +60 -41
- data/config/locales/lv.yml +1 -36
- data/config/locales/nl.yml +0 -41
- data/config/locales/no.yml +8 -49
- data/config/locales/pl.yml +17 -61
- data/config/locales/pt-BR.yml +41 -29
- data/config/locales/pt.yml +0 -42
- data/config/locales/ro-RO.yml +39 -66
- data/config/locales/ru.yml +1 -30
- data/config/locales/si-LK.yml +0 -4
- data/config/locales/sk.yml +1 -40
- data/config/locales/sl.yml +0 -11
- data/config/locales/sq-AL.yml +82 -7
- data/config/locales/sr-CS.yml +1 -30
- data/config/locales/sv.yml +36 -51
- data/config/locales/th-TH.yml +0 -140
- data/config/locales/tr-TR.yml +9 -75
- data/config/locales/uk.yml +1 -28
- data/config/locales/zh-CN.yml +1 -36
- data/config/locales/zh-TW.yml +52 -43
- data/lib/decidim/accountability/admin_engine.rb +3 -2
- data/lib/decidim/accountability/component.rb +4 -99
- data/lib/decidim/accountability/engine.rb +9 -1
- data/lib/decidim/accountability/result_serializer.rb +1 -1
- data/lib/decidim/accountability/seeds.rb +115 -0
- data/lib/decidim/accountability/test/factories.rb +18 -29
- data/lib/decidim/accountability/version.rb +1 -1
- data/lib/decidim/api/result_type.rb +1 -0
- metadata +62 -51
- data/app/cells/decidim/accountability/content_blocks/highlighted_results/elements.erb +0 -5
- data/app/cells/decidim/accountability/content_blocks/highlighted_results/heading.erb +0 -1
- data/app/cells/decidim/accountability/result_m/data.erb +0 -23
- data/app/cells/decidim/accountability/result_m/footer.erb +0 -22
- data/app/cells/decidim/accountability/result_m/tags.erb +0 -1
- data/app/cells/decidim/accountability/result_m_cell.rb +0 -37
- data/app/events/decidim/accountability/base_result_event.rb +0 -29
- data/app/packs/stylesheets/decidim/accountability/_accountability.scss +0 -4
- data/app/packs/stylesheets/decidim/accountability/accountability/_cards.scss +0 -11
- data/app/packs/stylesheets/decidim/accountability/accountability/_categories.scss +0 -121
- data/app/packs/stylesheets/decidim/accountability/accountability/_lines_breadcrumb.scss +0 -37
- data/app/packs/stylesheets/decidim/accountability/accountability/_results.scss +0 -148
- data/app/views/decidim/accountability/admin/results/proposals_picker.html.erb +0 -1
- data/app/views/decidim/accountability/result_widgets/show.html.erb +0 -2
- data/app/views/decidim/accountability/results/_home_header.html.erb +0 -23
- data/app/views/decidim/accountability/results/_results_leaf.html.erb +0 -47
- data/app/views/decidim/accountability/results/_results_parent.html.erb +0 -32
- data/app/views/decidim/accountability/results/_show_leaf.html.erb +0 -81
- data/app/views/decidim/accountability/results/_show_parent.html.erb +0 -30
- data/app/views/decidim/accountability/results/_stats.html.erb +0 -15
- data/app/views/decidim/accountability/results/_timeline.html.erb +0 -30
- data/app/views/decidim/accountability/versions/index.html.erb +0 -12
- data/config/locales/he-IL.yml +0 -219
- data/decidim-accountability.gemspec +0 -38
@@ -0,0 +1,169 @@
|
|
1
|
+
.accountability {
|
2
|
+
&__status {
|
3
|
+
@apply flex flex-col gap-3 w-full;
|
4
|
+
|
5
|
+
&-container {
|
6
|
+
@apply w-full last:[&>*]:flex last:[&>*]:gap-1;
|
7
|
+
}
|
8
|
+
|
9
|
+
&-title {
|
10
|
+
@apply font-semibold text-secondary text-lg [&+*]:mt-auto;
|
11
|
+
}
|
12
|
+
|
13
|
+
&-progress {
|
14
|
+
@apply w-full h-4 rounded overflow-hidden bg-white [&>*]:bg-success [&>*]:h-full;
|
15
|
+
}
|
16
|
+
|
17
|
+
&-value {
|
18
|
+
@apply flex justify-between items-baseline gap-1 text-gray-2;
|
19
|
+
|
20
|
+
> :first-child {
|
21
|
+
@apply text-4xl font-bold;
|
22
|
+
}
|
23
|
+
|
24
|
+
> :last-child:not(:only-child) {
|
25
|
+
@apply text-sm truncate;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
&__home {
|
30
|
+
@apply gap-4 p-6 bg-white drop-shadow-[0_4px_6px_rgba(211,211,211,0.25)];
|
31
|
+
}
|
32
|
+
|
33
|
+
&__home &-title {
|
34
|
+
@apply text-xl text-gray-2;
|
35
|
+
}
|
36
|
+
|
37
|
+
&__home &-progress {
|
38
|
+
@apply bg-background;
|
39
|
+
}
|
40
|
+
|
41
|
+
&__home &-value > :first-child {
|
42
|
+
@apply text-[48px];
|
43
|
+
}
|
44
|
+
|
45
|
+
&__background {
|
46
|
+
@apply bg-background p-4;
|
47
|
+
}
|
48
|
+
|
49
|
+
&__border {
|
50
|
+
@apply border-2 border-background rounded p-4;
|
51
|
+
}
|
52
|
+
|
53
|
+
&__border &-progress {
|
54
|
+
@apply invisible;
|
55
|
+
}
|
56
|
+
|
57
|
+
&__border &-title {
|
58
|
+
@apply text-md text-secondary;
|
59
|
+
}
|
60
|
+
|
61
|
+
&__parent {
|
62
|
+
@apply p-4 gap-1 bg-white drop-shadow-[0_4px_6px_rgba(211,211,211,0.25)];
|
63
|
+
}
|
64
|
+
|
65
|
+
&__parent &-progress {
|
66
|
+
@apply hidden;
|
67
|
+
}
|
68
|
+
|
69
|
+
&__parent &-value > :first-child {
|
70
|
+
@apply text-xl;
|
71
|
+
}
|
72
|
+
|
73
|
+
&__child {
|
74
|
+
@apply mt-4 p-4 bg-white drop-shadow-[0_4px_6px_rgba(211,211,211,0.25)];
|
75
|
+
}
|
76
|
+
|
77
|
+
&__child &-title {
|
78
|
+
@apply text-md;
|
79
|
+
}
|
80
|
+
|
81
|
+
&__child &-progress {
|
82
|
+
@apply bg-background;
|
83
|
+
}
|
84
|
+
|
85
|
+
&__child &-value > :first-child {
|
86
|
+
@apply text-3xl;
|
87
|
+
}
|
88
|
+
|
89
|
+
&__project &-title {
|
90
|
+
@apply text-gray-2 text-md font-normal;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
&__grid {
|
95
|
+
@apply grid md:grid-cols-3 items-start gap-x-10 gap-y-8 md:gap-y-16;
|
96
|
+
|
97
|
+
& > :nth-child(even) {
|
98
|
+
@apply grid md:col-span-2;
|
99
|
+
}
|
100
|
+
|
101
|
+
/* display the titles only for the first two rows in desktop */
|
102
|
+
& > :nth-child(1) &-title,
|
103
|
+
& > :nth-child(2) &-title {
|
104
|
+
@apply md:block;
|
105
|
+
}
|
106
|
+
|
107
|
+
&-title {
|
108
|
+
@apply block md:hidden mb-8 text-gray-2 uppercase font-semibold;
|
109
|
+
}
|
110
|
+
|
111
|
+
.flash {
|
112
|
+
@apply m-0;
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
&__subgrid {
|
117
|
+
@apply grid md:grid-cols-2 gap-6;
|
118
|
+
}
|
119
|
+
|
120
|
+
&__progress {
|
121
|
+
@apply ml-auto rounded px-3 md:px-6 py-4 bg-background font-bold text-gray-2 text-xl w-full md:w-auto min-w-[120px] grid place-items-center;
|
122
|
+
}
|
123
|
+
|
124
|
+
&__project {
|
125
|
+
&-aside {
|
126
|
+
@apply bg-background p-4 rounded divide-y divide-gray-3 [&>*]:py-4 first:[&>*]:pt-0 last:[&>*]:pb-0;
|
127
|
+
|
128
|
+
&-item {
|
129
|
+
@apply text-gray-2 space-y-1.5;
|
130
|
+
|
131
|
+
> :first-child {
|
132
|
+
@apply text-sm flex items-center gap-1;
|
133
|
+
}
|
134
|
+
|
135
|
+
> :last-child {
|
136
|
+
@apply text-md font-semibold;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
}
|
140
|
+
|
141
|
+
&-timeline {
|
142
|
+
@apply flex flex-col gap-6;
|
143
|
+
|
144
|
+
&-entry {
|
145
|
+
@apply flex items-start gap-2 relative before:absolute before:w-px before:-z-10 before:left-3 before:bg-gray-3 before:h-[calc(100%+1.5rem)] last:before:h-6 before:-top-3 first:before:top-3;
|
146
|
+
|
147
|
+
&-number {
|
148
|
+
@apply rounded-full w-6 h-6 bg-background grid place-items-center text-gray-2 text-lg font-semibold;
|
149
|
+
}
|
150
|
+
|
151
|
+
&-attributes {
|
152
|
+
@apply text-gray-2 text-sm;
|
153
|
+
|
154
|
+
> :first-child {
|
155
|
+
@apply text-lg font-semibold;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
&-list {
|
162
|
+
@apply space-y-6;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
&__filters {
|
167
|
+
@apply w-full space-y-10;
|
168
|
+
}
|
169
|
+
}
|
@@ -10,6 +10,7 @@ module Decidim
|
|
10
10
|
permission_action.allow! if can_perform_actions_on?(:result, result)
|
11
11
|
permission_action.allow! if can_perform_actions_on?(:status, status)
|
12
12
|
permission_action.allow! if can_perform_actions_on?(:timeline_entry, timeline_entry)
|
13
|
+
permission_action.allow! if can_perform_actions_on?(:import_projects, nil)
|
13
14
|
|
14
15
|
permission_action
|
15
16
|
end
|
@@ -32,13 +33,23 @@ module Decidim
|
|
32
33
|
return unless permission_action.subject == subject
|
33
34
|
return false if can_create_grandchildren_results?
|
34
35
|
|
35
|
-
case permission_action.
|
36
|
-
when :
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
case permission_action.subject
|
37
|
+
when :import_projects
|
38
|
+
case permission_action.action
|
39
|
+
when :create, :new
|
40
|
+
true if defined?(Decidim::Budgets::Project)
|
41
|
+
else
|
42
|
+
false
|
43
|
+
end
|
40
44
|
else
|
41
|
-
|
45
|
+
case permission_action.action
|
46
|
+
when :create, :create_children
|
47
|
+
true
|
48
|
+
when :update, :destroy
|
49
|
+
resource.present?
|
50
|
+
else
|
51
|
+
false
|
52
|
+
end
|
42
53
|
end
|
43
54
|
end
|
44
55
|
|
@@ -6,8 +6,8 @@ module Decidim
|
|
6
6
|
# This class holds the logic to present a `Decidim::Accountability::Result`
|
7
7
|
# for the `AdminLog` log.
|
8
8
|
#
|
9
|
-
# Usage should be automatic and you
|
10
|
-
# directly, but here
|
9
|
+
# Usage should be automatic and you should not need to call this class
|
10
|
+
# directly, but here is an example:
|
11
11
|
#
|
12
12
|
# action_log = Decidim::ActionLog.last
|
13
13
|
# view_helpers # => this comes from the views
|
@@ -6,8 +6,8 @@ module Decidim
|
|
6
6
|
# This class holds the logic to present a `Decidim::Accountability::Status`
|
7
7
|
# for the `AdminLog` log.
|
8
8
|
#
|
9
|
-
# Usage should be automatic and you
|
10
|
-
# directly, but here
|
9
|
+
# Usage should be automatic and you should not need to call this class
|
10
|
+
# directly, but here is an example:
|
11
11
|
#
|
12
12
|
# action_log = Decidim::ActionLog.last
|
13
13
|
# view_helpers # => this comes from the views
|
@@ -6,8 +6,8 @@ module Decidim
|
|
6
6
|
# This class holds the logic to present a `Decidim::Accountability::TimelineEntry`
|
7
7
|
# for the `AdminLog` log.
|
8
8
|
#
|
9
|
-
# Usage should be automatic and you
|
10
|
-
# directly, but here
|
9
|
+
# Usage should be automatic and you should not need to call this class
|
10
|
+
# directly, but here is an example:
|
11
11
|
#
|
12
12
|
# action_log = Decidim::ActionLog.last
|
13
13
|
# view_helpers # => this comes from the views
|
@@ -21,7 +21,7 @@ module Decidim
|
|
21
21
|
participatory_space_type: space_type,
|
22
22
|
participatory_space_id: space_id,
|
23
23
|
related_object_type: "Decidim::Component",
|
24
|
-
related_object_id:
|
24
|
+
related_object_id:)
|
25
25
|
record.assign_attributes(cumulative: cumulative_value, quantity: quantity_value)
|
26
26
|
record.save!
|
27
27
|
end
|
@@ -20,7 +20,7 @@ module Decidim
|
|
20
20
|
@extra_context = {
|
21
21
|
current_component: component,
|
22
22
|
current_organization: component.organization,
|
23
|
-
current_user
|
23
|
+
current_user:,
|
24
24
|
current_participatory_space: component.participatory_space
|
25
25
|
}
|
26
26
|
@matches_ids = []
|
@@ -31,7 +31,7 @@ module Decidim
|
|
31
31
|
|
32
32
|
ActiveRecord::Base.transaction do
|
33
33
|
i = 1
|
34
|
-
csv = CSV.new(@csv_file, headers: true, col_sep:
|
34
|
+
csv = CSV.new(@csv_file, headers: true, col_sep: Decidim.default_csv_col_sep)
|
35
35
|
while (row = csv.shift).present?
|
36
36
|
i += 1
|
37
37
|
next if row.empty?
|
@@ -1,27 +1,31 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= form_for(@form, url: import_results_path, html: { class: "form form-defaults import_projects" }) do |form| %>
|
10
|
+
<div class="card py-4">
|
11
|
+
<div class="card-section space-y-4 prose max-w-full">
|
12
|
+
<div class="row column">
|
13
|
+
<p><%= t(".info",
|
14
|
+
link_new_status: new_status_path,
|
15
|
+
link_new_result: new_result_path,
|
16
|
+
link_export_csv: link_to(t(".download_export"),exports_path(current_component, id: "results", format: "CSV"), method: :post)
|
17
|
+
).try("html_safe") %></p>
|
18
|
+
</div>
|
19
|
+
<div class="row column">
|
20
|
+
<%= form.upload :file, button_class: "button button__sm button__transparent-secondary" %>
|
21
|
+
</div>
|
22
|
+
</div>
|
17
23
|
</div>
|
18
|
-
<div class="
|
19
|
-
|
24
|
+
<div class="item__edit-sticky">
|
25
|
+
<div class="item__edit-sticky-container">
|
26
|
+
<%= submit_tag t(".import"), class: "button button__sm button__secondary" %>
|
27
|
+
</div>
|
20
28
|
</div>
|
21
|
-
|
29
|
+
<% end %>
|
22
30
|
</div>
|
23
|
-
|
24
|
-
<div class="button--double form-general-submit">
|
25
|
-
<%= submit_tag t(".import"), class: "button" %>
|
26
|
-
</div>
|
27
|
-
<% end %>
|
31
|
+
</div>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div class="item__edit item__edit-1col">
|
9
|
+
<div class="item__edit-form">
|
10
|
+
<%= form_for(@form, url: projects_import_index_path(@accountability), html: { class: "form form-defaults import_projects" }) do |f| %>
|
11
|
+
<% if @form.origin_components.any? %>
|
12
|
+
<div class="form__wrapper">
|
13
|
+
<div class="card pt-4">
|
14
|
+
<div class="card-section">
|
15
|
+
<div class="row column">
|
16
|
+
<%= f.select :origin_component_id, @form.origin_components_collection, prompt: t(".select_component"), label: t(".origin_component_id") %>
|
17
|
+
</div>
|
18
|
+
<div class="row column">
|
19
|
+
<% @form.origin_components.each do |component| %>
|
20
|
+
<small id="component_<%= component.id %>" class="help-text hide
|
21
|
+
<%= " form-error is-visible" if @form.selected_projects_count(component).zero? %>">
|
22
|
+
<%= t(".new_items", count: @form.selected_projects_count(component)) %>
|
23
|
+
</small>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
26
|
+
<div class="row column">
|
27
|
+
<%= f.check_box :import_all_selected_projects, label: t(".import_all_selected_projects") %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<div class="item__edit-sticky">
|
34
|
+
<div class="item__edit-sticky-container">
|
35
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<% else %>
|
39
|
+
<p><%= t(".no_components") %></p>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<%= append_javascript_pack_tag "decidim_accountability_admin_imports" %>
|
@@ -1,71 +1,71 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="card-
|
3
|
-
<h2 class="card-title"><%= title %></h2>
|
4
|
-
</div>
|
5
|
-
|
6
|
-
<div class="card-section">
|
7
|
-
<div class="row column">
|
8
|
-
<%= form.translated :text_field, :title, autofocus: true %>
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<div class="row column">
|
12
|
-
<%= form.translated :editor, :description %>
|
13
|
-
</div>
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card pt-4">
|
14
3
|
|
15
|
-
|
4
|
+
<div class="card-section">
|
5
|
+
<div class="row column">
|
6
|
+
<%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
|
7
|
+
</div>
|
16
8
|
|
17
9
|
<div class="row column">
|
18
|
-
<%= form.
|
10
|
+
<%= form.translated :editor, :description, aria: { label: :description } %>
|
19
11
|
</div>
|
20
12
|
|
21
|
-
|
13
|
+
<% if @form.parent_id %>
|
22
14
|
|
23
|
-
<% if current_component.has_subscopes? %>
|
24
15
|
<div class="row column">
|
25
|
-
<%=
|
16
|
+
<%= form.select :parent_id, parent_results.map { |result| [translated_attribute(result.title), result.id] }, include_blank: true %>
|
26
17
|
</div>
|
27
|
-
<% end %>
|
28
18
|
|
29
|
-
|
30
|
-
<%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %>
|
31
|
-
</div>
|
19
|
+
<% else %>
|
32
20
|
|
33
|
-
|
21
|
+
<% if current_component.has_subscopes? %>
|
22
|
+
<div class="row column">
|
23
|
+
<%= scopes_select_field form, :decidim_scope_id, root: current_component.scope %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
34
26
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
</div>
|
27
|
+
<div class="row column">
|
28
|
+
<%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %>
|
29
|
+
</div>
|
39
30
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
31
|
+
<% end %>
|
32
|
+
|
33
|
+
<div class="row">
|
34
|
+
<div class="columns">
|
35
|
+
<%= form.date_field :start_date %>
|
36
|
+
</div>
|
44
37
|
|
45
|
-
|
46
|
-
|
47
|
-
|
38
|
+
<div class="columns">
|
39
|
+
<%= form.date_field :end_date %>
|
40
|
+
</div>
|
48
41
|
</div>
|
49
42
|
|
50
|
-
<div class="
|
51
|
-
|
43
|
+
<div class="row">
|
44
|
+
<div class="columns">
|
45
|
+
<%= form.select :decidim_accountability_status_id, statuses.map { |status| [translated_attribute(status.name), status.id, { "data-progress" => status.progress }] }, include_blank: true %>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<div class="columns">
|
49
|
+
<%= form.number_field :progress %>
|
50
|
+
</div>
|
52
51
|
</div>
|
53
|
-
</div>
|
54
52
|
|
55
53
|
<% if Decidim::Accountability.enable_proposal_linking %>
|
56
54
|
<div class="row column">
|
57
|
-
<%= proposals_picker
|
55
|
+
<%= render partial: "decidim/proposals/proposals/proposals_picker", locals: { form:, field: :proposals } %>
|
58
56
|
</div>
|
59
57
|
<% end %>
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
59
|
+
<div class="row column">
|
60
|
+
<% if @form.projects %>
|
61
|
+
<%= form.select :project_ids,
|
62
|
+
@form.projects,
|
63
|
+
{},
|
64
|
+
{ multiple: true, class: "chosen-select" } %>
|
65
|
+
<% end %>
|
66
|
+
</div>
|
69
67
|
|
68
|
+
</div>
|
70
69
|
</div>
|
70
|
+
|
71
71
|
</div>
|
@@ -1,10 +1,21 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
8
|
+
<div class="item__edit item__edit-1col">
|
9
|
+
<div class="item__edit-form">
|
10
|
+
<%= decidim_form_for(@form, html: { class: "form form-defaults edit_result" }) do |f| %>
|
11
|
+
<%= render partial: "form", object: f %>
|
12
|
+
<div class="item__edit-sticky">
|
13
|
+
<div class="item__edit-sticky-container">
|
14
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|
9
20
|
|
10
|
-
<%=
|
21
|
+
<%= append_javascript_pack_tag "decidim_accountability_admin" %>
|