decidim-admin 0.20.1 → 0.23.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-admin might be problematic. Click here for more details.

Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +13 -0
  3. data/app/assets/javascripts/decidim/admin/application.js.es6 +8 -0
  4. data/app/assets/javascripts/decidim/admin/budget_rule_toggler.component.js.es6 +52 -0
  5. data/app/assets/javascripts/decidim/admin/bundle.js +26 -32
  6. data/app/assets/javascripts/decidim/admin/bundle.js.map +1 -1
  7. data/app/assets/javascripts/decidim/admin/choose_language.js +12 -0
  8. data/app/assets/javascripts/decidim/admin/dynamic_fields.component.js.es6 +24 -5
  9. data/app/assets/javascripts/decidim/admin/form.js.es6 +24 -10
  10. data/app/assets/javascripts/decidim/admin/gallery.js.es6 +5 -0
  11. data/app/assets/javascripts/decidim/admin/newsletters.js.es6 +12 -0
  12. data/app/assets/javascripts/decidim/admin/officializations.js.es6 +20 -0
  13. data/app/assets/javascripts/decidim/admin/scope_picker_enabler.component.js.es6 +14 -0
  14. data/app/assets/stylesheets/decidim/admin/_decidim.scss +2 -0
  15. data/app/assets/stylesheets/decidim/admin/_variables.scss +2 -2
  16. data/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss +6 -0
  17. data/app/assets/stylesheets/decidim/admin/extra/_cards.scss +11 -0
  18. data/app/assets/stylesheets/decidim/admin/extra/_newsletter-templates-gallery.scss +3 -0
  19. data/app/assets/stylesheets/decidim/admin/extra/_organization-appearance.scss +141 -0
  20. data/app/assets/stylesheets/decidim/admin/extra/_show_email.scss +31 -0
  21. data/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +4 -0
  22. data/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +15 -1
  23. data/app/assets/stylesheets/decidim/admin/modules/_callouts.scss +11 -0
  24. data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +13 -2
  25. data/app/assets/stylesheets/decidim/admin/modules/_filters.scss +78 -1
  26. data/app/assets/stylesheets/decidim/admin/modules/_forms.scss +16 -2
  27. data/app/assets/stylesheets/decidim/admin/modules/_import_result.scss +10 -0
  28. data/app/assets/stylesheets/decidim/admin/modules/_layout.scss +1 -1
  29. data/app/assets/stylesheets/decidim/admin/modules/_loading-spinner.scss +19 -0
  30. data/app/assets/stylesheets/decidim/admin/modules/_main-nav.scss +0 -1
  31. data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +5 -1
  32. data/app/assets/stylesheets/decidim/admin/modules/_process-header.scss +0 -1
  33. data/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +5 -2
  34. data/app/assets/stylesheets/decidim/admin/modules/_table-list.scss +23 -7
  35. data/app/assets/stylesheets/decidim/admin/modules/_tabs.scss +7 -0
  36. data/app/assets/stylesheets/decidim/admin/modules/_users_statistics.scss +18 -0
  37. data/app/assets/stylesheets/decidim/admin/utils/_mixins.scss +42 -0
  38. data/app/assets/stylesheets/decidim/admin/utils/_settings.scss +4 -1
  39. data/app/cells/decidim/admin/content_block/show.erb +2 -2
  40. data/app/cells/decidim/admin/results_per_page/show.erb +16 -0
  41. data/app/cells/decidim/admin/results_per_page_cell.rb +14 -0
  42. data/app/commands/decidim/admin/create_attachment.rb +2 -2
  43. data/app/commands/decidim/admin/create_newsletter.rb +34 -9
  44. data/app/commands/decidim/admin/deliver_newsletter.rb +1 -1
  45. data/app/commands/decidim/admin/destroy_share_token.rb +46 -0
  46. data/app/commands/decidim/admin/reorder_content_blocks.rb +1 -1
  47. data/app/commands/decidim/admin/update_component.rb +27 -3
  48. data/app/commands/decidim/admin/update_content_block.rb +25 -1
  49. data/app/commands/decidim/admin/update_newsletter.rb +31 -9
  50. data/app/commands/decidim/admin/update_organization.rb +15 -1
  51. data/app/commands/decidim/admin/update_organization_appearance.rb +3 -1
  52. data/app/controllers/concerns/decidim/admin/filterable.rb +152 -0
  53. data/app/controllers/concerns/decidim/admin/officializations/filterable.rb +31 -0
  54. data/app/controllers/concerns/decidim/admin/paginable.rb +20 -0
  55. data/app/controllers/concerns/decidim/admin/participatory_space_export.rb +8 -2
  56. data/app/controllers/decidim/admin/admin_terms_controller.rb +20 -0
  57. data/app/controllers/decidim/admin/application_controller.rb +3 -0
  58. data/app/controllers/decidim/admin/authorization_workflows_controller.rb +6 -0
  59. data/app/controllers/decidim/admin/components/base_controller.rb +5 -1
  60. data/app/controllers/decidim/admin/components_controller.rb +30 -23
  61. data/app/controllers/decidim/admin/concerns/has_private_users.rb +4 -0
  62. data/app/controllers/decidim/admin/dashboard_controller.rb +33 -1
  63. data/app/controllers/decidim/admin/metrics_controller.rb +22 -0
  64. data/app/controllers/decidim/admin/newsletter_templates_controller.rb +41 -0
  65. data/app/controllers/decidim/admin/newsletters_controller.rb +43 -4
  66. data/app/controllers/decidim/admin/officializations_controller.rb +15 -6
  67. data/app/controllers/decidim/admin/organization_appearance_controller.rb +1 -0
  68. data/app/controllers/decidim/admin/organization_controller.rb +4 -3
  69. data/app/controllers/decidim/admin/organization_homepage_content_blocks_controller.rb +2 -1
  70. data/app/controllers/decidim/admin/share_tokens_controller.rb +30 -0
  71. data/app/forms/decidim/admin/attachment_form.rb +3 -0
  72. data/app/forms/decidim/admin/component_form.rb +5 -22
  73. data/app/forms/decidim/admin/newsletter_form.rb +15 -3
  74. data/app/forms/decidim/admin/organization_appearance_form.rb +7 -4
  75. data/app/forms/decidim/admin/organization_form.rb +27 -0
  76. data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +14 -0
  77. data/app/forms/decidim/admin/participatory_space_private_user_form.rb +8 -2
  78. data/app/frontend/components/autocomplete.component.test.tsx +2 -1
  79. data/app/frontend/components/autocomplete.component.tsx +29 -0
  80. data/app/helpers/decidim/admin/admin_terms_helper.rb +47 -0
  81. data/app/helpers/decidim/admin/application_helper.rb +2 -0
  82. data/app/helpers/decidim/admin/dashboard_helper.rb +25 -0
  83. data/app/helpers/decidim/admin/filterable_helper.rb +129 -0
  84. data/app/helpers/decidim/admin/icon_link_helper.rb +1 -1
  85. data/app/helpers/decidim/admin/newsletters_helper.rb +20 -0
  86. data/app/helpers/decidim/admin/paginable/per_page_helper.rb +22 -0
  87. data/app/helpers/decidim/admin/resource_scope_helper.rb +43 -0
  88. data/app/helpers/decidim/admin/scopes_helper.rb +6 -0
  89. data/app/helpers/decidim/admin/settings_helper.rb +56 -47
  90. data/app/helpers/decidim/admin/uploader_image_dimensions_helper.rb +30 -0
  91. data/app/helpers/decidim/admin/user_roles_helper.rb +19 -0
  92. data/app/models/decidim/admin/fake_newsletter.rb +49 -0
  93. data/app/permissions/decidim/admin/permissions.rb +30 -7
  94. data/app/presenters/decidim/admin/dashboard_metric_charts_presenter.rb +57 -0
  95. data/app/queries/decidim/admin/active_users_counter.rb +35 -0
  96. data/app/queries/decidim/admin/newsletter_recipients.rb +20 -9
  97. data/app/views/decidim/admin/admin_terms/show.html.erb +26 -0
  98. data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
  99. data/app/views/decidim/admin/authorization_workflows/index.html.erb +1 -0
  100. data/app/views/decidim/admin/categories/index.html.erb +1 -1
  101. data/app/views/decidim/admin/components/_component.html.erb +40 -33
  102. data/app/views/decidim/admin/components/_form.html.erb +4 -0
  103. data/app/views/decidim/admin/components/_settings_fields.html.erb +2 -2
  104. data/app/views/decidim/admin/components/index.html.erb +11 -8
  105. data/app/views/decidim/admin/dashboard/show.html.erb +49 -9
  106. data/app/views/decidim/admin/exports/_dropdown.html.erb +6 -2
  107. data/app/views/decidim/admin/impersonatable_users/index.html.erb +2 -2
  108. data/app/views/decidim/admin/metrics/_metrics.html.erb +21 -0
  109. data/app/views/decidim/admin/metrics/index.html.erb +7 -0
  110. data/app/views/decidim/admin/newsletter_templates/index.html.erb +28 -0
  111. data/app/views/decidim/admin/newsletter_templates/show.html.erb +12 -0
  112. data/app/views/decidim/admin/newsletters/_form.html.erb +1 -7
  113. data/app/views/decidim/admin/newsletters/edit.html.erb +1 -1
  114. data/app/views/decidim/admin/newsletters/index.html.erb +9 -3
  115. data/app/views/decidim/admin/newsletters/new.html.erb +1 -1
  116. data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +4 -4
  117. data/app/views/decidim/admin/officializations/_show_email_modal.html.erb +31 -0
  118. data/app/views/decidim/admin/officializations/index.html.erb +9 -41
  119. data/app/views/decidim/admin/officializations/show_email.html.erb +2 -0
  120. data/app/views/decidim/admin/organization/_form.html.erb +37 -0
  121. data/app/views/decidim/admin/organization_appearance/_form.html.erb +2 -72
  122. data/app/views/decidim/admin/organization_appearance/form/_colors.html.erb +23 -0
  123. data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +38 -0
  124. data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +46 -0
  125. data/app/views/decidim/admin/resource_permissions/_options_form.html.erb +1 -1
  126. data/app/views/decidim/admin/share_tokens/_share_tokens.html.erb +57 -0
  127. data/app/views/decidim/admin/shared/_filters.html.erb +40 -0
  128. data/app/views/decidim/admin/shared/_gallery.html.erb +21 -0
  129. data/app/views/decidim/admin/static_pages/_form.html.erb +1 -1
  130. data/app/views/decidim/admin/user_groups/index.html.erb +4 -4
  131. data/app/views/decidim/admin/users_statistics/_users_count.html.erb +39 -0
  132. data/app/views/layouts/decidim/admin/_application.html.erb +2 -1
  133. data/app/views/layouts/decidim/admin/_header.html.erb +3 -0
  134. data/app/views/layouts/decidim/admin/_title_bar.html.erb +20 -10
  135. data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
  136. data/config/locales/am-ET.yml +1 -0
  137. data/config/locales/ar.yml +52 -47
  138. data/config/locales/bg-BG.yml +16 -0
  139. data/config/locales/bg.yml +135 -0
  140. data/config/locales/ca.yml +127 -48
  141. data/config/locales/cs.yml +182 -103
  142. data/config/locales/da-DK.yml +1 -0
  143. data/config/locales/da.yml +1 -0
  144. data/config/locales/de.yml +145 -47
  145. data/config/locales/el.yml +819 -0
  146. data/config/locales/en.yml +127 -48
  147. data/config/locales/eo-UY.yml +0 -1
  148. data/config/locales/eo.yml +51 -0
  149. data/config/locales/es-MX.yml +127 -48
  150. data/config/locales/es-PY.yml +127 -48
  151. data/config/locales/es.yml +127 -48
  152. data/config/locales/et-EE.yml +1 -0
  153. data/config/locales/et.yml +1 -0
  154. data/config/locales/eu.yml +21 -47
  155. data/config/locales/fi-plain.yml +127 -48
  156. data/config/locales/fi.yml +140 -61
  157. data/config/locales/fr-CA.yml +849 -0
  158. data/config/locales/fr.yml +133 -53
  159. data/config/locales/ga-IE.yml +1 -0
  160. data/config/locales/gl.yml +21 -47
  161. data/config/locales/hr-HR.yml +1 -0
  162. data/config/locales/hr.yml +1 -0
  163. data/config/locales/hu.yml +100 -48
  164. data/config/locales/id-ID.yml +21 -47
  165. data/config/locales/is-IS.yml +19 -45
  166. data/config/locales/is.yml +568 -0
  167. data/config/locales/it.yml +132 -83
  168. data/config/locales/ja-JP.yml +855 -0
  169. data/config/locales/ja.yml +849 -0
  170. data/config/locales/ko-KR.yml +1 -0
  171. data/config/locales/ko.yml +1 -0
  172. data/config/locales/lt-LT.yml +1 -0
  173. data/config/locales/lt.yml +1 -0
  174. data/config/locales/lv.yml +799 -0
  175. data/config/locales/mt-MT.yml +1 -0
  176. data/config/locales/mt.yml +1 -0
  177. data/config/locales/nl.yml +102 -48
  178. data/config/locales/no.yml +147 -84
  179. data/config/locales/om-ET.yml +1 -0
  180. data/config/locales/pl.yml +364 -238
  181. data/config/locales/pt-BR.yml +22 -48
  182. data/config/locales/pt.yml +334 -237
  183. data/config/locales/ro-RO.yml +814 -0
  184. data/config/locales/ru.yml +20 -46
  185. data/config/locales/sk-SK.yml +823 -0
  186. data/config/locales/sk.yml +806 -0
  187. data/config/locales/sl.yml +166 -0
  188. data/config/locales/so-SO.yml +1 -0
  189. data/config/locales/sr-CS.yml +590 -0
  190. data/config/locales/sv.yml +140 -55
  191. data/config/locales/ti-ER.yml +1 -0
  192. data/config/locales/tr-TR.yml +21 -47
  193. data/config/locales/uk.yml +19 -48
  194. data/config/locales/vi-VN.yml +1 -0
  195. data/config/locales/vi.yml +1 -0
  196. data/config/locales/zh-CN.yml +849 -0
  197. data/config/locales/zh-TW.yml +1 -0
  198. data/config/routes.rb +20 -3
  199. data/db/migrate/20191118112040_add_accepted_admin_terms_at_field_to_users.rb +7 -0
  200. data/lib/decidim/admin.rb +17 -0
  201. data/lib/decidim/admin/engine.rb +12 -9
  202. data/lib/decidim/admin/form_builder.rb +7 -2
  203. data/lib/decidim/admin/test.rb +2 -0
  204. data/lib/decidim/admin/test/filterable_examples.rb +129 -0
  205. data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +1 -1
  206. data/lib/decidim/admin/test/manage_component_permissions_examples.rb +15 -15
  207. data/lib/decidim/admin/test/manage_paginated_collection_examples.rb +22 -0
  208. data/lib/decidim/admin/version.rb +1 -1
  209. data/vendor/assets/javascripts/jquery.serializejson.js +344 -0
  210. metadata +98 -30
  211. data/app/commands/decidim/admin/create_oauth_application.rb +0 -36
  212. data/app/commands/decidim/admin/destroy_oauth_application.rb +0 -39
  213. data/app/commands/decidim/admin/update_oauth_application.rb +0 -39
  214. data/app/controllers/decidim/admin/oauth_applications_controller.rb +0 -90
  215. data/app/forms/decidim/admin/oauth_application_form.rb +0 -32
  216. data/app/views/decidim/admin/oauth_applications/_form.html.erb +0 -19
  217. data/app/views/decidim/admin/oauth_applications/edit.html.erb +0 -13
  218. data/app/views/decidim/admin/oauth_applications/index.html.erb +0 -40
  219. data/app/views/decidim/admin/oauth_applications/new.html.erb +0 -13
  220. data/app/views/decidim/admin/oauth_applications/show.html.erb +0 -27
