decidim-system 0.27.10 → 0.28.0.rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -7
  3. data/app/commands/decidim/system/create_admin.rb +1 -1
  4. data/app/commands/decidim/system/create_default_content_blocks.rb +1 -14
  5. data/app/commands/decidim/system/create_default_pages.rb +23 -4
  6. data/app/commands/decidim/system/populate_help.rb +2 -2
  7. data/app/commands/decidim/system/register_organization.rb +18 -8
  8. data/app/commands/decidim/system/update_admin.rb +1 -1
  9. data/app/commands/decidim/system/update_organization.rb +2 -1
  10. data/app/controllers/decidim/system/application_controller.rb +1 -1
  11. data/app/controllers/decidim/system/dashboard_controller.rb +1 -0
  12. data/app/controllers/decidim/system/organizations_controller.rb +30 -9
  13. data/app/forms/decidim/system/admin_form.rb +1 -1
  14. data/app/forms/decidim/system/update_organization_form.rb +16 -17
  15. data/app/jobs/decidim/system/application_job.rb +1 -1
  16. data/app/mailers/decidim/system/application_mailer.rb +12 -0
  17. data/app/packs/entrypoints/decidim_system.js +5 -3
  18. data/app/packs/stylesheets/decidim/system/application.scss +108 -21
  19. data/app/views/decidim/system/admins/_form.html.erb +1 -7
  20. data/app/views/decidim/system/admins/edit.html.erb +3 -3
  21. data/app/views/decidim/system/admins/index.html.erb +3 -31
  22. data/app/views/decidim/system/admins/new.html.erb +3 -3
  23. data/app/views/decidim/system/dashboard/show.html.erb +13 -3
  24. data/app/views/decidim/system/devise/mailers/password_change.html.erb +1 -1
  25. data/app/views/decidim/system/devise/mailers/reset_password_instructions.html.erb +2 -2
  26. data/app/views/decidim/system/devise/passwords/edit.html.erb +5 -8
  27. data/app/views/decidim/system/devise/passwords/new.html.erb +5 -5
  28. data/app/views/decidim/system/devise/sessions/new.html.erb +10 -12
  29. data/app/views/decidim/system/oauth_applications/_form.html.erb +5 -20
  30. data/app/views/decidim/system/oauth_applications/edit.html.erb +9 -11
  31. data/app/views/decidim/system/oauth_applications/index.html.erb +6 -8
  32. data/app/views/decidim/system/oauth_applications/new.html.erb +9 -11
  33. data/app/views/decidim/system/oauth_applications/show.html.erb +20 -23
  34. data/app/views/decidim/system/organizations/_advanced_settings.html.erb +10 -8
  35. data/app/views/decidim/system/organizations/_csp_settings.html.erb +12 -0
  36. data/app/views/decidim/system/organizations/_file_upload_settings.erb +23 -46
  37. data/app/views/decidim/system/organizations/_omniauth_provider.html.erb +13 -16
  38. data/app/views/decidim/system/organizations/_omniauth_settings.html.erb +6 -8
  39. data/app/views/decidim/system/organizations/_smtp_settings.html.erb +12 -22
  40. data/app/views/decidim/system/organizations/edit.html.erb +29 -26
  41. data/app/views/decidim/system/organizations/index.html.erb +3 -4
  42. data/app/views/decidim/system/organizations/new.html.erb +29 -42
  43. data/app/views/decidim/system/shared/_admins_list.html.erb +27 -0
  44. data/app/views/decidim/system/shared/_notices.html.erb +4 -6
  45. data/app/views/decidim/system/shared/_organizations_list.html.erb +10 -3
  46. data/app/views/layouts/decidim/system/_header.html.erb +2 -2
  47. data/app/views/layouts/decidim/system/_login_items.html.erb +3 -7
  48. data/app/views/layouts/decidim/system/_sidebar.html.erb +3 -7
  49. data/app/views/layouts/decidim/system/application.html.erb +24 -28
  50. data/app/views/layouts/decidim/system/login.html.erb +10 -9
  51. data/config/locales/ar.yml +0 -12
  52. data/config/locales/bg.yml +0 -214
  53. data/config/locales/ca.yml +69 -18
  54. data/config/locales/cs.yml +69 -12
  55. data/config/locales/de.yml +62 -18
  56. data/config/locales/el.yml +8 -11
  57. data/config/locales/en.yml +70 -18
  58. data/config/locales/eo.yml +0 -7
  59. data/config/locales/es-MX.yml +70 -18
  60. data/config/locales/es-PY.yml +70 -18
  61. data/config/locales/es.yml +70 -18
  62. data/config/locales/eu.yml +69 -17
  63. data/config/locales/fa-IR.yml +0 -5
  64. data/config/locales/fi-plain.yml +69 -18
  65. data/config/locales/fi.yml +71 -20
  66. data/config/locales/fr-CA.yml +44 -24
  67. data/config/locales/fr.yml +54 -18
  68. data/config/locales/ga-IE.yml +0 -4
  69. data/config/locales/gl.yml +0 -12
  70. data/config/locales/hu.yml +0 -35
  71. data/config/locales/id-ID.yml +0 -10
  72. data/config/locales/is-IS.yml +0 -10
  73. data/config/locales/it.yml +0 -13
  74. data/config/locales/ja.yml +43 -24
  75. data/config/locales/lb.yml +0 -5
  76. data/config/locales/lt.yml +18 -11
  77. data/config/locales/lv.yml +0 -27
  78. data/config/locales/nl.yml +0 -20
  79. data/config/locales/no.yml +0 -12
  80. data/config/locales/pl.yml +0 -53
  81. data/config/locales/pt-BR.yml +0 -38
  82. data/config/locales/pt.yml +0 -12
  83. data/config/locales/ro-RO.yml +3 -19
  84. data/config/locales/ru.yml +0 -27
  85. data/config/locales/sk.yml +0 -27
  86. data/config/locales/sl.yml +0 -26
  87. data/config/locales/sr-CS.yml +0 -17
  88. data/config/locales/sv.yml +0 -12
  89. data/config/locales/tr-TR.yml +3 -15
  90. data/config/locales/uk.yml +0 -21
  91. data/config/locales/zh-CN.yml +0 -12
  92. data/config/locales/zh-TW.yml +7 -10
  93. data/config/routes.rb +6 -2
  94. data/db/seeds.rb +1 -1
  95. data/lib/decidim/system/engine.rb +2 -25
  96. data/lib/decidim/system/menu.rb +35 -0
  97. data/lib/decidim/system/version.rb +1 -1
  98. data/lib/tasks/decidim_system.rake +1 -1
  99. metadata +22 -28
  100. data/app/packs/entrypoints/decidim_system.scss +0 -1
  101. data/app/packs/images/decidim/system/.keep +0 -0
  102. data/app/packs/src/decidim/system/application.js +0 -41
  103. data/app/packs/stylesheets/decidim/system/_actions.scss +0 -8
  104. data/app/packs/stylesheets/decidim/system/_forms.scss +0 -36
  105. data/app/packs/stylesheets/decidim/system/_foundation_and_overrides.scss +0 -53
  106. data/app/packs/stylesheets/decidim/system/_layout.scss +0 -18
  107. data/app/packs/stylesheets/decidim/system/_login.scss +0 -37
  108. data/app/packs/stylesheets/decidim/system/_settings.scss +0 -569
  109. data/app/packs/stylesheets/decidim/system/_sidebar.scss +0 -83
  110. data/app/packs/stylesheets/decidim/system/_tables.scss +0 -6
  111. data/app/views/decidim/system/admins/show.html.erb +0 -9
  112. data/app/views/decidim/system/organizations/show.html.erb +0 -10
  113. data/config/locales/he-IL.yml +0 -1
  114. data/decidim-system.gemspec +0 -35
