decidim-budgets 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/README.md +1 -1
- data/app/assets/stylesheets/decidim/budgets/budget/_budget-vote-button.scss +5 -5
- data/app/cells/decidim/budgets/base_cell.rb +1 -1
- data/app/cells/decidim/budgets/budget_cell.rb +6 -1
- data/app/cells/decidim/budgets/budget_information_modal/show.erb +14 -26
- data/app/cells/decidim/budgets/budget_list_item/projects_count.erb +6 -0
- data/app/cells/decidim/budgets/budget_list_item/show.erb +35 -30
- data/app/cells/decidim/budgets/budget_list_item/vote_action.erb +13 -0
- data/app/cells/decidim/budgets/budget_list_item_cell.rb +24 -1
- data/app/cells/decidim/budgets/budget_metadata_cell.rb +29 -0
- data/app/cells/decidim/budgets/budget_s_cell.rb +15 -0
- data/app/cells/decidim/budgets/budgets_header/show.erb +2 -6
- data/app/cells/decidim/budgets/budgets_list/card_list.erb +8 -13
- data/app/cells/decidim/budgets/budgets_list/main_list.erb +5 -0
- data/app/cells/decidim/budgets/budgets_list/show.erb +12 -16
- data/app/cells/decidim/budgets/budgets_list/voted.erb +8 -44
- data/app/cells/decidim/budgets/budgets_list_cell.rb +34 -0
- data/app/cells/decidim/budgets/limit_announcement/show.erb +3 -0
- data/app/cells/decidim/budgets/limit_announcement_cell.rb +2 -2
- data/app/cells/decidim/budgets/order_activity_cell.rb +1 -4
- data/app/cells/decidim/budgets/project_cell.rb +6 -1
- data/app/cells/decidim/budgets/project_l/extra_data.erb +6 -0
- data/app/cells/decidim/budgets/project_l/metadata.erb +4 -0
- data/app/cells/decidim/budgets/project_l_cell.rb +38 -0
- data/app/cells/decidim/budgets/project_metadata_cell.rb +78 -0
- data/app/cells/decidim/budgets/project_s_cell.rb +21 -0
- data/app/cells/decidim/budgets/project_tags/show.erb +1 -0
- data/app/cells/decidim/budgets/project_vote_button/show.erb +21 -15
- data/app/cells/decidim/budgets/project_vote_button_cell.rb +69 -1
- data/app/cells/decidim/budgets/project_voted_hint_cell.rb +1 -1
- data/app/cells/decidim/budgets/project_votes_count_cell.rb +9 -8
- data/app/commands/decidim/budgets/admin/create_project.rb +0 -1
- data/app/commands/decidim/budgets/admin/import_proposals_to_budgets.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_project.rb +1 -2
- data/app/commands/decidim/budgets/admin/update_project_scope.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_project_selection.rb +1 -1
- data/app/commands/decidim/budgets/admin/update_projects_budget.rb +57 -0
- data/app/controllers/concerns/decidim/budgets/admin/filterable.rb +1 -1
- data/app/controllers/concerns/decidim/budgets/needs_current_order.rb +2 -2
- data/app/controllers/decidim/budgets/admin/budgets_controller.rb +5 -5
- data/app/controllers/decidim/budgets/admin/projects_controller.rb +52 -10
- data/app/controllers/decidim/budgets/admin/proposals_imports_controller.rb +1 -1
- data/app/controllers/decidim/budgets/application_controller.rb +0 -4
- data/app/controllers/decidim/budgets/budgets_controller.rb +9 -0
- data/app/controllers/decidim/budgets/line_items_controller.rb +10 -16
- data/app/controllers/decidim/budgets/orders_controller.rb +7 -2
- data/app/controllers/decidim/budgets/projects_controller.rb +51 -4
- data/app/forms/decidim/budgets/admin/project_form.rb +1 -1
- data/app/helpers/decidim/budgets/application_helper.rb +4 -0
- data/app/helpers/decidim/budgets/projects_helper.rb +89 -33
- data/app/jobs/decidim/budgets/send_vote_reminder_job.rb +1 -1
- data/app/mailers/decidim/budgets/order_summary_mailer.rb +1 -1
- data/app/mailers/decidim/budgets/vote_reminder_mailer.rb +1 -1
- data/app/models/decidim/budgets/budget.rb +1 -0
- data/app/models/decidim/budgets/project.rb +17 -7
- data/app/packs/entrypoints/decidim_budgets.js +2 -0
- data/app/packs/src/decidim/budgets/exit_handler.js +11 -8
- data/app/packs/src/decidim/budgets/progressFixed.js +25 -11
- data/app/packs/src/decidim/budgets/projects.js +15 -10
- data/app/packs/stylesheets/budgets.scss +273 -0
- data/app/presenters/decidim/budgets/admin_log/budget_presenter.rb +2 -2
- data/app/presenters/decidim/budgets/admin_log/project_presenter.rb +2 -2
- data/app/services/decidim/budgets/order_reminder_generator.rb +4 -4
- data/app/views/decidim/budgets/admin/budgets/_form.html.erb +17 -12
- data/app/views/decidim/budgets/admin/budgets/edit.html.erb +16 -6
- data/app/views/decidim/budgets/admin/budgets/index.html.erb +58 -64
- data/app/views/decidim/budgets/admin/budgets/new.html.erb +16 -6
- data/app/views/decidim/budgets/admin/projects/_bulk-actions.html.erb +19 -10
- data/app/views/decidim/budgets/admin/projects/_form.html.erb +31 -35
- data/app/views/decidim/budgets/admin/projects/_project-tr.html.erb +15 -13
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_budget-change.html.erb +22 -0
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_change-selected.html.erb +3 -3
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_dropdown.html.erb +8 -2
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_recategorize.html.erb +3 -3
- data/app/views/decidim/budgets/admin/projects/bulk_actions/_scope-change.html.erb +5 -8
- data/app/views/decidim/budgets/admin/projects/edit.html.erb +16 -6
- data/app/views/decidim/budgets/admin/projects/index.html.erb +26 -31
- data/app/views/decidim/budgets/admin/projects/new.html.erb +16 -6
- data/app/views/decidim/budgets/admin/projects/update_attribute.js.erb +8 -4
- data/app/views/decidim/budgets/admin/proposals_imports/new.html.erb +40 -28
- data/app/views/decidim/budgets/budgets/index.html.erb +21 -3
- data/app/views/decidim/budgets/budgets/index.js.erb +6 -0
- data/app/views/decidim/budgets/line_items/update_budget.js.erb +21 -11
- data/app/views/decidim/budgets/projects/_addition_selector.html.erb +16 -0
- data/app/views/decidim/budgets/projects/_budget_confirm.html.erb +42 -31
- data/app/views/decidim/budgets/projects/_budget_excess.html.erb +12 -12
- data/app/views/decidim/budgets/projects/_budget_summary.html.erb +2 -75
- data/app/views/decidim/budgets/projects/_exit_modal.html.erb +15 -18
- data/app/views/decidim/budgets/projects/_linked_projects.html.erb +3 -12
- data/app/views/decidim/budgets/projects/_order.html.erb +1 -0
- data/app/views/decidim/budgets/projects/_order_progress_progressbar_marks_right.html.erb +10 -0
- data/app/views/decidim/budgets/projects/_order_progress_summary_content.html.erb +113 -0
- data/app/views/decidim/budgets/projects/_order_total_budget.html.erb +6 -7
- data/app/views/decidim/budgets/projects/_project.html.erb +2 -1
- data/app/views/decidim/budgets/projects/_project_budget_button.html.erb +11 -19
- data/app/views/decidim/budgets/projects/_projects.html.erb +8 -6
- data/app/views/decidim/budgets/projects/_projects_count.html.erb +5 -0
- data/app/views/decidim/budgets/projects/_projects_list.html.erb +3 -0
- data/app/views/decidim/budgets/projects/index.html.erb +58 -55
- data/app/views/decidim/budgets/projects/index.js.erb +5 -4
- data/app/views/decidim/budgets/projects/show.html.erb +78 -51
- data/config/assets.rb +0 -1
- data/config/locales/ar.yml +0 -50
- data/config/locales/bg.yml +0 -381
- data/config/locales/ca.yml +75 -84
- data/config/locales/cs.yml +73 -82
- data/config/locales/de.yml +76 -85
- data/config/locales/el.yml +34 -72
- data/config/locales/en.yml +79 -88
- data/config/locales/es-MX.yml +73 -82
- data/config/locales/es-PY.yml +73 -82
- data/config/locales/es.yml +75 -84
- data/config/locales/eu.yml +74 -86
- data/config/locales/fi-plain.yml +75 -84
- data/config/locales/fi.yml +79 -88
- data/config/locales/fr-CA.yml +74 -86
- data/config/locales/fr.yml +78 -90
- data/config/locales/ga-IE.yml +0 -12
- data/config/locales/gl.yml +0 -58
- data/config/locales/hu.yml +58 -81
- data/config/locales/id-ID.yml +0 -38
- data/config/locales/is-IS.yml +0 -22
- data/config/locales/it.yml +0 -84
- data/config/locales/ja.yml +69 -81
- data/config/locales/ko.yml +0 -54
- data/config/locales/lb.yml +0 -85
- data/config/locales/lt.yml +59 -82
- data/config/locales/lv.yml +0 -44
- data/config/locales/nl.yml +0 -96
- data/config/locales/no.yml +0 -84
- data/config/locales/pl.yml +0 -167
- data/config/locales/pt-BR.yml +9 -141
- data/config/locales/pt.yml +0 -85
- data/config/locales/ro-RO.yml +0 -95
- data/config/locales/ru.yml +0 -41
- data/config/locales/sk.yml +0 -44
- data/config/locales/sq-AL.yml +0 -52
- data/config/locales/sr-CS.yml +0 -4
- data/config/locales/sv.yml +42 -150
- data/config/locales/tr-TR.yml +2 -82
- data/config/locales/uk.yml +0 -41
- data/config/locales/zh-CN.yml +0 -65
- data/config/locales/zh-TW.yml +13 -59
- data/lib/decidim/budgets/admin_engine.rb +3 -2
- data/lib/decidim/budgets/component.rb +4 -90
- data/lib/decidim/budgets/engine.rb +30 -10
- data/lib/decidim/budgets/project_serializer.rb +3 -3
- data/lib/decidim/budgets/seeds.rb +69 -0
- data/lib/decidim/budgets/test/factories.rb +23 -37
- data/lib/decidim/budgets/version.rb +1 -1
- data/lib/decidim/budgets/workflows/base.rb +1 -1
- metadata +46 -42
- data/app/cells/decidim/budgets/budget_m/data.erb +0 -12
- data/app/cells/decidim/budgets/budget_m/footer.erb +0 -5
- data/app/cells/decidim/budgets/budget_m_cell.rb +0 -16
- data/app/cells/decidim/budgets/project_list_item/project_data.erb +0 -19
- data/app/cells/decidim/budgets/project_list_item/project_image.erb +0 -5
- data/app/cells/decidim/budgets/project_list_item/project_text.erb +0 -23
- data/app/cells/decidim/budgets/project_list_item/show.erb +0 -5
- data/app/cells/decidim/budgets/project_list_item_cell.rb +0 -70
- data/app/cells/decidim/budgets/project_m/data.erb +0 -12
- data/app/cells/decidim/budgets/project_m/footer.erb +0 -5
- data/app/cells/decidim/budgets/project_m_cell.rb +0 -22
- data/app/packs/stylesheets/decidim/budgets/_budgets.scss +0 -3
- data/app/packs/stylesheets/decidim/budgets/budget/_budget-list.scss +0 -198
- data/app/packs/stylesheets/decidim/budgets/budget/_budget-meter.scss +0 -83
- data/app/packs/stylesheets/decidim/budgets/budget/_progress.scss +0 -19
- data/app/views/decidim/budgets/admin/projects/proposals_picker.html.erb +0 -1
- data/app/views/decidim/budgets/projects/_filters.html.erb +0 -30
- data/app/views/decidim/budgets/projects/_filters_small_view.html.erb +0 -18
- data/app/views/decidim/budgets/projects/_order_progress.html.erb +0 -32
- data/app/views/decidim/budgets/projects/_order_selected_projects.html.erb +0 -27
- data/config/locales/he-IL.yml +0 -1
- data/decidim-budgets.gemspec +0 -34
- data/lib/decidim/budgets/seeds/city.jpeg +0 -0
@@ -0,0 +1,273 @@
|
|
1
|
+
.budget {
|
2
|
+
&-list__map {
|
3
|
+
@apply md:-ml-16 -mt-6 md:-mt-12 mb-6 aspect-square md:aspect-[21/9] [&>*]:h-full [&+*]:mt-6 md:[&+*]:mt-12;
|
4
|
+
}
|
5
|
+
|
6
|
+
&-summary {
|
7
|
+
@apply bg-tertiary;
|
8
|
+
|
9
|
+
box-shadow: 0 4px 6px 0 rgba(211, 211, 211, 0.25);
|
10
|
+
|
11
|
+
&__content {
|
12
|
+
@apply p-4 md:p-0;
|
13
|
+
}
|
14
|
+
|
15
|
+
&__container {
|
16
|
+
@apply -mt-12 -my-16 mb-8;
|
17
|
+
|
18
|
+
.budget-summary {
|
19
|
+
@apply -ml-16;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
&__content__header {
|
24
|
+
@apply col-span-2 text-2xl mb-2;
|
25
|
+
|
26
|
+
.ql-editor {
|
27
|
+
@apply inline-block text-2xl;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
&__content__header--title {
|
32
|
+
@apply font-semibold;
|
33
|
+
}
|
34
|
+
|
35
|
+
&__content__header--description {
|
36
|
+
@apply text-sm;
|
37
|
+
}
|
38
|
+
|
39
|
+
&__progressbar {
|
40
|
+
@apply my-4 relative;
|
41
|
+
|
42
|
+
.budget-progress {
|
43
|
+
@apply bg-white rounded;
|
44
|
+
}
|
45
|
+
|
46
|
+
&--minimum {
|
47
|
+
@apply absolute;
|
48
|
+
|
49
|
+
.progress-meter--minimum-mark {
|
50
|
+
@apply h-[20px] ml-auto w-[2px] bg-black block;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
&--meter {
|
55
|
+
background-color: var(--success);
|
56
|
+
|
57
|
+
@apply h-[20px] rounded;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
&__progressbar-marks {
|
62
|
+
@apply grid grid-cols-[70%_1fr_1fr] mt-2;
|
63
|
+
}
|
64
|
+
|
65
|
+
&__progressbar-marks_center {
|
66
|
+
@apply text-center -translate-x-2/4;
|
67
|
+
}
|
68
|
+
|
69
|
+
&__progressbar-marks_right {
|
70
|
+
@apply justify-self-end text-left md:text-right;
|
71
|
+
}
|
72
|
+
|
73
|
+
&__progressbar-legend {
|
74
|
+
@apply text-sm block;
|
75
|
+
}
|
76
|
+
|
77
|
+
&__progressbar-legend-strong {
|
78
|
+
@apply font-bold block;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
&__card__list-project {
|
83
|
+
@apply ml-auto rounded py-3 px-6 bg-background w-[30%] min-w-[120px] grid grid-cols-1 md:grid-cols-2 md:place-items-center;
|
84
|
+
}
|
85
|
+
|
86
|
+
&__card__list-project__amount {
|
87
|
+
@apply font-semibold text-gray-2 text-xl inline-block text-center mb-2 md:mb-0;
|
88
|
+
}
|
89
|
+
|
90
|
+
&__card__highlight-vote {
|
91
|
+
@apply justify-center flex flex-col w-full md:w-1/4 bg-background p-4 bg-background font-bold text-gray-2 ml-auto;
|
92
|
+
}
|
93
|
+
|
94
|
+
&__card__highlight-vote__header {
|
95
|
+
@apply place-items-start pb-2;
|
96
|
+
}
|
97
|
+
|
98
|
+
&__card__highlight-vote__text {
|
99
|
+
@apply block text-sm text-gray-2 font-normal;
|
100
|
+
}
|
101
|
+
|
102
|
+
&__card__highlight-vote__number {
|
103
|
+
@apply text-xl font-semibold;
|
104
|
+
}
|
105
|
+
|
106
|
+
&__card__highlight-vote__button {
|
107
|
+
@apply mt-auto text-left mt-2;
|
108
|
+
|
109
|
+
&.button__secondary:hover {
|
110
|
+
@apply text-white #{!important};
|
111
|
+
|
112
|
+
background: rgb(var(--secondary-rgb) / var(--tw-bg-opacity)) !important;
|
113
|
+
}
|
114
|
+
|
115
|
+
&.button__transparent-secondary:hover {
|
116
|
+
@apply border-secondary text-secondary #{!important};
|
117
|
+
|
118
|
+
background: #fff !important;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
&__definition-project__title .ql-editor {
|
123
|
+
@apply text-4xl mb-4;
|
124
|
+
}
|
125
|
+
|
126
|
+
&__definition-data__title {
|
127
|
+
@apply text-sm text-gray-2 mt-6 mb-2 block;
|
128
|
+
}
|
129
|
+
|
130
|
+
&__definition-data__number {
|
131
|
+
@apply text-gray-2 font-bold text-3xl bg-background text-center p-2 rounded;
|
132
|
+
}
|
133
|
+
|
134
|
+
&__filter-title {
|
135
|
+
@apply font-bold mb-4;
|
136
|
+
}
|
137
|
+
|
138
|
+
&__filter__container {
|
139
|
+
@apply my-4 rounded p-2 border-4 border-white;
|
140
|
+
}
|
141
|
+
|
142
|
+
&__list--header {
|
143
|
+
@apply grid grid-cols-2;
|
144
|
+
}
|
145
|
+
|
146
|
+
&-list {
|
147
|
+
.card__list {
|
148
|
+
@apply pr-0;
|
149
|
+
}
|
150
|
+
|
151
|
+
.card__link {
|
152
|
+
@apply mb-2 block;
|
153
|
+
}
|
154
|
+
|
155
|
+
.tag-container {
|
156
|
+
@apply [&:not(:first-child)]:px-6;
|
157
|
+
}
|
158
|
+
|
159
|
+
.card__list-content {
|
160
|
+
@apply w-full cursor-pointer;
|
161
|
+
}
|
162
|
+
|
163
|
+
.project-item {
|
164
|
+
@apply flex gap-4;
|
165
|
+
|
166
|
+
.card__list {
|
167
|
+
@apply inline-block w-[65%];
|
168
|
+
}
|
169
|
+
|
170
|
+
+ .project-item {
|
171
|
+
@apply mt-6;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
#budgets-to-vote {
|
178
|
+
.card__highlight-text {
|
179
|
+
@apply w-full md:w-[70%] p-0;
|
180
|
+
}
|
181
|
+
|
182
|
+
.order-by {
|
183
|
+
@apply mb-8;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
.verification-modal .card__list .budget__card__list-project {
|
188
|
+
@apply inline-block w-[25%] text-center;
|
189
|
+
}
|
190
|
+
|
191
|
+
#budgets.card__highlight-container {
|
192
|
+
@apply mb-0;
|
193
|
+
}
|
194
|
+
|
195
|
+
.progressbox-fixed-wrapper {
|
196
|
+
@apply bg-tertiary fixed hidden inset-x-0 inset-y-0 h-max z-20;
|
197
|
+
|
198
|
+
box-shadow: 0 4px 6px 0 rgba(211, 211, 211, 0.25);
|
199
|
+
}
|
200
|
+
|
201
|
+
.progressbox-fixed-wrapper.is-progressbox-visible {
|
202
|
+
@apply block;
|
203
|
+
}
|
204
|
+
|
205
|
+
#budget-confirm .card__list__project-voted {
|
206
|
+
@apply hover:border-background cursor-default flex-row;
|
207
|
+
|
208
|
+
.card__list-title {
|
209
|
+
@apply cursor-default no-underline;
|
210
|
+
}
|
211
|
+
|
212
|
+
.card__list__content {
|
213
|
+
@apply w-[75%];
|
214
|
+
}
|
215
|
+
}
|
216
|
+
|
217
|
+
.budget-summary__progressbox--checked_out {
|
218
|
+
@apply hidden md:block;
|
219
|
+
}
|
220
|
+
|
221
|
+
.budget-summary__content {
|
222
|
+
@apply md:grid md:grid-cols-12 md:items-center md:px-16 pt-4 px-4;
|
223
|
+
}
|
224
|
+
|
225
|
+
.budget-summary__progressbox {
|
226
|
+
@apply md:col-span-8;
|
227
|
+
}
|
228
|
+
|
229
|
+
.budget-summary__progressbox-buttons {
|
230
|
+
@apply md:col-span-3 md:col-start-10;
|
231
|
+
}
|
232
|
+
|
233
|
+
.budget-summary__button-modal {
|
234
|
+
@apply col-span-12 mb-4 pb-4;
|
235
|
+
}
|
236
|
+
|
237
|
+
.progressbox-fixed-wrapper {
|
238
|
+
.budget-summary__progressbar {
|
239
|
+
@apply md:pl-32 md:pr-8;
|
240
|
+
}
|
241
|
+
|
242
|
+
.budget-summary__progressbox {
|
243
|
+
@apply md:col-span-5 md:col-start-4;
|
244
|
+
}
|
245
|
+
|
246
|
+
.budget-summary__progressbox-buttons {
|
247
|
+
@apply md:col-start-10 md:col-span-2;
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
#project-item {
|
252
|
+
.budget-summary__content {
|
253
|
+
@apply py-4 md:py-4 md:container md:grid grid-cols-1 md:grid-cols-12 md:items-center;
|
254
|
+
}
|
255
|
+
|
256
|
+
.budget-summary__progressbox {
|
257
|
+
@apply md:col-start-2 md:col-span-7 relative;
|
258
|
+
}
|
259
|
+
|
260
|
+
.budget-summary__progressbox-buttons {
|
261
|
+
@apply md:col-start-10 md:col-span-2;
|
262
|
+
}
|
263
|
+
|
264
|
+
.budget-summary__button-modal {
|
265
|
+
@apply col-span-10 col-start-2 justify-start;
|
266
|
+
}
|
267
|
+
|
268
|
+
.progressbox-fixed-wrapper {
|
269
|
+
.budget-summary__progressbar {
|
270
|
+
@apply md:col-start-1 md:col-span-7;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
}
|
@@ -6,8 +6,8 @@ module Decidim
|
|
6
6
|
# This class holds the logic to present a `Decidim::Budgets::Budget`
|
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::Budgets::Project``
|
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
|
@@ -31,12 +31,12 @@ module Decidim
|
|
31
31
|
attr_reader :reminder_manifest
|
32
32
|
|
33
33
|
def send_reminders(component)
|
34
|
-
budgets = Decidim::Budgets::Budget.where(component:
|
34
|
+
budgets = Decidim::Budgets::Budget.where(component:)
|
35
35
|
pending_orders = Decidim::Budgets::Order.where(budget: budgets, checked_out_at: nil)
|
36
36
|
users = Decidim::User.where(id: pending_orders.pluck(:decidim_user_id).uniq)
|
37
37
|
users.each do |user|
|
38
|
-
reminder = Decidim::Reminder.find_or_create_by(user
|
39
|
-
users_pending_orders = pending_orders.where(user:
|
38
|
+
reminder = Decidim::Reminder.find_or_create_by(user:, component:)
|
39
|
+
users_pending_orders = pending_orders.where(user:)
|
40
40
|
update_reminder_records(reminder, users_pending_orders)
|
41
41
|
if reminder.records.active.any?
|
42
42
|
Decidim::Budgets::SendVoteReminderJob.perform_later(reminder)
|
@@ -61,7 +61,7 @@ module Decidim
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def add_pending_orders(reminder, users_pending_orders)
|
64
|
-
reminder.records << users_pending_orders.map { |order| Decidim::ReminderRecord.find_or_create_by(reminder
|
64
|
+
reminder.records << users_pending_orders.map { |order| Decidim::ReminderRecord.find_or_create_by(reminder:, remindable: order) }
|
65
65
|
return @alternative_refresh_state.call(reminder) if @alternative_refresh_state.present?
|
66
66
|
|
67
67
|
reminder.records.each do |record|
|
@@ -1,23 +1,28 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<div class="row column">
|
8
|
-
<%= form.translated :text_field, :title, autofocus: true %>
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card pt-4">
|
3
|
+
<div class="card-section">
|
4
|
+
<div class="row column">
|
5
|
+
<%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
|
6
|
+
</div>
|
9
7
|
|
10
|
-
|
8
|
+
<div class="row column">
|
9
|
+
<%= form.number_field :weight %>
|
10
|
+
</div>
|
11
11
|
|
12
|
-
|
12
|
+
<div class="row column">
|
13
|
+
<%= form.translated :editor, :description, toolbar: :content, aria: { label: :description } %>
|
14
|
+
</div>
|
13
15
|
|
14
|
-
|
16
|
+
<div class="row column">
|
17
|
+
<%= form.number_field :total_budget %>
|
18
|
+
</div>
|
15
19
|
|
16
20
|
<% if current_component.has_subscopes? %>
|
17
21
|
<div class="row column">
|
18
|
-
<%=
|
22
|
+
<%= scopes_select_field form, :decidim_scope_id, root: current_component.scope %>
|
19
23
|
</div>
|
20
24
|
<% end %>
|
25
|
+
</div>
|
21
26
|
</div>
|
22
27
|
</div>
|
23
28
|
</div>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form edit_budget" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
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
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|
@@ -1,75 +1,69 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
<div class="card
|
3
|
-
<div class="
|
4
|
-
<h2 class="
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<% end %>
|
15
|
-
<div id="js-other-actions-wrapper">
|
16
|
-
<%= link_to t("actions.new", scope: "decidim.budgets", name: t("models.budget.name", scope: "decidim.budgets.admin")), new_budget_path, class: "button tiny button--title" if allowed_to? :create, :budget %>
|
17
|
-
</div>
|
2
|
+
<div class="card">
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h2 class="item_show__header-title">
|
5
|
+
<%= t(".title") %>
|
6
|
+
<% if allowed_to? :export, :budget %>
|
7
|
+
<%= export_dropdown %>
|
8
|
+
<% end %>
|
9
|
+
<% if allowed_to? :remind, :order %>
|
10
|
+
<%= link_to t("actions.send_voting_reminders", scope: "decidim.budgets"), admin_reminders_path(current_component, name: "orders"), class: "button button__sm button__secondary" %>
|
11
|
+
<% end %>
|
12
|
+
<div id="js-other-actions-wrapper">
|
13
|
+
<%= link_to t("actions.new_budget", scope: "decidim.budgets"), new_budget_path, class: "button button__sm button__secondary" if allowed_to? :create, :budget %>
|
18
14
|
</div>
|
15
|
+
<%= render partial: "decidim/admin/components/resource_action" %>
|
19
16
|
</h2>
|
20
17
|
</div>
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
18
|
+
<div class="table-scroll">
|
19
|
+
<table class="table-list">
|
20
|
+
<thead>
|
21
|
+
<tr>
|
22
|
+
<th><%= t("models.budget.fields.name", scope: "decidim.budgets") %></th>
|
23
|
+
<th><%= t("models.budget.fields.total_budget", scope: "decidim.budgets") %></th>
|
24
|
+
<th><%= t("models.budget.fields.projects_count", scope: "decidim.budgets") %></th>
|
25
|
+
<%= th_resource_scope_label %>
|
26
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.budgets") %></th>
|
27
|
+
</tr>
|
28
|
+
</thead>
|
29
|
+
<tbody>
|
30
|
+
<% budgets.each do |budget| %>
|
31
|
+
<tr data-id="<%= budget.id %>">
|
32
|
+
<td>
|
33
|
+
<% if allowed_to? :update, :budget, budget: budget %>
|
34
|
+
<%= link_to translated_attribute(budget.title), budget_projects_path(budget) %><br>
|
35
|
+
<% else %>
|
36
|
+
<%= translated_attribute(budget.title) %>
|
37
|
+
<% end %>
|
38
|
+
</td>
|
39
|
+
<td>
|
40
|
+
<%= number_to_currency budget.total_budget, unit: Decidim.currency_unit, precision: 0 %>
|
41
|
+
</td>
|
42
|
+
<td>
|
43
|
+
<%= link_to budget.projects.count, budget_projects_path(budget) %>
|
44
|
+
</td>
|
45
|
+
<%= td_resource_scope_for(budget.scope) %>
|
46
|
+
<td class="table-list__actions">
|
47
|
+
<% if allowed_to? :update, :budget, budget: budget %>
|
48
|
+
<%= icon_link_to "pencil-line", edit_budget_path(budget), t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
49
|
+
<% else %>
|
50
|
+
<%= icon "pencil-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.edit", scope: "decidim.budgets") %>
|
50
51
|
<% end %>
|
51
|
-
<td class="table-list__actions">
|
52
|
-
<%= icon_link_to "eye", resource_locator(budget).path, t("actions.preview", scope: "decidim.budgets"), class: "action-icon--preview", target: :blank %>
|
53
52
|
|
54
|
-
|
53
|
+
<%= icon_link_to "list-check", budget_projects_path(budget), t("actions.edit_projects", scope: "decidim.budgets"), class: "action-icon--edit-projects" %>
|
55
54
|
|
56
|
-
|
57
|
-
<%= icon_link_to "pencil", edit_budget_path(budget), t("actions.edit", scope: "decidim.budgets"), class: "action-icon--edit" %>
|
58
|
-
<% else %>
|
59
|
-
<%= icon "pencil", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.edit", scope: "decidim.budgets") %>
|
60
|
-
<% end %>
|
55
|
+
<%= icon_link_to "eye-line", resource_locator(budget).path, t("actions.preview", scope: "decidim.budgets"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %>
|
61
56
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
</div>
|
57
|
+
<% if allowed_to? :delete, :budget, budget: budget %>
|
58
|
+
<%= icon_link_to "delete-bin-line", budget_path(budget), t("actions.destroy", scope: "decidim.budgets"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.budgets") } %>
|
59
|
+
<% else %>
|
60
|
+
<%= icon "delete-bin-line", class: "action-icon action-icon--disabled", role: "img", aria_label: t("actions.destroy", scope: "decidim.budgets") %>
|
61
|
+
<% end %>
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
<% end %>
|
65
|
+
</tbody>
|
66
|
+
</table>
|
73
67
|
</div>
|
74
68
|
<div class="card-divider">
|
75
69
|
<strong><%= t ".finished_orders" %>: </strong><span><%= finished_orders.count %></span>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form new_budget" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
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 %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|
@@ -1,13 +1,22 @@
|
|
1
|
-
<div class="flex
|
2
|
-
|
1
|
+
<div class="flex items-center gap-x-4">
|
2
|
+
<div class="bulk-actions-budgets">
|
3
|
+
<%= render partial: "decidim/budgets/admin/projects/bulk_actions/dropdown" %>
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
5
|
+
<%= render partial: "decidim/budgets/admin/projects/bulk_actions/recategorize" %>
|
6
|
+
<%= render partial: "decidim/budgets/admin/projects/bulk_actions/scope-change" %>
|
7
|
+
<%= render partial: "decidim/budgets/admin/projects/bulk_actions/change-selected" %>
|
8
|
+
<%= render partial: "decidim/budgets/admin/projects/bulk_actions/budget-change" %>
|
7
9
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
<% if allowed_to? :export, :budget %>
|
11
|
+
<%= export_dropdowns(query, current_component, budget.id) %>
|
12
|
+
<% end %>
|
13
|
+
<% if allowed_to? :import_proposals, :project %>
|
14
|
+
<%= import_dropdown do %>
|
15
|
+
<li class="imports--component">
|
16
|
+
<%= link_to t("actions.import", scope: "decidim.budgets", name: t("models.project.name", scope: "decidim.budgets.admin")), new_budget_proposals_import_path(budget) %>
|
17
|
+
</li>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
<%= link_to t("actions.new_project", scope: "decidim.budgets"), new_budget_project_path, class: "button button__sm button__secondary new" if allowed_to? :create, :project %>
|
21
|
+
</div>
|
13
22
|
</div>
|