@@ -1,4 +1,4 @@
1
- <%= decidim_form_for(@form, html: { class: "form new_newsletter" }) do |f| %>
1
+ <%= decidim_form_for(@form, html: { class: "form new_newsletter" }, url: newsletter_template_newsletters_path(newsletter_template_id: params[:newsletter_template_id])) do |f| %>
2
2
  <div class="card">
3
3
  <div class="card-divider">
4
4
  <h2 class="card-title"><%= t ".title" %></h2>
@@ -1,13 +1,11 @@
1
- <%= decidim_form_for(@form, url: deliver_newsletter_path(@newsletter), method: :post, html: { class: "form newsletter_deliver" }) do |f| %>
1
+ <%= decidim_form_for(@form, url: deliver_newsletter_path(@newsletter), method: :post, html: { class: "form newsletter_deliver" }, data: { "recipients-count-newsletter-path": recipients_count_newsletter_path(@newsletter) }) do |f| %>
2
2
  <div class="card">
3
3
 
4
4
  <div class="card-divider">
5
5
  <h2 class="card-title"><%= t ".title" %></h2>
6
6
  </div>
7
7
  <div class="card-section">
8
- <div class="callout warning">
9
- <%= t(".warning").html_safe %>
10
- </div>
8
+ <%= cell("decidim/announcement", newsletter_attention_callout_args) %>
11
9
 