@@ -1,37 +1,9 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
3
  <% provide :title do %>
4
- <h2><%= t ".title" %></h2>
4
+ <h1 class="h1"><%= t ".title" %></h1>
5
5
  <% end %>
6
6
 
7
- <div class="actions title">
8
- <%= link_to t("actions.new", scope: "decidim.system", name: t("models.admin.name", scope: "decidim.system")), [:new, :admin], class: "new" %>
9
- </div>
7
+ <%= link_to t("actions.new_admin", scope: "decidim.system"), [:new, :admin], class: "button button__sm md:button__lg button__primary" %>
10
8
 
11
- <table class="stack">
12
- <thead>
13
- <tr>
14
- <th><%= t("models.admin.fields.email", scope: "decidim.system") %></th>
15
- <th><%= t("models.admin.fields.created_at", scope: "decidim.system") %></th>
16
- <th class="actions"><%= t("actions.title", scope: "decidim.system") %></th>
17
- </tr>
18
- </thead>
19
- <tbody>
20
- <% @admins.each do |admin| %>
21
- <tr>
22
- <td>
23
- <%= link_to admin.email, admin %><br>
24
- </td>
25
- <td>
26
- <%= l admin.created_at, format: :short %>
27
- </td>
28
- <td class="actions">
29
- <%= link_to t("actions.edit", scope: "decidim.system"), [:edit, admin] %>
30
- <% unless current_admin?(admin) %>
31
- <%= link_to t("actions.destroy", scope: "decidim.system"), admin, method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.system") } %>
32
- <% end %>
33
- </td>
34
- </tr>
35
- <% end %>
36
- </tbody>
37
- </table>
9
+ <%= render partial: "decidim/system/shared/admins_list", locals: { admins: @admins } %>
@@ -1,13 +1,13 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
3
  <% provide :title do %>
