decidim-system 0.27.4 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -7
- data/app/commands/decidim/system/create_admin.rb +1 -1
- data/app/commands/decidim/system/create_default_content_blocks.rb +1 -14
- data/app/commands/decidim/system/create_default_pages.rb +23 -4
- data/app/commands/decidim/system/populate_help.rb +2 -2
- data/app/commands/decidim/system/register_organization.rb +15 -2
- data/app/commands/decidim/system/update_admin.rb +1 -1
- data/app/commands/decidim/system/update_organization.rb +2 -1
- data/app/controllers/decidim/system/application_controller.rb +2 -1
- data/app/controllers/decidim/system/dashboard_controller.rb +1 -0
- data/app/controllers/decidim/system/organizations_controller.rb +30 -4
- data/app/forms/decidim/system/admin_form.rb +2 -2
- data/app/forms/decidim/system/update_organization_form.rb +14 -2
- data/app/jobs/decidim/system/application_job.rb +1 -1
- data/app/packs/entrypoints/decidim_system.js +5 -3
- data/app/packs/stylesheets/decidim/system/application.scss +108 -21
- data/app/views/decidim/system/admins/_form.html.erb +1 -7
- data/app/views/decidim/system/admins/edit.html.erb +5 -3
- data/app/views/decidim/system/admins/index.html.erb +5 -31
- data/app/views/decidim/system/admins/new.html.erb +5 -3
- data/app/views/decidim/system/dashboard/show.html.erb +15 -3
- data/app/views/decidim/system/devise/mailers/password_change.html.erb +1 -1
- data/app/views/decidim/system/devise/mailers/reset_password_instructions.html.erb +2 -2
- data/app/views/decidim/system/devise/passwords/edit.html.erb +6 -9
- data/app/views/decidim/system/devise/passwords/new.html.erb +5 -5
- data/app/views/decidim/system/devise/sessions/new.html.erb +10 -12
- data/app/views/decidim/system/devise/shared/_links.html.erb +5 -11
- data/app/views/decidim/system/oauth_applications/_form.html.erb +5 -20
- data/app/views/decidim/system/oauth_applications/edit.html.erb +11 -11
- data/app/views/decidim/system/oauth_applications/index.html.erb +8 -8
- data/app/views/decidim/system/oauth_applications/new.html.erb +11 -11
- data/app/views/decidim/system/oauth_applications/show.html.erb +22 -23
- data/app/views/decidim/system/organizations/_advanced_settings.html.erb +10 -8
- data/app/views/decidim/system/organizations/_csp_settings.html.erb +12 -0
- data/app/views/decidim/system/organizations/_file_upload_settings.erb +23 -46
- data/app/views/decidim/system/organizations/_omniauth_provider.html.erb +13 -16
- data/app/views/decidim/system/organizations/_omniauth_settings.html.erb +6 -8
- data/app/views/decidim/system/organizations/_smtp_settings.html.erb +12 -22
- data/app/views/decidim/system/organizations/edit.html.erb +35 -26
- data/app/views/decidim/system/organizations/index.html.erb +5 -4
- data/app/views/decidim/system/organizations/new.html.erb +34 -45
- data/app/views/decidim/system/shared/_admins_list.html.erb +27 -0
- data/app/views/decidim/system/shared/_notices.html.erb +4 -6
- data/app/views/decidim/system/shared/_organizations_list.html.erb +10 -3
- data/app/views/layouts/decidim/system/_header.html.erb +2 -2
- data/app/views/layouts/decidim/system/_login_items.html.erb +3 -7
- data/app/views/layouts/decidim/system/_sidebar.html.erb +3 -7
- data/app/views/layouts/decidim/system/application.html.erb +27 -30
- data/app/views/layouts/decidim/system/login.html.erb +10 -9
- data/config/locales/ar.yml +0 -14
- data/config/locales/bg.yml +0 -1
- data/config/locales/ca.yml +96 -12
- data/config/locales/cs.yml +97 -12
- data/config/locales/de.yml +92 -15
- data/config/locales/el.yml +9 -12
- data/config/locales/en.yml +97 -12
- data/config/locales/es-MX.yml +97 -12
- data/config/locales/es-PY.yml +97 -12
- data/config/locales/es.yml +97 -12
- data/config/locales/eu.yml +112 -27
- data/config/locales/fi-plain.yml +96 -12
- data/config/locales/fi.yml +96 -12
- data/config/locales/fr-CA.yml +65 -12
- data/config/locales/fr.yml +81 -12
- data/config/locales/ga-IE.yml +0 -2
- data/config/locales/gl.yml +0 -14
- data/config/locales/hu.yml +19 -11
- data/config/locales/id-ID.yml +0 -11
- data/config/locales/is-IS.yml +0 -4
- data/config/locales/it.yml +0 -14
- data/config/locales/ja.yml +64 -12
- data/config/locales/lt.yml +19 -12
- data/config/locales/lv.yml +0 -11
- data/config/locales/nl.yml +0 -13
- data/config/locales/no.yml +0 -14
- data/config/locales/pl.yml +0 -14
- data/config/locales/pt-BR.yml +0 -14
- data/config/locales/pt.yml +0 -14
- data/config/locales/ro-RO.yml +3 -13
- data/config/locales/ru.yml +0 -11
- data/config/locales/sk.yml +0 -11
- data/config/locales/sl.yml +0 -8
- data/config/locales/sq-AL.yml +1 -0
- data/config/locales/sv.yml +0 -14
- data/config/locales/th-TH.yml +1 -0
- data/config/locales/tr-TR.yml +3 -14
- data/config/locales/uk.yml +0 -10
- data/config/locales/zh-CN.yml +0 -12
- data/config/locales/zh-TW.yml +8 -11
- data/config/routes.rb +6 -2
- data/db/seeds.rb +1 -1
- data/lib/decidim/system/engine.rb +2 -25
- data/lib/decidim/system/menu.rb +35 -0
- data/lib/decidim/system/version.rb +1 -1
- data/lib/tasks/decidim_system.rake +1 -1
- metadata +28 -25
- data/app/packs/entrypoints/decidim_system.scss +0 -1
- data/app/packs/src/decidim/system/application.js +0 -41
- data/app/packs/stylesheets/decidim/system/_actions.scss +0 -8
- data/app/packs/stylesheets/decidim/system/_forms.scss +0 -36
- data/app/packs/stylesheets/decidim/system/_foundation_and_overrides.scss +0 -53
- data/app/packs/stylesheets/decidim/system/_layout.scss +0 -18
- data/app/packs/stylesheets/decidim/system/_login.scss +0 -37
- data/app/packs/stylesheets/decidim/system/_settings.scss +0 -569
- data/app/packs/stylesheets/decidim/system/_sidebar.scss +0 -83
- data/app/packs/stylesheets/decidim/system/_tables.scss +0 -6
- data/app/views/decidim/system/admins/show.html.erb +0 -9
- data/app/views/decidim/system/organizations/show.html.erb +0 -10
- data/config/environment.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70370fff5369d1099a226723a77145a27c19ee6ff1e214ff4bb6d8fc445934bd
|
4
|
+
data.tar.gz: 9d38c13b4de6dc0348aeeb2d38038e73241aebf162f967aa2d706e57f20f856c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
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
|
22
|
-
|
23
|
-
page.
|
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-
|
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
|
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
|
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
|
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
|
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
|
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,11 +6,12 @@ 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
|
13
13
|
|
14
|
+
helper Decidim::MetaTagsHelper
|
14
15
|
helper Decidim::TranslationsHelper
|
15
16
|
helper Decidim::DecidimFormHelper
|
16
17
|
helper Decidim::ReplaceButtonsHelper
|
@@ -9,7 +9,7 @@ module Decidim
|
|
9
9
|
helper Decidim::OmniauthHelper
|
10
10
|
|
11
11
|
def new
|
12
|
-
@form = form(RegisterOrganizationForm).
|
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.
|
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.
|
@@ -12,7 +12,7 @@ module Decidim
|
|
12
12
|
attribute :password_confirmation, String
|
13
13
|
|
14
14
|
validates :email, presence: true
|
15
|
-
validates :password, presence: true, unless: :admin_exists?
|
15
|
+
validates :password, confirmation: true, presence: true, unless: :admin_exists?
|
16
16
|
validates :password_confirmation, presence: true, unless: :admin_exists?
|
17
17
|
|
18
18
|
validates :password, password: { email: :email }
|
@@ -22,7 +22,7 @@ module Decidim
|
|
22
22
|
private
|
23
23
|
|
24
24
|
def email_uniqueness
|
25
|
-
return unless Admin.where(email:
|
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:
|
97
|
-
errors.add(:host, :taken) if Decidim::Organization.where(host:
|
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
|
@@ -1,22 +1,109 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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="
|
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,11 +1,13 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
|
1
3
|
<% provide :title do %>
|
2
|
-
<
|
4
|
+
<h1 class="h1"><%= t ".title" %></h1>
|
3
5
|
<% end %>
|
4
6
|
|
5
7
|
<%= decidim_form_for(@form) do |f| %>
|
6
8
|
<%= render partial: "form", object: f %>
|
7
9
|
|
8
|
-
<div class="
|
9
|
-
<%= f.submit t(".update") %>
|
10
|
+
<div class="form__wrapper-block">
|
11
|
+
<%= f.submit t(".update"), class: "button button__sm md:button__lg button__primary" %>
|
10
12
|
</div>
|
11
13
|
<% end %>
|
@@ -1,35 +1,9 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
|
1
3
|
<% provide :title do %>
|
2
|
-
<
|
4
|
+
<h1 class="h1"><%= t ".title" %></h1>
|
3
5
|
<% end %>
|
4
6
|
|
5
|
-
|
6
|
-
<%= link_to t("actions.new", scope: "decidim.system", name: t("models.admin.name", scope: "decidim.system")), [:new, :admin], class: "new" %>
|
7
|
-
</div>
|
7
|
+
<%= link_to t("actions.new_admin", scope: "decidim.system"), [:new, :admin], class: "button button__sm md:button__lg button__primary" %>
|
8
8
|
|
9
|
-
|
10
|
-
<thead>
|
11
|
-
<tr>
|
12
|
-
<th><%= t("models.admin.fields.email", scope: "decidim.system") %></th>
|
13
|
-
<th><%= t("models.admin.fields.created_at", scope: "decidim.system") %></th>
|
14
|
-
<th class="actions"><%= t("actions.title", scope: "decidim.system") %></th>
|
15
|
-
</tr>
|
16
|
-
</thead>
|
17
|
-
<tbody>
|
18
|
-
<% @admins.each do |admin| %>
|
19
|
-
<tr>
|
20
|
-
<td>
|
21
|
-
<%= link_to admin.email, admin %><br>
|
22
|
-
</td>
|
23
|
-
<td>
|
24
|
-
<%= l admin.created_at, format: :short %>
|
25
|
-
</td>
|
26
|
-
<td class="actions">
|
27
|
-
<%= link_to t("actions.edit", scope: "decidim.system"), [:edit, admin] %>
|
28
|
-
<% unless current_admin?(admin) %>
|
29
|
-
<%= link_to t("actions.destroy", scope: "decidim.system"), admin, method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.system") } %>
|
30
|
-
<% end %>
|
31
|
-
</td>
|
32
|
-
</tr>
|
33
|
-
<% end %>
|
34
|
-
</tbody>
|
35
|
-
</table>
|
9
|
+
<%= render partial: "decidim/system/shared/admins_list", locals: { admins: @admins } %>
|
@@ -1,11 +1,13 @@
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
|
1
3
|
<% provide :title do %>
|
2
|
-
<
|
4
|
+
<h1 class="h1"><%= t ".title" %></h1>
|
3
5
|
<% end %>
|
4
6
|
|
5
7
|
<%= decidim_form_for(@form) do |f| %>
|
6
8
|
<%= render partial: "form", object: f %>
|
7
9
|
|
8
|
-
<div class="
|
9
|
-
<%= f.submit t(".create") %>
|
10
|
+
<div class="form__wrapper-block">
|
11
|
+
<%= f.submit t(".create"), class: "button button__sm md:button__lg button__primary" %>
|
10
12
|
</div>
|
11
13
|
<% end %>
|
@@ -1,5 +1,17 @@
|
|
1
|
+
<% add_decidim_page_title(t("decidim.system.titles.dashboard")) %>
|
2
|
+
|
1
3
|
<% provide :title do %>
|
2
|
-
<
|
3
|
-
<h3><%= t ".current_organizations" %></h3>
|
4
|
-
<%= render partial: "decidim/system/shared/organizations_list", locals: { organizations: @organizations } %>
|
4
|
+
<h1 class="h1"><%= t("decidim.system.titles.dashboard") %></h1>
|
5
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 } %>
|
@@ -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
|
8
|
-
<p>Your password
|
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>
|