12
10
  <div class="card">
13
11
  <div class="card-divider">
@@ -63,6 +61,8 @@
63
61
  </div>
64
62
  <% end %>
65
63
 
64
+ <%= cell("decidim/announcement", newsletter_recipients_count_callout_args) %>
65
+
66
66
  <div class="button--double form-general-submit">
67
67
  <% if allowed_to?(:update, :newsletter, newsletter: @newsletter) && !@newsletter.sent? %>
68
68
  <%= link_to t("actions.edit", scope: "decidim.admin"), ["edit", @newsletter], class: "button" %>
@@ -0,0 +1,31 @@
1
+ <div class="reveal" id="show-email-modal" data-reveal>
2
+ <div class="reveal__header">
3
+ <h3 class="reveal__title"><%= t(".title") %></h3>
4
+ <button class="close-button" data-close aria-label="<%= t(".close_modal") %>"
5
+ type="button">
6
+ <span aria-hidden="true">&times;</span>
7
+ </button>
8
+ </div>
9
+
10
+ <div class="row">
11
+ <div class="columns medium-4 medium-centered">
12
+ <p><%= t(".description") %></p>
13
+
14
+ <div class="show_email">
15
+ <h4><%= t(".full_name") %></h4>
16
+ <div><p id="user_full_name"></p></div>
17
+ <h4><%= t(".email_address") %></h4>
18
+ <div>
19
+ <p id="user_email"></p>
20
+ <p><%= t(".hidden") %></p>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="button--double form-general-submit">
25
+ <button class="button" data-open="user_email" data-open-url="">
26
+ <%= t(".show") %>
27
+ </button>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -1,44 +1,8 @@
1
- <div class="filters row">
2
- <div class="column medium-3">
3
- <span class="dropdown-menu-inverted_label"><%= t(".filter_by") %> :</span>
4
- <ul class="dropdown menu dropdown-inverted" data-dropdown-menu data-close-on-click-inside="false">
5
- <li class="is-dropdown-submenu-parent">
6
- <a href="#">
7
- <% if @state.present? %>
8
- <%= t(".filter.#{@state}") %>
9
- <% else %>
10
- <%= t(".filter.all") %>
11
- <% end %>
12
- </a>
13
- <ul class="menu is-dropdown-submenu">
14
- <li><%= link_to t(".filter.officialized"), url_for(state: "officialized", q: @query) %></li>
15
- <li><%= link_to t(".filter.not_officialized"), url_for(state: "not_officialized", q: @query) %></li>
16
- <li><%= link_to t(".filter.all"), url_for(q: @query) %></li>
17
- </ul>
18
- </li>
19
- </ul>
20
- </div>
21
- <div class="column medium-4">
22
- <%= form_tag "", method: :get do %>
23
- <div class="filters__search">
24
- <div class="input-group">
25
- <%= search_field_tag :q, @query,label: false, class: "input-group-field", placeholder: t(".search") %>
26
- <%= hidden_field_tag :state, @state %>
27
- <div class="input-group-button">
28
- <button type="submit" class="button button--muted">
29
- <%= icon "magnifying-glass", aria_label: t(".search") %>
30
- </button>
31
- </div>
32
- </div>
33
- </div>
34
- <% end %>
35
- </div>
36
- </div>
37
-
38
- <div class="card" id='user-groups'>
1
+ <div class="card with-overflow" id='user-groups'>
39
2
  <div class="card-divider">