4
- <h2><%= t ".title" %></h2>
4
+ <h1 class="h1"><%= t ".title" %></h1>
5
5
  <% end %>
6
6
 
7
7
  <%= decidim_form_for(@form) do |f| %>
8
8
  <%= render partial: "form", object: f %>
9
9
 
10
- <div class="actions">
11
- <%= f.submit t(".create") %>
10
+ <div class="form__wrapper-block">
11
+ <%= f.submit t(".create"), class: "button button__sm md:button__lg button__primary" %>
12
12
  </div>
13
13
  <% end %>
@@ -1,7 +1,17 @@
1
1
  <% add_decidim_page_title(t("decidim.system.titles.dashboard")) %>
2
2
 
3
3
  <% provide :title do %>
4
- <h2><%= t("decidim.system.titles.dashboard") %></h2>
5
- <h3><%= t ".current_organizations" %></h3>
6
- <%= render partial: "decidim/system/shared/organizations_list", locals: { organizations: @organizations } %>
4
+ <h1 class="h1"><%= t("decidim.system.titles.dashboard") %></h1>
7
5
  <% end %>
6
+
7
+ <h2 class="h3"><%= t ".current_organizations" %></h2>
8
+
9
+ <%= link_to t("actions.new_organization", scope: "decidim.system"), [:new, :organization], class: "button button__sm md:button__lg button__primary" %>
10
+
11
+ <%= render partial: "decidim/system/shared/organizations_list", locals: { organizations: @organizations } %>
12
+
13
+ <h2 class="h3"><%= t ".admins" %></h2>
14
+
15
+ <%= link_to t("actions.new_admin", scope: "decidim.system"), [:new, :admin], class: "button button__sm md:button__lg button__primary" %>
16
+
17
+ <%= render partial: "decidim/system/shared/admins_list", locals: { admins: @admins } %>
@@ -1,3 +1,3 @@
1
1
  <p>Hello <%= @resource.email %>!</p>
2
2
 
3
- <p>We're contacting you to notify you that your password has been changed.</p>
3
+ <p>We are contacting you to notify you that your password has been changed.</p>
@@ -4,5 +4,5 @@
4
4
 
5
5
  <p><%= link_to "Change my password", edit_password_url(@resource, reset_password_token: @token) %></p>
6
6
 
7
- <p>If you didn't request this, please ignore this email.</p>
8
- <p>Your password won't change until you access the link above and create a new one.</p>
7
+ <p>If you did not request this, please ignore this email.</p>
8
+ <p>Your password will not change until you access the link above and create a new one.</p>
@@ -1,22 +1,19 @@
1
- <h2> <%= link_to t(".change_your_password") %></h2>
1
+ <h2 class="h3"> <%= link_to t(".change_your_password") %></h2>
2
2
 
3
3
  <%= decidim_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4
- <%= render "devise/shared/error_messages", resource: resource %>
4
+ <%= render "devise/shared/error_messages", resource: %>
5
5
  <%= f.hidden_field :reset_password_token %>
6
6
 
7
- <div class="field">
7
+ <div class="form__wrapper">
8
8
  <% if @minimum_password_length %>
9
9
  <em><%= t(".minimum_characters", minimum: @minimum_password_length) %></em><br>
10
10
  <% end %>
11
11
  <%= f.password_field :password, autofocus: true, autocomplete: "off" %>
12
- </div>
13
-
14
- <div class="field">
15
12
  <%= f.password_field :password_confirmation, autocomplete: "off" %>
16
13
  </div>
17
14
 
18
- <div class="actions">
19
- <%= f.submit "Change my password" %>
15
+ <div class="form__wrapper-block">
16
+ <%= f.submit "Change my password", class: "button button__sm md:button__lg md:button__lg button__secondary" %>
20
17
  </div>
21
18
  <% end %>
22
19
 
@@ -1,14 +1,14 @@
1
- <h2><%= link_to t(".forgot_your_password") %></h2>
1
+ <h2 class="h3"><%= link_to t(".forgot_your_password") %></h2>
2
2
 
3
3
  <%= decidim_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
4
- <%= render "devise/shared/error_messages", resource: resource %>
4
+ <%= render "devise/shared/error_messages", resource: %>
5
5
 
6
- <div class="field">
6
+ <div class="form__wrapper">
7
7
  <%= f.email_field :email, autofocus: true %>
8
8
  </div>
9
9
 
