decidim-system 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 (109) 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 +15 -2
  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 -4
  13. data/app/forms/decidim/system/admin_form.rb +1 -1
  14. data/app/forms/decidim/system/update_organization_form.rb +14 -2
  15. data/app/jobs/decidim/system/application_job.rb +1 -1
  16. data/app/packs/entrypoints/decidim_system.js +5 -3
  17. data/app/packs/stylesheets/decidim/system/application.scss +108 -21
  18. data/app/views/decidim/system/admins/_form.html.erb +1 -7
  19. data/app/views/decidim/system/admins/edit.html.erb +3 -3
  20. data/app/views/decidim/system/admins/index.html.erb +3 -31
  21. data/app/views/decidim/system/admins/new.html.erb +3 -3
  22. data/app/views/decidim/system/dashboard/show.html.erb +13 -3
  23. data/app/views/decidim/system/devise/mailers/password_change.html.erb +1 -1
  24. data/app/views/decidim/system/devise/mailers/reset_password_instructions.html.erb +2 -2
  25. data/app/views/decidim/system/devise/passwords/edit.html.erb +5 -8
  26. data/app/views/decidim/system/devise/passwords/new.html.erb +5 -5
  27. data/app/views/decidim/system/devise/sessions/new.html.erb +10 -12
  28. data/app/views/decidim/system/oauth_applications/_form.html.erb +5 -20
  29. data/app/views/decidim/system/oauth_applications/edit.html.erb +9 -11
  30. data/app/views/decidim/system/oauth_applications/index.html.erb +6 -8
  31. data/app/views/decidim/system/oauth_applications/new.html.erb +9 -11
  32. data/app/views/decidim/system/oauth_applications/show.html.erb +20 -23
  33. data/app/views/decidim/system/organizations/_advanced_settings.html.erb +10 -8
  34. data/app/views/decidim/system/organizations/_csp_settings.html.erb +12 -0
  35. data/app/views/decidim/system/organizations/_file_upload_settings.erb +23 -46
  36. data/app/views/decidim/system/organizations/_omniauth_provider.html.erb +13 -16
  37. data/app/views/decidim/system/organizations/_omniauth_settings.html.erb +6 -8
  38. data/app/views/decidim/system/organizations/_smtp_settings.html.erb +12 -22
  39. data/app/views/decidim/system/organizations/edit.html.erb +29 -26
  40. data/app/views/decidim/system/organizations/index.html.erb +3 -4
  41. data/app/views/decidim/system/organizations/new.html.erb +29 -42
  42. data/app/views/decidim/system/shared/_admins_list.html.erb +27 -0
  43. data/app/views/decidim/system/shared/_notices.html.erb +4 -6
  44. data/app/views/decidim/system/shared/_organizations_list.html.erb +10 -3
  45. data/app/views/layouts/decidim/system/_header.html.erb +2 -2
  46. data/app/views/layouts/decidim/system/_login_items.html.erb +3 -7
  47. data/app/views/layouts/decidim/system/_sidebar.html.erb +3 -7
  48. data/app/views/layouts/decidim/system/application.html.erb +24 -28
  49. data/app/views/layouts/decidim/system/login.html.erb +10 -9
  50. data/config/locales/ar.yml +0 -14
  51. data/config/locales/bg.yml +0 -4
  52. data/config/locales/ca.yml +69 -13
  53. data/config/locales/cs.yml +70 -13
  54. data/config/locales/de.yml +62 -13
  55. data/config/locales/el.yml +7 -12
  56. data/config/locales/en.yml +70 -13
  57. data/config/locales/es-MX.yml +70 -13
  58. data/config/locales/es-PY.yml +70 -13
  59. data/config/locales/es.yml +70 -13
  60. data/config/locales/eu.yml +69 -12
  61. data/config/locales/fa-IR.yml +0 -5
  62. data/config/locales/fi-plain.yml +69 -13
  63. data/config/locales/fi.yml +69 -13
  64. data/config/locales/fr-CA.yml +44 -19
  65. data/config/locales/fr.yml +54 -13
  66. data/config/locales/ga-IE.yml +0 -4
  67. data/config/locales/gl.yml +0 -14
  68. data/config/locales/hu.yml +0 -10
  69. data/config/locales/id-ID.yml +0 -10
  70. data/config/locales/is-IS.yml +0 -4
  71. data/config/locales/it.yml +0 -14
  72. data/config/locales/ja.yml +43 -19
  73. data/config/locales/lb.yml +0 -5
  74. data/config/locales/lt.yml +17 -12
  75. data/config/locales/lv.yml +0 -10
  76. data/config/locales/nl.yml +0 -12
  77. data/config/locales/no.yml +0 -14
  78. data/config/locales/pl.yml +0 -14
  79. data/config/locales/pt-BR.yml +0 -14
  80. data/config/locales/pt.yml +0 -14
  81. data/config/locales/ro-RO.yml +3 -21
  82. data/config/locales/ru.yml +0 -10
  83. data/config/locales/sk.yml +0 -10
  84. data/config/locales/sl.yml +0 -9
  85. data/config/locales/sv.yml +0 -14
  86. data/config/locales/tr-TR.yml +3 -14
  87. data/config/locales/uk.yml +0 -9
  88. data/config/locales/zh-CN.yml +0 -12
  89. data/config/locales/zh-TW.yml +6 -11
  90. data/config/routes.rb +6 -2
  91. data/db/seeds.rb +1 -1
  92. data/lib/decidim/system/engine.rb +2 -25
  93. data/lib/decidim/system/menu.rb +35 -0
  94. data/lib/decidim/system/version.rb +1 -1
  95. data/lib/tasks/decidim_system.rake +1 -1
  96. metadata +20 -25
  97. data/app/packs/entrypoints/decidim_system.scss +0 -1
  98. data/app/packs/src/decidim/system/application.js +0 -41
  99. data/app/packs/stylesheets/decidim/system/_actions.scss +0 -8
  100. data/app/packs/stylesheets/decidim/system/_forms.scss +0 -36
  101. data/app/packs/stylesheets/decidim/system/_foundation_and_overrides.scss +0 -53
  102. data/app/packs/stylesheets/decidim/system/_layout.scss +0 -18
  103. data/app/packs/stylesheets/decidim/system/_login.scss +0 -37
  104. data/app/packs/stylesheets/decidim/system/_settings.scss +0 -569
  105. data/app/packs/stylesheets/decidim/system/_sidebar.scss +0 -83
  106. data/app/packs/stylesheets/decidim/system/_tables.scss +0 -6
  107. data/app/views/decidim/system/admins/show.html.erb +0 -9
  108. data/app/views/decidim/system/organizations/show.html.erb +0 -10
  109. data/config/environment.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 692145aba2b7491b8a21ebe590f7e201f2ef0175ee06f2f1d2db926a31bd3531