40
3
  <h2 class="card-title"><%= t "decidim.admin.titles.participants" %></h2>
41
4
  </div>
5
+ <%= admin_filter_selector %>
42
6
  <div class="card-section">
43
7
  <div class="table-scroll">
44
8
  <table class="table-list">
@@ -67,15 +31,18 @@
67
31
  <td><%= translated_attribute(user.officialized_as) %></td>
68
32
 
69
33
  <td class="table-list__actions">
34
+ <% if allowed_to? :show_email, :user, user: user %>
35
+ <%= icon_link_to "envelope-open", show_email_officialization_path(user_id: user.id), t(".show_email"), class: "action-icon action-icon--show-email", data: { full_name: user.name, toggle: "show-email-modal" } %>
36
+ <% end %>
70
37
  <%= icon_link_to "envelope-closed", current_or_new_conversation_path_with(user), t("decidim.contact"), class:"action-icon--new" %>
71
38
  <% if user.officialized? %>
72
- <%= icon "circle-check", class: "action-icon action-icon--disabled" %>
39
+ <%= icon "circle-check", class: "action-icon action-icon--disabled", role: "img" %>
73
40
  <%= icon_link_to "pencil", new_officialization_path(user_id: user.id), t(".reofficialize"), class: "action-icon--new" %>