10
- <div class="actions">
11
- <%= f.submit t(".send_me_reset_password_instructions") %>
10
+ <div class="form__wrapper-block">
11
+ <%= f.submit t(".send_me_reset_password_instructions"), class: "button button__sm md:button__lg md:button__lg button__secondary" %>
12
12
  </div>
13
13
  <% end %>
14
14
 
@@ -1,23 +1,21 @@
1
- <h2><%= t("log_in", scope: "decidim.system.devise.shared.links") %></h2>
1
+ <h2 class="h3"><%= t("log_in", scope: "decidim.system.devise.shared.links") %></h2>
2
2
 
3
3
  <%= decidim_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
4
- <div class="field">
4
+ <div class="form__wrapper">
5
5
  <%= f.email_field :email, autofocus: true %>
6
- </div>
7
6
 
8
- <div class="field">
9
7
  <%= f.password_field :password, autocomplete: "off" %>
10
- </div>
11
8
 
12
- <% if devise_mapping.rememberable? -%>
13
- <div class="field">
9
+ <% if devise_mapping.rememberable? -%>
14
10
  <%= f.check_box :remember_me %>
15
- </div>
16
- <% end -%>
11
+ <% end -%>
12
+ </div>
17
13
 
18
- <div class="actions">
19
- <%= f.submit t("log_in", scope: "decidim.system.devise.shared.links") %>
14
+ <div class="form__wrapper-block">
15
+ <%= f.submit t("log_in", scope: "decidim.system.devise.shared.links"), class: "button button__sm md:button__lg md:button__lg button__secondary" %>
20
16
  </div>
21
17
  <% end %>
22
18
 
23
- <%= render "decidim/system/devise/shared/links" %>
19
+ <div class="flex flex-col [&>a]:text-secondary hover:[&>a]:underline [&>a]:w-fit [&>a]:mt-4">
20
+ <%= render "decidim/system/devise/shared/links" %>
21
+ </div>
@@ -1,26 +1,11 @@
1
- <div class="row column">
1
+ <div class="form__wrapper">
2
2
  <%= form.text_field :name %>
3
- </div>
4
-
5
- <div class="row column">
6
3
  <%= form.text_field :redirect_uri %>
7
- </div>
8
-
9
- <div class="row column">
10
4
  <%= form.select :decidim_organization_id,
11
- Decidim::Organization.pluck(:name, :id),
12
- { include_blank: t(".select_organization") },
13
- { multiple: false } %>
14
- </div>
15
-
16
- <div class="row column">
5
+ Decidim::Organization.pluck(:name, :id),
6
+ { include_blank: t(".select_organization") },
7
+ { multiple: false } %>
17
8
  <%= form.text_field :organization_name %>
18
- </div>
19
-
20
- <div class="row column">
21
9
  <%= form.text_field :organization_url %>
22
- </div>
23
-
24
- <div class="row column">
25
- <%= form.upload :organization_logo, required: true %>
10
+ <%= form.upload :organization_logo, required: true, button_class: "button button__lg button__transparent-primary" %>
26
11
  </div>
@@ -1,15 +1,13 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
- <%= decidim_form_for(@form, html: { class: "form edit_oauth_application" }) do |f| %>
4
- <div class="card">
5
- <div class="card-divider">
6
- <h2 class="card-title"><%= t ".title" %></h2>
7
- </div>
8
- <div class="card-section">
9
- <%= render partial: "form", object: f %>
10
- </div>
11
- </div>
12
- <div class="button--double form-general-submit">
13
- <%= f.submit t(".save") %>
3
+ <% provide :title do %>
4
+ <h1 class="h1"><%= t ".title" %></h1>
5
+ <% end %>
6
+
7
+ <%= decidim_form_for(@form) do |f| %>
8
+ <%= render partial: "form", object: f %>
9
+
10
+ <div class="form__wrapper-block">
11
+ <%= f.submit t(".save"), class: "button button__sm md:button__lg button__primary" %>
14
12
  </div>
15
13
  <% end %>
@@ -1,14 +1,12 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
3
  <% provide :title do %>
4
- <h2><%= t ".title" %></h2>
4
+ <h1 class="h1"><%= t ".title" %></h1>
5
5
  <% end %>
6
6
 
7
- <div class="actions title">
8
- <%= link_to t("actions.new", scope: "decidim.system", name: t("models.oauth_application.name", scope: "decidim.system")), [:new, :oauth_application], class: "new" %>
9
- </div>
7
+ <%= link_to t("actions.new_oauth_application", scope: "decidim.system"), [:new, :oauth_application], class: "button button__sm md:button__lg button__primary" %>
10
8
 
11
- <table class="stack">
9
+ <table>
12
10
  <thead>
13
11
  <tr>
14
12
  <th></th>
@@ -22,20 +20,20 @@
22
20
  <% @oauth_applications.each do |oauth_application| %>
