decidim-accountability 0.27.5 → 0.28.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/accountability/content_blocks/highlighted_results_cell.rb +3 -8
  3. data/app/cells/decidim/accountability/highlighted_results/show.erb +3 -1
  4. data/app/cells/decidim/accountability/highlighted_results_for_component/show.erb +19 -19
  5. data/app/cells/decidim/accountability/highlighted_results_for_component_cell.rb +29 -6
  6. data/app/cells/decidim/accountability/project/show.erb +11 -0
  7. data/app/cells/decidim/accountability/project/timeline.erb +22 -0
  8. data/app/cells/decidim/accountability/project_cell.rb +75 -0
  9. data/app/cells/decidim/accountability/result_activity_cell.rb +1 -4
  10. data/app/cells/decidim/accountability/result_card_cell.rb +21 -0
  11. data/app/cells/decidim/accountability/result_cell.rb +2 -2
  12. data/app/cells/decidim/accountability/result_l/extra_data.erb +3 -0
  13. data/app/cells/decidim/accountability/result_l_cell.rb +30 -0
  14. data/app/cells/decidim/accountability/result_metadata/project_aside.erb +6 -0
  15. data/app/cells/decidim/accountability/result_metadata/show_footer.erb +11 -0
  16. data/app/cells/decidim/accountability/result_metadata/versions.erb +1 -0
  17. data/app/cells/decidim/accountability/result_metadata_cell.rb +136 -0
  18. data/app/cells/decidim/accountability/results/show.erb +7 -0
  19. data/app/cells/decidim/accountability/results_cell.rb +14 -0
  20. data/app/cells/decidim/accountability/status/show.erb +9 -0
  21. data/app/cells/decidim/accountability/status/status.erb +16 -0
  22. data/app/cells/decidim/accountability/status_cell.rb +91 -0
  23. data/app/commands/decidim/accountability/admin/import_projects_to_accountability.rb +37 -0
  24. data/app/controllers/concerns/decidim/accountability/admin/filterable.rb +2 -2
  25. data/app/controllers/decidim/accountability/admin/import_results_controller.rb +18 -6
  26. data/app/controllers/decidim/accountability/admin/projects_import_controller.rb +31 -0
  27. data/app/controllers/decidim/accountability/admin/results_controller.rb +4 -5
  28. data/app/controllers/decidim/accountability/admin/statuses_controller.rb +3 -3
  29. data/app/controllers/decidim/accountability/admin/timeline_entries_controller.rb +3 -3
  30. data/app/controllers/decidim/accountability/results_controller.rb +20 -2
  31. data/app/forms/decidim/accountability/admin/import_results_form.rb +22 -0
  32. data/app/forms/decidim/accountability/admin/result_import_projects_form.rb +51 -0
  33. data/app/helpers/decidim/accountability/admin/application_helper.rb +1 -0
  34. data/app/helpers/decidim/accountability/application_helper.rb +43 -2
  35. data/app/helpers/decidim/accountability/breadcrumb_helper.rb +10 -0
  36. data/app/jobs/decidim/accountability/admin/import_projects_job.rb +72 -0
  37. data/app/mailers/decidim/accountability/import_projects_mailer.rb +25 -0
  38. data/app/models/decidim/accountability/result.rb +1 -1
  39. data/app/packs/entrypoints/decidim_accountability.js +4 -1
  40. data/app/packs/entrypoints/decidim_accountability_admin_imports.js +3 -0
  41. data/app/packs/images/decidim/accountability/breadcrumb_arrow.svg +3 -0
  42. data/app/packs/src/decidim/accountability/admin/imports.js +15 -0
  43. data/app/packs/stylesheets/accountability.scss +169 -0
  44. data/app/permissions/decidim/accountability/admin/permissions.rb +17 -6
  45. data/app/presenters/decidim/accountability/admin_log/result_presenter.rb +2 -2
  46. data/app/presenters/decidim/accountability/admin_log/status_presenter.rb +2 -2
  47. data/app/presenters/decidim/accountability/admin_log/timeline_entry_presenter.rb +2 -2
  48. data/app/queries/decidim/accountability/metrics/results_metric_manage.rb +1 -1
  49. data/app/services/decidim/accountability/results_calculator.rb +1 -1
  50. data/app/services/decidim/accountability/results_csv_importer.rb +2 -2
  51. data/app/views/decidim/accountability/admin/import_results/new.html.erb +27 -23
  52. data/app/views/decidim/accountability/admin/projects_import/new.html.erb +45 -0
  53. data/app/views/decidim/accountability/admin/results/_form.html.erb +46 -46
  54. data/app/views/decidim/accountability/admin/results/edit.html.erb +18 -7
  55. data/app/views/decidim/accountability/admin/results/index.html.erb +102 -91
  56. data/app/views/decidim/accountability/admin/results/new.html.erb +18 -8
  57. data/app/views/decidim/accountability/admin/shared/_subnav.html.erb +1 -1
  58. data/app/views/decidim/accountability/admin/statuses/_form.html.erb +15 -17
  59. data/app/views/decidim/accountability/admin/statuses/edit.html.erb +16 -6
  60. data/app/views/decidim/accountability/admin/statuses/index.html.erb +33 -36
  61. data/app/views/decidim/accountability/admin/statuses/new.html.erb +16 -6
  62. data/app/views/decidim/accountability/admin/timeline_entries/_form.html.erb +12 -14
  63. data/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb +17 -6
  64. data/app/views/decidim/accountability/admin/timeline_entries/index.html.erb +35 -34
  65. data/app/views/decidim/accountability/admin/timeline_entries/new.html.erb +17 -6
  66. data/app/views/decidim/accountability/import_projects_mailer/import.html.erb +2 -0
  67. data/app/views/decidim/accountability/results/_home_categories.html.erb +28 -73
  68. data/app/views/decidim/accountability/results/_linked_results.html.erb +3 -12
  69. data/app/views/decidim/accountability/results/_project.html.erb +29 -0
  70. data/app/views/decidim/accountability/results/_projects_aside.html.erb +40 -0
  71. data/app/views/decidim/accountability/results/_scope_filters.html.erb +27 -27
  72. data/app/views/decidim/accountability/results/_search.html.erb +15 -9
  73. data/app/views/decidim/accountability/results/_stats_box.html.erb +3 -3
  74. data/app/views/decidim/accountability/results/home.html.erb +34 -8
  75. data/app/views/decidim/accountability/results/index.html.erb +15 -15
  76. data/app/views/decidim/accountability/results/index.js.erb +3 -0
  77. data/app/views/decidim/accountability/results/show.html.erb +9 -10
  78. data/app/views/decidim/accountability/versions/show.html.erb +12 -9
  79. data/app/views/decidim/participatory_spaces/_result.html.erb +2 -2
  80. data/config/assets.rb +2 -2
  81. data/config/locales/ar.yml +22 -60
  82. data/config/locales/bg.yml +0 -36
  83. data/config/locales/ca.yml +53 -30
  84. data/config/locales/cs.yml +58 -29
  85. data/config/locales/da.yml +0 -36
  86. data/config/locales/de.yml +59 -36
  87. data/config/locales/el.yml +62 -29
  88. data/config/locales/en.yml +55 -31
  89. data/config/locales/es-MX.yml +52 -29
  90. data/config/locales/es-PY.yml +52 -29
  91. data/config/locales/es.yml +53 -30
  92. data/config/locales/eu.yml +53 -30
  93. data/config/locales/fi-plain.yml +51 -28
  94. data/config/locales/fi.yml +52 -29
  95. data/config/locales/fr-CA.yml +51 -28
  96. data/config/locales/fr.yml +52 -29
  97. data/config/locales/ga-IE.yml +0 -4
  98. data/config/locales/gl.yml +0 -41
  99. data/config/locales/hu.yml +41 -29
  100. data/config/locales/id-ID.yml +0 -30
  101. data/config/locales/is-IS.yml +0 -32
  102. data/config/locales/it.yml +0 -41
  103. data/config/locales/ja.yml +55 -39
  104. data/config/locales/kaa.yml +20 -1
  105. data/config/locales/ko.yml +0 -15
  106. data/config/locales/lb.yml +0 -41
  107. data/config/locales/lt.yml +60 -41
  108. data/config/locales/lv.yml +0 -36
  109. data/config/locales/nl.yml +0 -41
  110. data/config/locales/no.yml +8 -49
  111. data/config/locales/pl.yml +17 -40
  112. data/config/locales/pt-BR.yml +41 -29
  113. data/config/locales/pt.yml +0 -41
  114. data/config/locales/ro-RO.yml +14 -39
  115. data/config/locales/ru.yml +0 -30
  116. data/config/locales/si-LK.yml +0 -3
  117. data/config/locales/sk.yml +0 -40
  118. data/config/locales/sl.yml +0 -11
  119. data/config/locales/sq-AL.yml +82 -7
  120. data/config/locales/sr-CS.yml +0 -30
  121. data/config/locales/sv.yml +23 -38
  122. data/config/locales/tr-TR.yml +9 -62
  123. data/config/locales/uk.yml +0 -28
  124. data/config/locales/zh-CN.yml +0 -36
  125. data/config/locales/zh-TW.yml +52 -43
  126. data/lib/decidim/accountability/admin_engine.rb +3 -2
  127. data/lib/decidim/accountability/component.rb +4 -99
  128. data/lib/decidim/accountability/engine.rb +9 -1
  129. data/lib/decidim/accountability/result_serializer.rb +1 -1
  130. data/lib/decidim/accountability/seeds.rb +115 -0
  131. data/lib/decidim/accountability/test/factories.rb +3 -2
  132. data/lib/decidim/accountability/version.rb +1 -1
  133. metadata +61 -48
  134. data/app/cells/decidim/accountability/content_blocks/highlighted_results/elements.erb +0 -5
  135. data/app/cells/decidim/accountability/content_blocks/highlighted_results/heading.erb +0 -1
  136. data/app/cells/decidim/accountability/result_m/data.erb +0 -23
  137. data/app/cells/decidim/accountability/result_m/footer.erb +0 -22
  138. data/app/cells/decidim/accountability/result_m/tags.erb +0 -1
  139. data/app/cells/decidim/accountability/result_m_cell.rb +0 -37
  140. data/app/packs/stylesheets/decidim/accountability/_accountability.scss +0 -4
  141. data/app/packs/stylesheets/decidim/accountability/accountability/_cards.scss +0 -11
  142. data/app/packs/stylesheets/decidim/accountability/accountability/_categories.scss +0 -121
  143. data/app/packs/stylesheets/decidim/accountability/accountability/_lines_breadcrumb.scss +0 -37
  144. data/app/packs/stylesheets/decidim/accountability/accountability/_results.scss +0 -148
  145. data/app/views/decidim/accountability/admin/results/proposals_picker.html.erb +0 -1
  146. data/app/views/decidim/accountability/result_widgets/show.html.erb +0 -2
  147. data/app/views/decidim/accountability/results/_home_header.html.erb +0 -23
  148. data/app/views/decidim/accountability/results/_results_leaf.html.erb +0 -47
  149. data/app/views/decidim/accountability/results/_results_parent.html.erb +0 -32
  150. data/app/views/decidim/accountability/results/_show_leaf.html.erb +0 -81
  151. data/app/views/decidim/accountability/results/_show_parent.html.erb +0 -30
  152. data/app/views/decidim/accountability/results/_stats.html.erb +0 -15
  153. data/app/views/decidim/accountability/results/_timeline.html.erb +0 -30
  154. data/app/views/decidim/accountability/versions/index.html.erb +0 -12
  155. data/config/environment.rb +0 -3