74
41
  <%= icon_link_to "circle-x", officialization_path(user.id), t(".unofficialize"), method: :delete, class: "action-icon--reject" %>
75
42
  <% else %>
76
43
  <%= icon_link_to "circle-check", new_officialization_path(user_id: user.id), t(".officialize"), class: "action-icon--verify" %>
77
- <%= icon "pencil", class: "action-icon action-icon--disabled" %>
78
- <%= icon "circle-x", class: "action-icon action-icon--disabled" %>
44
+ <%= icon "pencil", class: "action-icon action-icon--disabled", role: "img" %>
45
+ <%= icon "circle-x", class: "action-icon action-icon--disabled", role: "img" %>
79
46
  <% end %>
80
47
  </td>
81
48
  </tr>
@@ -86,3 +53,4 @@
86
53
  </div>
87
54
  </div>
88
55
  </div>
56
+ <%= render "show_email_modal" %>
@@ -0,0 +1,2 @@
1
+ <%= link_to user.email, "mailto:#{user.email}" %>
2
+ <script>$("#show-email-modal button[data-open=user_email]").hide()</script>
@@ -32,6 +32,10 @@
32
32
  <%= form.collection_select :default_locale, localized_locales(current_organization.available_locales), :id, :name %>
33
33
  </div>
34
34
 