23
21
  <tr>
24
22
  <td>
25
- <%= image_tag oauth_application.attached_uploader(:organization_logo).path %>
23
+ <%= image_tag oauth_application.attached_uploader(:organization_logo).path, class: "max-w-md" %>
26
24
  </td>
27
25
  <td>
28
26
  <%= link_to oauth_application.name, oauth_application %><br>
29
27
  </td>
30
28
  <td>
31
- <%= link_to oauth_application.organization_name, oauth_application.organization %><br>
29
+ <%= link_to oauth_application.organization_name, edit_organization_path(oauth_application.organization) %><br>
32
30
  </td>
33
31
  <td>
34
32
  <%= l oauth_application.created_at, format: :short %>
35
33
  </td>
36
34
  <td class="actions">
37
35
  <%= link_to t("actions.edit", scope: "decidim.system"), [:edit, oauth_application] %>
38
- <%= link_to t("actions.destroy", scope: "decidim.system"), oauth_application, method: :delete, class: "small alert button", data: { confirm: t(".confirm_delete") } %>
36
+ <%= link_to t("actions.destroy", scope: "decidim.system"), oauth_application, method: :delete, data: { confirm: t(".confirm_delete") } %>
39
37
  </td>
40
38
  </tr>
41
39
  <% end %>
@@ -1,15 +1,13 @@
1
1
  <% add_decidim_page_title(t(".title")) %>
2
2
 
3
- <%= decidim_form_for(@form, html: { class: "form new_oauth_application" }) do |f| %>
4
- <div class="card">
5
- <div class="card-divider">
6
- <h2 class="card-title"><%= t ".title" %></h2>
7
- </div>
8
- <div class="card-section">
9
- <%= render partial: "form", object: f %>
10
- </div>
11
- </div>
12
- <div class="button--double form-general-submit">
13
- <%= f.submit t(".save") %>
3
+ <% provide :title do %>
4
+ <h1 class="h1"><%= t ".title" %></h1>
5
+ <% end %>
6
+
7
+ <%= decidim_form_for(@form) do |f| %>
8
+ <%= render partial: "form", object: f %>
9
+
10
+ <div class="form__wrapper-block">
11
+ <%= f.submit t(".save"), class: "button button__sm md:button__lg button__primary" %>
14
12
  </div>
15
13
  <% end %>
@@ -1,29 +1,26 @@
1
1
  <% add_decidim_page_title(@oauth_application.name) %>
2
2
 
3
- <div class="card">
4
- <div class="card-divider">
5
- <h2 class="card-title"><%= @oauth_application.name %></h2>
6
- </div>
7
- <div class="card-section">
8
- <dl>
9
- <%= display_for @oauth_application,
10
- { uid: :client_id },
11
- { secret: :client_secret },
12
- :organization_name,
13
- :organization_url,
14
- :redirect_uri %>
3
+ <% provide :title do %>
4
+ <h1 class="h1"><%= @oauth_application.name %></h1>
5
+ <% end %>
15
6
 
16
- <dt><%= display_label(@oauth_application, :authorize_url) %></dt>
17
- <dd><%= decidim.oauth_authorization_url(host: @oauth_application.owner.host) %></dd>
7
+ <dl>
8
+ <%= display_for @oauth_application,
9
+ { uid: :client_id },
10
+ { secret: :client_secret },
11
+ :organization_name,
12
+ :organization_url,
13
+ :redirect_uri %>
18
14
 
19
- <dt><%= display_label(@oauth_application, :site) %></dt>
20
- <dd><%= decidim.root_url(host: @oauth_application.owner.host) %></dd>
15
+ <dt><%= display_label(@oauth_application, :authorize_url) %></dt>
16
+ <dd><%= decidim.oauth_authorization_url(host: @oauth_application.owner.host) %></dd>
21
17
 
22
- <dt><%= display_label(@oauth_application, :authorized_tokens) %></dt>
23
- <dd><%= @oauth_application.authorized_tokens.count %></dd>
18
+ <dt><%= display_label(@oauth_application, :site) %></dt>
19
+ <dd><%= decidim.root_url(host: @oauth_application.owner.host) %></dd>
24
20
 