4
- data.tar.gz: 06ad6d2ddce0f3ef70862da0ad87bf2305a6b5c70e4beb3f9f08d0c558f5d948
3
+ metadata.gz: 70370fff5369d1099a226723a77145a27c19ee6ff1e214ff4bb6d8fc445934bd
4
+ data.tar.gz: 9d38c13b4de6dc0348aeeb2d38038e73241aebf162f967aa2d706e57f20f856c
5
5
  SHA512:
6
- metadata.gz: 79765641b072c7988e7a4776247baf1d0f4382a30ede8989dcdc4ba63b76e3d03bf8eb2d6d9dba6e13e1311ca5cb9beaf7a3816d0c8c0cbdfa49c03f3cae6693
7
- data.tar.gz: f8517ba254ca769487236a10628d38c310056dd6038523a133523778ede21fe0fc4ef0dec617edbedd675656b3e609558c169196246ea7eb69e3d0b065f5de1c
6
+ metadata.gz: c81b3698abfbfda68d44bd5c5c33609358ce58d63d2b7bbbad7fa7eca463ac72b3a9bf36d58316f1bc9a11083e6a48c25fe7450518425b6106fc4b1eb03eac6e
7
+ data.tar.gz: 55060e2ef6cd99807b4c9e61ea110e7cbdc43724ef1963a54c1011fbfcabd7f41140c9db0d523d78a25ead5d3ce7b053663d36bc70f90ed0b268ca7ac2010aec
data/README.md CHANGED
@@ -27,9 +27,9 @@ When using Decidim as multi-tenant, you should keep these in mind:
27
27
 