35
+ <div class="row column">
36
+ <%= form.time_zone_select :time_zone %>
37
+ </div>
38
+
35
39
  <div class="row">
36
40
  <div class="columns xlarge-6">
37
41
  <%= form.text_field :reference_prefix %>
@@ -50,6 +54,33 @@
50
54
  </div>
51
55
  </div>
52
56
 
57
+ <% if Decidim.config.enable_machine_translations %>
58
+ <div class="row">
59
+ <div class="columns xlarge-6">
60
+ <%= form.check_box :enable_machine_translations %>
61
+ </div>
62
+ </div>
63
+
64
+ <div class="row">
65
+ <div class="columns xlarge-6">
66
+ <%= form.label :machine_translation_display_priority, t("activemodel.attributes.organization.machine_translation_display_priority") %>
67
+ <%= form.collection_radio_buttons :machine_translation_display_priority, form.object.machine_translation_priorities, :first, :last %>
68
+ </div>
69
+ </div>
70
+ <% end %>
71
+
72
+ <div class="row">
73
+ <div class="columns xlarge-6">
74
+ <%= form.text_field :comments_max_length %>
75
+ </div>
76
+ </div>
77
+
78
+ <div class="row">
79
+ <div class="columns xlarge-6">
80
+ <%= form.check_box :rich_text_editor_in_public_views, help_text: t(".rich_text_editor_in_public_views_help") %>
81
+ </div>
82
+ </div>
83
+
53
84
  <div class="row" id="welcome-notification-details">
54
85
  <div class="columns xlarge-6">
55
86
  <%= form.check_box :send_welcome_notification %>
@@ -64,4 +95,10 @@
64
95
  </div>
65
96
  </div>
66
97
 
98
+ <div class="row">
99
+ <div class="columns xlarge-6">
100
+ <%= form.translated :editor, :admin_terms_of_use_body %>
101
+ </div>
102
+ </div>
103
+
67
104
  <%= javascript_include_tag "decidim/admin/welcome_notification.js" %>
@@ -87,75 +87,5 @@
87
87
  </div>
88
88
  </div>
89
89
 