25
- <dt><%= display_label(@oauth_application, :authorization_url) %></dt>
26
- <dd><%= decidim.oauth_authorization_url(host: @oauth_application.owner.host, client_id: @oauth_application.uid, redirect_uri: @oauth_application.redirect_uri, response_type: "code") %></dd>
27
- </dl>
28
- </div>
29
- </div>
21
+ <dt><%= display_label(@oauth_application, :authorized_tokens) %></dt>
22
+ <dd><%= @oauth_application.authorized_tokens.count %></dd>
23
+
24
+ <dt><%= display_label(@oauth_application, :authorization_url) %></dt>
25
+ <dd><%= decidim.oauth_authorization_url(host: @oauth_application.owner.host, client_id: @oauth_application.uid, redirect_uri: @oauth_application.redirect_uri, response_type: "code") %></dd>
26
+ </dl>
@@ -1,10 +1,12 @@
1
- <div class="row column">
2
- <button type="button" class="button collapse hide"><%= t(".hide") %></button>
3
- <button type="button" class="button expand"><%= t(".show") %></button>
4
- </div>
1
+ <button id="advanced-settings-trigger" data-component="dropdown" data-target="advanced-settings-panel" type="button" class="button button__sm md:button__lg button__primary w-fit" aria-expanded="false">
2
+ <span><%= t(".show") %></span>
3
+ <span><%= t(".hide") %></span>
4
+ </button>
5
5
 
6
- <div class="collapsible hide">
7
- <%= render partial: "smtp_settings", locals: { f: f } %>
8
- <%= render partial: "omniauth_settings", locals: { f: f } %>
9
- <%= render partial: "file_upload_settings", locals: { f: f } %>
6
+ <div id="advanced-settings-panel" aria-hidden="true">
7
+ <% %w(smtp_settings omniauth_settings file_upload_settings csp_settings).each do |partial| %>
8
+ <div class="border-2 rounded border-background p-4 form__wrapper mt-8 first:mt-0 last:pb-4">
9
+ <%= render partial:, locals: { f: } %>
10
+ </div>
11
+ <% end %>
10
12
  </div>
@@ -0,0 +1,12 @@
1
+ <h3 class="h4"><%= t("decidim.system.models.organization.fields.content_security_policy") %></h3>
2
+
3
+ <%= f.fields_for :content_security_policy do %>
4
+ <%= f.text_field "default-src".to_sym, label: t(".default_src"), help_text: t(".default_src_hint") %>
5
+ <%= f.text_field "img-src".to_sym, label: t(".img_src"), help_text: t(".img_src_hint") %>
6
+ <%= f.text_field "media-src".to_sym, label: t(".media_src"), help_text: t(".media_src_hint") %>
7
+ <%= f.text_field "script-src".to_sym, label: t(".script_src"), help_text: t(".script_src_hint") %>
8
+ <%= f.text_field "style-src".to_sym, label: t(".style_src"), help_text: t(".style_src_hint") %>
9
+ <%= f.text_field "frame-src".to_sym, label: t(".frame_src"), help_text: t(".frame_src_hint") %>
10
+ <%= f.text_field "font-src".to_sym, label: t(".font_src"), help_text: t(".font_src_hint") %>
11
+ <%= f.text_field "connect-src".to_sym, label: t(".connect_src"), help_text: t(".connect_src_hint") %>
12
+ <% end %>
@@ -1,56 +1,33 @@
1
- <div class="fieldset">
2
- <h4><%= t("decidim.system.models.organization.fields.file_upload_settings") %></h4>
3
- <p><%= t(".intro") %></p>
1
+ <h3 class="h4"><%= t("decidim.system.models.organization.fields.file_upload_settings") %></h3>
2
+ <p class="help-text"><%= t(".intro") %></p>
4
3
 
5
- <%= f.fields_for :file_upload_settings, f.object.file_upload_settings do |settings_form| %>
6
- <%= settings_form.fields_for :allowed_file_extensions, OpenStruct.new(settings_form.object.allowed_file_extensions) do |extensions_form| %>
7
- <% i18n_scope = "#{f.object.class.i18n_scope}.attributes.#{settings_form.object.model_name.i18n_key}.allowed_file_extensions" %>
4
+ <%= f.fields_for :file_upload_settings, f.object.file_upload_settings do |settings_form| %>
5
+ <%= settings_form.fields_for :allowed_file_extensions, OpenStruct.new(settings_form.object.allowed_file_extensions) do |extensions_form| %>
6
+ <% i18n_scope = "#{f.object.class.i18n_scope}.attributes.#{settings_form.object.model_name.i18n_key}.allowed_file_extensions" %>
8
7
 