@@ -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.action
36
- when :create, :create_children
37
- true
38
- when :update, :destroy
39
- resource.present?
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
- false
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 shouldn't need to call this class
10
- # directly, but here's an example:
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 shouldn't need to call this class
10
- # directly, but here's an example:
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 shouldn't need to call this class
10
- # directly, but here's an example:
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: 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
@@ -25,7 +25,7 @@ module Decidim
25
25
  @results ||= begin
26
26
  query = Result.where(
27
27
  parent_id: nil,
28
- component: component
28
+ component:
29
29
  )
30
30
  query = query.with_any_scope(scope_id) if scope_id
31
31
  query = query.with_any_category(category_id) if category_id
@@ -20,7 +20,7 @@ module Decidim
20
20
  @extra_context = {
21
21
  current_component: component,
22
22
  current_organization: component.organization,
23
- current_user: 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
- <%= form_tag(import_results_path, multipart: true, class: "form new_import") do %>
3
- <div class="card">
4
- <div class="card-divider">
5
- <h2 class="card-title">
6
- <%= t(".title") %>
7
- </h2>
8
- </div>
9
-
10
- <div class="card-section">
11
- <div class="mb-s">
12
- <p><%= t(".info",
13
- link_new_status: new_status_path,
14
- link_new_result: new_result_path,
15
- link_export_csv: link_to(t(".download_export"),exports_path(current_component, id: "results", format: "CSV"), method: :post)
16
- ).try("html_safe") %></p>
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="row column">
19
- <%= file_field_tag :csv_file %>
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
- </div>
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="card">
2
- <div class="card-divider">
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
- <% if @form.parent_id %>
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.select :parent_id, parent_results.map{|result| [translated_attribute(result.title), result.id] }, include_blank: true %>
10
+ <%= form.translated :editor, :description, aria: { label: :description } %>
19
11
  </div>
20
12
 
21
- <% else %>
13
+ <% if @form.parent_id %>
22
14
 
23
- <% if current_component.has_subscopes? %>
24
15
  <div class="row column">
25
- <%= scopes_picker_field form, :decidim_scope_id, root: current_component.scope %>
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
- <div class="row column">
30
- <%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: true, disable_parents: false %>
31
- </div>
19
+ <% else %>
32
20
 
33
- <% end %>
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
- <div class="row">
36
- <div class="columns xlarge-6">
37
- <%= form.date_field :start_date %>
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
- <div class="columns xlarge-6">
41
- <%= form.date_field :end_date %>
42
- </div>
43
- </div>
31
+ <% end %>
32
+
33
+ <div class="row">
34
+ <div class="columns">
35
+ <%= form.date_field :start_date %>
36
+ </div>
44
37
 
45
- <div class="row">
46
- <div class="columns xlarge-6">
47
- <%= form.select :decidim_accountability_status_id, statuses.map{|status| [translated_attribute(status.name), status.id, { "data-progress" => status.progress }] }, include_blank: true %>
38
+ <div class="columns">
39
+ <%= form.date_field :end_date %>
40
+ </div>
48
41
  </div>
49
42
 
50
- <div class="columns xlarge-6">
51
- <%= form.number_field :progress %>
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(form, :proposals, proposals_picker_results_path) %>
55
+ <%= render partial: "decidim/proposals/proposals/proposals_picker", locals: { form:, field: :proposals } %>
58
56
  </div>
59
57
  <% end %>
60
58
 
61
- <div class="row column">
62
- <% if @form.projects %>
63
- <%= form.select :project_ids,
64
- @form.projects,
65
- {},
66
- { multiple: true, class: "chosen-select" } %>
67
- <% end %>
68
- </div>
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
- <%= decidim_form_for(@form, html: { class: "form edit_result" }) do |f| %>
3
- <%= render partial: "form", object: f, locals: { title: t(".title") } %>
2
+ <div class="item_show__header">
3
+ <h2 class="item_show__header-title">
4
+ <%= t(".title") %>
5
+ </h2>
6
+ </div>
4
7
 
5
- <div class="button--double form-general-submit">
6
- <%= f.submit t(".update") %>
7
- </div>
8
- <% end %>
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
- <%= javascript_pack_tag "decidim_accountability_admin" %>
21
+ <%= append_javascript_pack_tag "decidim_accountability_admin" %>