28
28
  * All organizations share the same database.
29
29
  * Each organization must have a different hostname.
30
- * Users aren't shared between each organization (the same email can be registered in different organizations and it will be considered as different users).
30
+ * Users are not shared between each organization (the same email can be registered in different organizations and it will be considered as different users).
31
31
  * All configuration related to Decidim (`Decidim.config`) is shared between the organizations.
32
- * Stylesheets aren't customizable per-tenant so UI styles (colors and other variables) are shared.
32
+ * Stylesheets are not customizable per-tenant so UI styles (colors and other variables) are shared.
33
33
 
34
34
  ## Glossary
35
35
 
@@ -40,26 +40,29 @@ When using Decidim as multi-tenant, you should keep these in mind:
40
40
 
41
41
  ## Managing System admins
42
42
 
43
- For logging in to this dashboard, you'll need to create a system admin account from your terminal:
43
+ For logging in to this dashboard, you will need to create a system admin account from your terminal:
44
44
 
45
45
  ```bash
46
46
  bin/rails decidim_system:create_admin
47
47
  ```
48
48
 
49
- You'll be asked for an email and a password. For security, the password will not get displayed back at you and you'll need to confirm it.
49
+ You will be asked for an email and a password. For security, the password will not get displayed back at you and you will need to confirm it.
50
50
 
51
51
  Once you have created your first admin you can access the system dashboard at `/system`. For instance, if you have Decidim running at `https://example.org`, this URL would be `https://example.org/system`.
52
- You'll be able to login with your newly created user.
52
+ You will be able to login with your newly created user.
53
53
 
54
54
  From the system dashboard you can add new admins.
55
55
 
56
- ⚠️ If you need to reset your administrator password you'll need to do it by entering the Rails console and changing it manually. ⚠️
56
+ ⚠️ If you need to reset your administrator password you will need to do it by entering the Rails console and changing it manually. ⚠️
57
57
 
58
58
  . Open the rails console:
59
+
59
60
  ```bash
60
61
  bin/rails console
61
62
  ```
63
+
62
64
  . Run the following instructions, changing them accordingly:
65
+
63
66
  ```ruby
64
67
  system_admin = Decidim::System::Admin.order(:id).first # for the first system admin
65
68
  system_admin = Decidim::System::Admin.find_by_email "system@example.org" # if you already know the email
@@ -73,7 +76,7 @@ system_admin.save
73
76
  Once you have your system admin setup you can also start managing the organizations in your deploy. To do it, login at the system dashboard and create a new organization
74
77
  following the form instructions. After creating it, a new admin user will be created and invited to start managing it.
75
78
 
76
- Remember that System admins and regular Admins are completely different users (they don't even share the same database table), so you can't use your
79
+ Remember that System admins and regular Admins are completely different users (they do not even share the same database table), so you cannot use your
77
80
  system user to login in as an organization admin.
78
81
 
79
82
  ## Contributing
@@ -15,7 +15,7 @@ module Decidim
15
15
  # Executes the command. Broadcasts these events:
16
16
  #
17
17
  # - :ok when everything is valid.
18
- # - :invalid if the form wasn't valid and we couldn't proceed.
18
+ # - :invalid if the form was not valid and we could not proceed.
19
19
  #
20
20
  # Returns nothing.
21
21
  def call
@@ -19,24 +19,11 @@ module Decidim
19
19
  #
20
20
  # Returns nothing.
21
21
  def call
22
- content_blocks.each_with_index do |manifest, index|
23
- weight = (index + 1) * 10
24
- Decidim::ContentBlock.create(
25
- decidim_organization_id: organization.id,
26
- weight: weight,
27
- scope_name: :homepage,
28
- manifest_name: manifest.name,
29
- published_at: Time.current
30
- )
31
- end
22
+ Decidim::ContentBlocksCreator.new(organization).create_default!
32
23
  end
33
24
 
34
25
  private
35
26
 
36
- def content_blocks
37
- Decidim.content_blocks.for(:homepage).select(&:default)
38
- end
39
-
40
27
  attr_reader :organization
41
28
  end
42
29
  end
@@ -14,16 +14,20 @@ module Decidim
14
14
  end
15
15
 
16
16
  # Executes the command.
17
+ # i18n-tasks-use t('decidim.system.default_pages.terms-of-service')
17
18
  #
18
19
  # Returns nothing.
19
20
  def call
20
21
  Decidim::StaticPage::DEFAULT_PAGES.map do |slug|
21
- Decidim::StaticPage.find_or_create_by!(organization: organization, slug: slug) do |page|
22
- page.title = localized_attribute(slug, :title)
23
- page.content = localized_attribute(slug, :content)
22
+ static_page = Decidim::StaticPage.find_or_create_by!(organization:, slug:) do |page|
23
+ translated_slug = I18n.t(slug, scope: "decidim.system.default_pages")
24
+ page.title = localized_attribute(translated_slug, :title)
25
+ page.content = localized_attribute(translated_slug, :content)
24
26
  page.show_in_footer = true
25
- page.allow_public_access = true if slug == "terms-and-conditions"
27
+ page.allow_public_access = true if slug == "terms-of-service"
26
28
  end
29
+
30
+ create_summary_content_blocks_for(static_page) if slug == "terms-of-service"
27
31
  end
28
32
  end
29
33
 
@@ -40,6 +44,21 @@ module Decidim
40
44
  result.update(locale => text)
41
45
  end
42
46
  end
47
+
48
+ def create_summary_content_blocks_for(page)
49
+ content_block_summary = Decidim::ContentBlock.create(
50
+ organization:,
51
+ scope_name: :static_page,
52
+ manifest_name: :summary,
53
+ weight: 1,
54
+ scoped_resource_id: page.id,
55
+ published_at: Time.current
56
+ )
57
+
58
+ translated_slug = I18n.t(page.slug, scope: "decidim.system.default_pages")
59
+ content_block_summary.settings = { summary: localized_attribute(translated_slug, :summary) }
60
+ content_block_summary.save!
61
+ end
43
62
  end
44
63
  end
45
64
  end
@@ -27,7 +27,7 @@ module Decidim
27
27
  slug: "help",
28
28
  title: multi_translation("decidim.help.main_topic.default_page.title", organization: @organization.name),
29
29
  content: multi_translation("decidim.help.main_topic.default_page.content", organization: @organization.name),
30
- topic: topic,
30
+ topic:,
31
31
  organization: @organization,
32
32
  weight: 0
33
33
  )
@@ -40,7 +40,7 @@ module Decidim
40
40
  title: multi_translation("#{scope}.title"),
41
41
  content: multi_translation("#{scope}.page"),
42
42
  slug: manifest.name,
43
- topic: topic,
43
+ topic:,
44
44
  organization: @organization
45
45
  )
46
46
 
@@ -16,7 +16,7 @@ module Decidim
16
16
  # Executes the command. Broadcasts these events:
17
17
  #
18
18
  # - :ok when everything is valid.
19
- # - :invalid if the form wasn't valid and we couldn't proceed.
19
+ # - :invalid if the form was not valid and we could not proceed.
20
20
  #
21
21
  # Returns nothing.
22
22
  def call
@@ -64,10 +64,23 @@ module Decidim
64
64
  omniauth_settings: form.encrypted_omniauth_settings,
65
65
  smtp_settings: form.encrypted_smtp_settings,
66
66
  send_welcome_notification: true,
67
- file_upload_settings: form.file_upload_settings.final
67
+ file_upload_settings: form.file_upload_settings.final,
68
+ colors: default_colors,
69
+ content_security_policy: form.content_security_policy
68
70
  )
69
71
  end
70
72
 
73
+ def default_colors
74
+ {
75
+ alert: "#ec5840",
76
+ primary: "#53bf40",
77
+ success: "#57d685",
78
+ warning: "#ffae00",
79
+ tertiary: "#bf4053",
80
+ secondary: "#4053bf"
81
+ }
82
+ end
83
+
71
84
  def invite_user_form(organization)
72
85
  Decidim::InviteUserForm.from_params(
73
86
  name: form.organization_admin_name,
@@ -16,7 +16,7 @@ module Decidim
16
16
  # Executes the command. Broadcasts these events:
17
17
  #
18
18
  # - :ok when everything is valid.
19
- # - :invalid if the form wasn't valid and we couldn't proceed.
19
+ # - :invalid if the form was not valid and we could not proceed.
20
20
  #
21
21
  # Returns nothing.
22
22
  def call
@@ -17,7 +17,7 @@ module Decidim
17
17
  # Executes the command. Broadcasts these events:
18
18
  #
19
19
  # - :ok when everything is valid.
20
- # - :invalid if the form wasn't valid and we couldn't proceed.
20
+ # - :invalid if the form was not valid and we could not proceed.
21
21
  #
22
22
  # Returns nothing.
23
23
  def call
@@ -53,6 +53,7 @@ module Decidim
53
53
  organization.omniauth_settings = form.encrypted_omniauth_settings
54
54
  organization.smtp_settings = form.encrypted_smtp_settings
55
55
  organization.file_upload_settings = form.file_upload_settings.final
56
+ organization.content_security_policy = form.content_security_policy
56
57
 
57
58
  organization.save!
58
59
  end
@@ -6,7 +6,7 @@ module Decidim
6
6
  class ApplicationController < ActionController::Base
7
7
  include FormFactory
8
8
  include PayloadInfo
9
- include HttpCachingDisabler
9
+ include Headers::HttpCachingDisabler
10
10
  include DisableRedirectionToExternalHost
11
11
 
12
12
  protect_from_forgery with: :exception, prepend: true
@@ -7,6 +7,7 @@ module Decidim
7
7
 
8
8
  def show
9
9
  @organizations = Organization.all
10
+ @admins = Admin.all
10
11
  end
11
12
 
12
13
  def check_organizations_presence
@@ -9,7 +9,7 @@ module Decidim
9
9
  helper Decidim::OmniauthHelper
10
10
 
11
11
  def new
12
- @form = form(RegisterOrganizationForm).instance
12
+ @form = form(RegisterOrganizationForm).from_params(default_params)
13
13
  @form.file_upload_settings = form(FileUploadSettingsForm).from_model({})
14
14
  end
15
15
 
@@ -18,7 +18,7 @@ module Decidim
18
18
 
19
19
  RegisterOrganization.call(@form) do
20
20
  on(:ok) do
21
- flash[:notice] = t("organizations.create.success", scope: "decidim.system")
21
+ flash[:notice] = t("organizations.create.success_html", scope: "decidim.system", host: @form.host, email: @form.organization_admin_email)
22
22
  redirect_to organizations_path
23
23
  end
24
24
 
@@ -38,8 +38,8 @@ module Decidim
38
38
  end
39
39
 
40
40
  def edit
41
- organization = Organization.find(params[:id])
42
- @form = form(UpdateOrganizationForm).from_model(organization)
41
+ @organization = Organization.find(params[:id])
42
+ @form = form(UpdateOrganizationForm).from_model(@organization)
43
43
  end
44
44
 
45
45
  def update
@@ -58,8 +58,34 @@ module Decidim
58
58
  end
59
59
  end
60
60
 
61
+ def resend_invitation
62
+ organization = Organization.find(params[:id])
63
+ InviteUserAgain.call(organization.users.first, "invite_admin") do
64
+ on(:ok) do
65
+ flash[:notice] = t("organizations.resend_invitation.success", scope: "decidim.system")
66
+ end
67
+
68
+ on(:invalid) do
69
+ flash[:alert] = I18n.t("organizations.resend_invitation.error", scope: "decidim.system")
70
+ end
71
+ end
72
+
73
+ redirect_to organizations_path
74
+ end
75
+
61
76
  private
62
77
 
78
+ def default_params
79
+ {
80
+ host: request.host,
81
+ organization_admin_name: current_admin.email.split("@")[0],
82
+ organization_admin_email: current_admin.email,
83
+ available_locales: Decidim.available_locales.map(&:to_s),
84
+ default_locale: Decidim.default_locale,
85
+ users_registration_mode: "enabled"
86
+ }
87
+ end
88
+
63
89
  # The current organization for the request.
64
90
  #
65
91
  # Returns an Organization.
@@ -22,7 +22,7 @@ module Decidim
22
22
  private
23
23
 
24
24
  def email_uniqueness
25
- return unless Admin.where(email: email).where.not(id: id).any?
25
+ return unless Admin.where(email:).where.not(id:).any?
26
26
 
27
27
  errors.add(:email, I18n.t("models.admin.validations.email_uniqueness",
28
28
  scope: "decidim.system"))
@@ -29,6 +29,18 @@ module Decidim
29
29
  [:authentication, String],
30
30
  [:enable_starttls_auto, Boolean]
31
31
  ]
32
+
33
+ jsonb_attribute :content_security_policy, [
34
+ [:"default-src", String],
35
+ [:"img-src", String],
36
+ [:"media-src", String],
37
+ [:"script-src", String],
38
+ [:"style-src", String],
39
+ [:"frame-src", String],
40
+ [:"font-src", String],
41
+ [:"connect-src", String]
42
+ ]
43
+
32
44
  attribute :password, String
33
45
  attribute :file_upload_settings, FileUploadSettingsForm
34
46
 
@@ -93,8 +105,8 @@ module Decidim
93
105
  private
94
106
 
95
107
  def validate_organization_uniqueness
96
- errors.add(:name, :taken) if Decidim::Organization.where(name: name).where.not(id: id).exists?
97
- errors.add(:host, :taken) if Decidim::Organization.where(host: host).where.not(id: id).exists?
108
+ errors.add(:name, :taken) if Decidim::Organization.where(name:).where.not(id:).exists?
109
+ errors.add(:host, :taken) if Decidim::Organization.where(host:).where.not(id:).exists?
98
110
  end
99
111
  end
100
112
  end
@@ -4,7 +4,7 @@ module Decidim
4
4
  module System
5
5
  # Custom ApplicationJob scoped to the system panel.
6
6
  #
7
- class ApplicationJob < ActiveJob::Base
7
+ class ApplicationJob < Decidim::ApplicationJob
8
8
  end
9
9
  end
10
10
  end
@@ -1,3 +1,5 @@
1
- import "src/decidim/system/application"
2
- import "entrypoints/decidim_system.scss"
3
- import "src/decidim/direct_uploads/upload_field"
1
+ // Images
2
+ require.context("../images", true)
3
+
4
+ // CSS
5
+ import "stylesheets/decidim/system/application.scss"
@@ -1,22 +1,109 @@
1
- $primary-color: null;
2
- $secondary-color: null;
3
- $success-color: null;
4
- $warning-color: null;
5
- $alert-color: null;
6
- $-zf-size: null;
7
- $-zf-bp-value: null;
8
-
9
- @import "stylesheets/decidim/system/foundation_and_overrides";
10
- @import "stylesheets/decidim/system/layout";
11
- @import "stylesheets/decidim/system/login";
12
- @import "stylesheets/decidim/system/sidebar";
13
- @import "stylesheets/decidim/system/tables";
14
- @import "stylesheets/decidim/system/actions";
15
- @import "stylesheets/decidim/system/forms";
16
- @import "stylesheets/decidim/editor";
17
- @import "stylesheets/decidim/utils/fontface";
18
- @import "stylesheets/decidim/modules/upload_modal";
19
-
20
- body{
21
- font-family: 'Source Sans Pro', sans-serif;
1
+ @import "tom-select/dist/scss/tom-select";
2
+
3
+ :root {
4
+ --primary: #e02d2d;
5
+ --primary-rgb: 224 45 45;
6
+ --secondary: #155abf;
7
+ --secondary-rgb: 21 90 191;
8
+ --tertiary: #ebc34b;
9
+ --tertiary-rgb: 235 195 75;
10
+ --success: #28a745;
11
+ --success-rgb: 40 167 69;
12
+ --warning: #ffb703;
13
+ --warning-rgb: 255 183 3;
14
+ --alert: #e7131a;
15
+ --alert-rgb: 231 19 26;
16
+ }
17
+
18
+ aside {
19
+ @apply bg-gray-4 w-full md:w-1/6 min-w-[250px] flex-none text-white relative translate-x-0 transition;
20
+
21
+ &[aria-hidden="true"] {
22
+ @apply absolute -translate-x-full;
23
+ }
24
+ }
25
+
26
+ .main-nav {
27
+ li {
28
+ @apply border-l-2 border-transparent font-semibold hover:bg-black transition;
29
+
30
+ &.active {
31
+ @apply border-primary bg-black;
32
+ }
33
+ }
34
+
35
+ a {
36
+ @apply block p-4;
37
+ }
38
+ }
39
+
40
+ table {
41
+ @apply w-full border-collapse;
42
+
43
+ th {
44
+ @apply font-semibold bg-background;
45
+ }
46
+
47
+ td,
48
+ th {
49
+ @apply p-2 text-center first:text-left;
50
+ }
51
+
52
+ tr:nth-child(even) td {
53
+ @apply bg-gray-3;
54
+ }
55
+
56
+ a {
57
+ @apply text-primary underline;
58
+ }
59
+ }
60
+
61
+ [id^="advanced-settings"] {
62
+ &[aria-expanded="false"] span:first-child,
63
+ &[aria-expanded="true"] span:last-child {
64
+ @apply block;
65
+ }
66
+
67
+ &[aria-expanded="false"] span:last-child,
68
+ &[aria-expanded="true"] span:first-child {
69
+ @apply hidden;
70
+ }
71
+
72
+ &[aria-hidden="true"] {
73
+ @apply hidden;
74
+ }
75
+ }
76
+
77
+ dl {
78
+ dt {
79
+ @apply font-semibold;
80
+ }
81
+
82
+ dd {
83
+ @apply text-gray-2;
84
+ }
85
+
86
+ dt + dd,
87
+ dd + dt {
88
+ @apply mt-4;
89
+ }
90
+ }
91
+
92
+ .flash__message {
93
+ p {
94
+ @apply my-4;
95
+ }
96
+
97
+ ol {
98
+ @apply list-decimal;
99
+ }
100
+ }
101
+
102
+ /* overwrite tom-select defaults */
103
+ .ts-control {
104
+ margin-bottom: 0.5rem;
105
+ }
106
+
107
+ .ts-dropdown {
108
+ margin: 0;
22
109
  }
@@ -1,11 +1,5 @@
1
- <div class="field">
1
+ <div class="form__wrapper">
2
2
  <%= form.text_field :email, autofocus: true %>
3
- </div>
4
-
5
- <div class="field">
6
3
  <%= form.password_field :password %>
7
- </div>
8
-
9
- <div class="field">
10
4
  <%= form.password_field :password_confirmation %>
11
5
  </div>
@@ -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(".update") %>
10
+ <div class="form__wrapper-block">
11
+ <%= f.submit t(".update"), class: "button button__sm md:button__lg button__primary" %>
12
12
  </div>
13
13
  <% end %>
@@ -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>