9
- <h5><%= t(".file_extensions.title") %></h5>
10
-
11
- <div class="field">
12
- <%= extensions_form.text_field :default, class: "js-tags-container", label: t("default", scope: i18n_scope) %>
13
- <p class="help-text"><%= t(".file_extensions.default_hint") %></p>
14
- </div>
15
- <div class="field">
16
- <%= extensions_form.text_field :image, class: "js-tags-container", label: t("image", scope: i18n_scope) %>
17
- <p class="help-text"><%= t(".file_extensions.image_hint") %></p>
18
- </div>
19
- <div class="field">
20
- <%= extensions_form.text_field :admin, class: "js-tags-container", label: t("admin", scope: i18n_scope) %>
21
- <p class="help-text"><%= t(".file_extensions.admin_hint") %></p>
22
- </div>
8
+ <%= field_set_tag f.label(t(".file_extensions.title"), nil, for: nil), class: "border-2 border-background p-4 form__wrapper" do %>
9
+ <%= extensions_form.text_field :default, class: "js-tags-container mt-4", label: t("default", scope: i18n_scope), help_text: t(".file_extensions.default_hint") %>
10
+ <%= extensions_form.text_field :image, class: "js-tags-container mt-4", label: t("image", scope: i18n_scope), help_text: t(".file_extensions.image_hint") %>
11
+ <%= extensions_form.text_field :admin, class: "js-tags-container mt-4", label: t("admin", scope: i18n_scope), help_text: t(".file_extensions.admin_hint") %>
23
12
  <% end %>
13
+ <% end %>
24
14
 
25
- <%= settings_form.fields_for :allowed_content_types, OpenStruct.new(settings_form.object.allowed_content_types) do |extensions_form| %>
26
- <% i18n_scope = "#{f.object.class.i18n_scope}.attributes.#{settings_form.object.model_name.i18n_key}.allowed_content_types" %>
27
-
28
- <h5><%= t(".content_types.title") %></h5>
29
- <p><%= t(".content_types.intro_html") %></p>
15
+ <%= settings_form.fields_for :allowed_content_types, OpenStruct.new(settings_form.object.allowed_content_types) do |extensions_form| %>
16
+ <% i18n_scope = "#{f.object.class.i18n_scope}.attributes.#{settings_form.object.model_name.i18n_key}.allowed_content_types" %>
30
17
 
31
- <div class="field">
32
- <%= extensions_form.text_field :default, class: "js-tags-container", label: t("default", scope: i18n_scope) %>
33
- <p class="help-text"><%= t(".content_types.default_hint") %></p>
34
- </div>
35
- <div class="field">
36
- <%= extensions_form.text_field :admin, class: "js-tags-container", label: t("admin", scope: i18n_scope) %>
37
- <p class="help-text"><%= t(".content_types.admin_hint") %></p>
38
- </div>
18
+ <%= field_set_tag f.label(t(".content_types.title"), nil, for: nil), class: "border-2 border-background p-4 form__wrapper" do %>
19
+ <p class="help-text"><%= t(".content_types.intro_html") %></p>
20
+ <%= extensions_form.text_field :default, class: "js-tags-container mt-4", label: t("default", scope: i18n_scope), help_text: t(".content_types.default_hint") %>
21
+ <%= extensions_form.text_field :admin, class: "js-tags-container mt-4", label: t("admin", scope: i18n_scope), help_text: t(".content_types.admin_hint") %>
39
22
  <% end %>
23
+ <% end %>
40
24
 
41
- <%= settings_form.fields_for :maximum_file_size, OpenStruct.new(settings_form.object.maximum_file_size) do |extensions_form| %>
42
- <% i18n_scope = "#{f.object.class.i18n_scope}.attributes.#{settings_form.object.model_name.i18n_key}.maximum_file_size" %>
43
-
44
- <h5><%= t(".file_sizes.title") %></h5>
25
+ <%= settings_form.fields_for :maximum_file_size, OpenStruct.new(settings_form.object.maximum_file_size) do |extensions_form| %>
26
+ <% i18n_scope = "#{f.object.class.i18n_scope}.attributes.#{settings_form.object.model_name.i18n_key}.maximum_file_size" %>
45
27
 
46
- <div class="field">
47
- <%= extensions_form.number_field :default, step: 0.1, min: 0, label: t("default", scope: i18n_scope) %>
48
- <p class="help-text"><%= t(".file_sizes.default_hint") %></p>
49
- </div>
50
- <div class="field">
51
- <%= extensions_form.number_field :avatar, step: 0.1, min: 0, label: t("avatar", scope: i18n_scope) %>
52
- <p class="help-text"><%= t(".file_sizes.avatar_hint") %></p>
53
- </div>
28
+ <%= field_set_tag f.label(t(".file_sizes.title"), nil, for: nil), class: "border-2 border-background p-4 form__wrapper last:pb-4" do %>
29
+ <%= extensions_form.number_field :default, step: 0.1, min: 0, label: t("default", scope: i18n_scope), help_text: t(".file_sizes.default_hint") %>
30
+ <%= extensions_form.number_field :avatar, step: 0.1, min: 0, label: t("avatar", scope: i18n_scope), help_text: t(".file_sizes.avatar_hint") %>
54
31
  <% end %>
55
32
  <% end %>