90
- <div class="card">
91
- <div class="card-divider">
92
- <h2 class="card-title"><%= t ".layout_appearance_title" %></h2>
93
- </div>
94
- <div class="card-section">
95
- <div class="row">
96
- <div class="columns xlarge-6">
97
- <%= form.upload :logo %>
98
- </div>
99
-
100
- <div class="columns xlarge-6">
101
- <%= form.upload :favicon %>
102
- </div>
103
- </div>
104
-
105
- <div class="row">
106
- <div class="columns xlarge-6">
107
- <%= form.upload :official_img_header %>
108
- </div>
109
-
110
- <div class="columns xlarge-6">
111
- <%= form.upload :official_img_footer %>
112
- </div>
113
- </div>
114
-
115
- <div class="row">
116
- <div class="columns xlarge-6">
117
- <%= form.text_field :official_url %>
118
- </div>
119
- </div>
120
- </div>
121
- </div>
122
-
123
- <div class="card">
124
- <div class="card-divider">
125
- <h2 class="card-title"><%= t ".colors_title" %></h2>
126
- </div>
127
- <div class="card-section">
128
- <div class="row">
129
- <div class="columns xlarge-6">
130
- <%= form.color_field :primary_color, value: current_organization.colors["primary"] %>
131
- </div>
132
-
133
- <div class="columns xlarge-6">
134
- <%= form.color_field :secondary_color, value: current_organization.colors["secondary"] %>
135
- </div>
136
- </div>
137
-
138
- <div class="row">
139
- <div class="columns xlarge-6">
140
- <%= form.color_field :success_color, value: current_organization.colors["success"] %>
141
- </div>
142
-
143
- <div class="columns xlarge-6">
144
- <%= form.color_field :warning_color, value: current_organization.colors["warning"] %>
145
- </div>
146
- </div>
147
-
148
- <div class="row">
149
- <div class="columns xlarge-6">
150
- <%= form.color_field :alert_color, value: current_organization.colors["alert"] %>
151
- </div>
152
- </div>
153
-
154
- <% if Decidim.enable_html_header_snippets %>
155
- <div class="row column">
156
- <%= form.text_area :header_snippets %>
157
- <p class="help-text"><%= t(".header_snippets_help") %></p>
158
- </div>
159
- <% end %>
160
- </div>
161
- </div>
90
+ <%= render partial: "decidim/admin/organization_appearance/form/images", locals: { form: form } %>
91
+ <%= render partial: "decidim/admin/organization_appearance/form/colors", locals: { form: form } %>
@@ -0,0 +1,23 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= t ".colors_title" %></h2>
4
+ </div>
5
+ <div class="card-section">
6
+ <div class="organization-colors">
7
+ <%= form.color_field :primary_color, value: current_organization.colors["primary"] %>
8
+ <%= form.color_field :secondary_color, value: current_organization.colors["secondary"] %>
9
+ <%= form.color_field :success_color, value: current_organization.colors["success"] %>
10
+ <%= form.color_field :warning_color, value: current_organization.colors["warning"] %>
11
+ <%= form.color_field :alert_color, value: current_organization.colors["alert"] %>
12
+ <%= form.color_field :highlight_color, value: current_organization.colors["highlight"] %>
13
+ <%= form.color_field :highlight_alternative_color, value: current_organization.colors["highlight-alternative"] %>
14
+ </div>
15
+
16
+ <% if true %>
17
+ <div class="row column">
18
+ <%= form.text_area :header_snippets %>
19
+ <p class="help-text"><%= t(".header_snippets_help") %></p>
20
+ </div>
21
+ <% end %>
22
+ </div>
23
+ </div>
@@ -0,0 +1,38 @@
1
+ <div class="card">
2
+ <div class="card-divider">
3
+ <h2 class="card-title"><%= t ".layout_appearance_title" %></h2>
4
+ </div>
5
+
6
+ <div class="card-section">
7
+ <div class="minimap">
8
+ <label for="minimap"><%= t(".preview") %></label>
9
+ <%= render "decidim/admin/organization_appearance/form/minimap" %>
10
+ </div>
11
+
12
+ <div class="organization-images">
13
+ <div class="preview">
14
+ <%= form.upload :favicon, dimensions_info: current_organization.favicon.dimensions_info, extension_whitelist: current_organization.favicon.extension_whitelist %>
15
+ </div>
16
+
17
+ <div class="preview">
18
+ <%= form.upload :logo, dimensions_info: current_organization.logo.dimensions_info, extension_whitelist: current_organization.favicon.extension_whitelist %>
19
+ </div>
20
+
21
+ <div class="preview">
22
+ <%= form.upload :official_img_header, dimensions_info: current_organization.official_img_header.dimensions_info, extension_whitelist: current_organization.favicon.extension_whitelist %>
23
+ </div>
24
+
25
+ <div class="preview">
26
+ <%= form.upload :official_img_footer, dimensions_info: current_organization.official_img_footer.dimensions_info, extension_whitelist: current_organization.favicon.extension_whitelist %>
27
+ </div>
28
+ </div>
29
+ </div>
30
+
31
+ <div class="card-section">
32
+ <div class="row" style="display: grid; grid-template-columns: 1fr 1fr;">
33
+ <div class="preview-official_url">
34
+ <%= form.text_field :official_url %>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
@@ -0,0 +1,46 @@
1
+ <% size_factor = 0.2 %>
2
+ <div id="minimap-wrapper">
3
+ <div id="minimap">
4
+ <div class="minimap-tab">
5
+ <% if current_organization.favicon.present? %>
6
+ <%= image_tag current_organization.favicon.url, class: "minimap-favicon" %>
7
+ <% else %>
8
+ <%= content_tag :div, nil, { class: "minimap-favicon placeholder", style: "width: #{image_width(current_organization, :favicon) * size_factor }px; height: #{image_height(current_organization, :favicon) * size_factor }px;" } do %>
9
+ <% end %>
10
+ <% end %>
11
+
12
+ <span> &lt; <%= t("favicon", scope: "activemodel.attributes.organization") %></span>
13
+ </div>
14
+
15
+ <div class="minimap-header">
16
+ <% if current_organization.logo.present? %>
17
+ <%= image_tag current_organization.logo.url, class: "minimap-logo" %>
18
+ <% else %>
19
+ <%= content_tag :div, nil, { class: "minimap-logo placeholder", style: "width: #{image_width(current_organization, :logo) * size_factor }px; height: #{image_height(current_organization, :logo) * size_factor }px;" } do %>
20
+ <span><%= t("logo", scope: "activemodel.attributes.organization") %></span>
21
+ <% end %>
22
+ <% end %>
23
+
24
+ <% if current_organization.official_img_header.present? %>
25
+ <%= image_tag current_organization.official_img_header.url, class: "minimap-official_img_header" %>
26
+ <% else %>
27
+ <span class="float-right"><%= t("official_img_header", scope: "activemodel.attributes.organization") %> &gt; </span>
28
+ <%= content_tag :div, nil, { class: "minimap-official_img_header placeholder float-right", style: "width: #{image_width(current_organization, :official_img_header) * size_factor }px; height: #{image_height(current_organization, :official_img_header) * size_factor }px;" } %>
29
+ <% end %>
30
+
31
+ </div>
32
+
33
+ <div class="minimap-navbar"></div>
34
+ <div class="minimap-body"></div>
35
+
36
+ <div class="minimap-footer">
37
+ <% if current_organization.official_img_footer.present? %>
38
+ <%= image_tag current_organization.official_img_footer.url, class: "minimap-official_img_footer" %>
39
+ <% else %>
40
+ <%= content_tag :div, nil, { class: "minimap-official_img_footer placeholder", style: "width: #{image_width(current_organization, :official_img_footer) * size_factor }px; height: #{image_height(current_organization, :official_img_footer) * size_factor }px;" } do %>
41
+ <span><%= t("official_img_footer", scope: "activemodel.attributes.organization") %></span>
42
+ <% end %>
43
+ <% end %>
44
+ </div>
45
+ </div>
46
+ </div>
@@ -11,7 +11,7 @@
11
11
  attribute_options_form,