56
- </div>
33
+ <% end %>
@@ -1,23 +1,20 @@
1
1
  <% i18n_scope = "decidim.system.organizations.omniauth_settings" %>
2
2
 
3
- <div class="card">
4
- <h5><%= provider_name(provider) %></h5>
5
-
3
+ <%= field_set_tag f.label(provider_name(provider), nil, for: nil), class: "border-2 border-background p-4 form__wrapper last:pb-4" do %>
6
4
  <% if provider_enabled?(provider) %>
7
5
  <p class="help-text"><%= t("enabled_by_default", scope: i18n_scope) %></p>
8
6
  <% end %>
9
7
 
10
- <div class="card-section">
11
- <%= f.check_box(
12
- "omniauth_settings_#{provider}_enabled",
13
- label: t("enabled", scope: i18n_scope)
14
- ) %>
8
+ <%= f.check_box(
9
+ "omniauth_settings_#{provider}_enabled",
10
+ label: t("enabled", scope: i18n_scope),
11
+ label_options: { class: "form__wrapper-checkbox-label" }
12
+ ) %>
15
13
 
16
- <% Rails.application.secrets.dig(:omniauth, provider.to_sym).keys.select { |k| k != :enabled }.each do |setting| %>
17
- <%= f.text_field("omniauth_settings_#{provider}_#{setting}", label: I18n.t(
18
- ".#{setting}",
19
- scope: [:icon, :icon_path].include?(setting) ? i18n_scope : "#{i18n_scope}.#{provider}"
20
- )) %>
21
- <% end %>
22
- </div>
23
- </div>
14
+ <% Rails.application.secrets.dig(:omniauth, provider.to_sym).keys.select { |k| k != :enabled }.each do |setting| %>
15
+ <%= f.text_field("omniauth_settings_#{provider}_#{setting}", label: I18n.t(
16
+ ".#{setting}",
17
+ scope: [:icon, :icon_path].include?(setting) ? i18n_scope : "#{i18n_scope}.#{provider}"
18
+ )) %>
19
+ <% end %>
20
+ <% end %>
@@ -1,11 +1,9 @@
1
- <div class="fieldset">
2
- <h4><%= t("decidim.system.models.organization.fields.omniauth_settings") %></h4>
1
+ <h3 class="h4"><%= t("decidim.system.models.organization.fields.omniauth_settings") %></h3>
3
2
 
4
- <%= f.fields_for :omniauth_settings do %>
5
- <% providers = Decidim::OmniauthProvider.available.keys %>
3
+ <%= f.fields_for :omniauth_settings do %>
4
+ <% providers = Decidim::OmniauthProvider.available.keys %>
6
5
 
7
- <% providers.each do |provider| %>
8
- <%= render partial: "omniauth_provider", locals: { f: f, provider: provider } %>
9
- <% end %>
6
+ <% providers.each do |provider| %>
7
+ <%= render partial: "omniauth_provider", locals: { f:, provider: } %>
10
8
  <% end %>
11
- </div>
9
+ <% end %>
@@ -1,23 +1,13 @@
1
- <div class="fieldset">
2
- <h4><%= t("decidim.system.models.organization.fields.smtp_settings") %></h4>
3
- <%= f.fields_for :smtp_settings do %>
4
- <fieldset class="fieldset">
5
- <legend><%= t(".fieldsets.sender") %></legend>
6
- <%= f.email_field :from_email, placeholder: t(".placeholder.from_email") %>
7
- <%= f.text_field :from_label, placeholder: t(".placeholder.from_label") %>
8
- <p class="help-text"><%= t(".instructions.from_label") %></p>
9
- </fieldset>
10
- <div class="field">
11
- <%= f.text_field :user_name %>
12
- </div>
13
- <div class="field">
14
- <%= f.text_field :password %>
15
- </div>
16
- <div class="field">
17
- <%= f.text_field :address %>
18
- </div>
19
- <div class="field">
20
- <%= f.number_field :port %>
21
- </div>
1
+ <h3 class="h4"><%= t("decidim.system.models.organization.fields.smtp_settings") %></h3>
2
+
3
+ <%= f.fields_for :smtp_settings do %>
4
+ <%= field_set_tag f.label(t(".fieldsets.sender"), nil, for: nil), class: "border border-background p-4" do %>
5
+ <%= f.email_field :from_email, placeholder: t(".placeholder.from_email") %>
6
+ <%= f.text_field :from_label, placeholder: t(".placeholder.from_label"), help_text: t(".instructions.from_label") %>
22
7
  <% end %>
23
- </div>
8
+
9
+ <%= f.text_field :user_name %>
10
+ <%= f.text_field :password %>
11
+ <%= f.text_field :address %>
12
+ <%= f.number_field :port %>
13
+ <% end %>