12
12
  attribute,
13
13
  name,
14
- label: t("authorization_handlers.#{handler_name}.fields.#{name}", scope: "decidim"),
14
+ "decidim.authorization_handlers.#{handler_name}.fields",
15
15
  tabs_prefix: "#{name}_tabs_prefix"
16
16
  ) %>
17
17
  <% end %>
@@ -0,0 +1,57 @@
1
+ <div class="card share_tokens">
2
+ <div class="card-divider">
3
+ <legend><%= t ".title" %></legend>
4
+ </div>
5
+ <div class="card-section">
6
+ <div class="help-text">
7
+ <p><%= t ".help" %></p>
8
+ </div>
9
+ <% if share_tokens.any? %>
10
+ <div class="table-scroll">
11
+ <table class="table-list">
12
+ <thead>
13
+ <tr>
14
+ <th><%= t("models.share_token.fields.token", scope: "decidim.admin") %></th>
15
+ <th><%= t("models.share_token.fields.user", scope: "decidim.admin") %></th>
16
+ <th><%= t("models.share_token.fields.times_used", scope: "decidim.admin") %></th>
17
+ <th><%= t("models.share_token.fields.last_used_at", scope: "decidim.admin") %></th>
18
+ <th><%= t("models.share_token.fields.created_at", scope: "decidim.admin") %></th>
19
+ <th><%= t("models.share_token.fields.expires_at", scope: "decidim.admin") %></th>
20
+ <th class="actions"></th>
21
+ </tr>
22
+ </thead>
23
+ <tbody>
24
+ <% share_tokens.each do |share_token| %>
25
+ <tr>
26
+ <td><%= share_token.token %></td>
27
+ <td><%= share_token.user.name %></td>
28
+ <td><%= share_token.times_used %></td>
29
+ <td><%= l share_token.last_used_at, format: :short if share_token.last_used_at.present? %></td>
30
+ <td><%= l share_token.created_at, format: :short %></td>
31
+ <td><%= l share_token.expires_at, format: :short if share_token.expires_at.present? %></td>
32
+ <td class="table-list__actions">
33
+ <%= icon_link_to "share",
34
+ share_token.url,
35
+ t("actions.share", scope: "decidim.admin.share_tokens"),
36
+ class: "action-icon--share",
37
+ target: "_blank" %>
38
+ <%= icon_link_to "circle-x",
39
+ decidim_admin.share_token_path(
40
+ share_token,
41
+ url: request.fullpath
42
+ ),
43
+ t("actions.destroy", scope: "decidim.admin.share_tokens"),
44
+ class: "action-icon--remove",
45
+ method: :delete,
46
+ data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin.share_tokens") } %>
47
+ </td>
48
+ </tr>
49
+ <% end %>
50
+ </tbody>
51
+ </table>
52
+ </div>
53
+ <% else %>
54
+ <p><%= t ".empty" %></p>
55
+ <% end %>
56
+ </div>
57
+ </div>