decidim 0.30.2 → 0.31.0.rc1
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.
- checksums.yaml +4 -4
- data/decidim-core/lib/decidim/{webpacker → shakapacker}/configuration.rb +4 -4
- data/decidim-core/lib/decidim/{webpacker → shakapacker}/runner.rb +3 -3
- data/decidim-core/lib/decidim/shakapacker/shakapacker.rb +8 -0
- data/decidim-core/lib/decidim/{webpacker → shakapacker}/shakapacker.yml +3 -1
- data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/custom.js +1 -1
- data/decidim.gemspec +1 -1
- data/docs/antora.yml +1 -1
- data/docs/modules/configure/pages/environment_variables.adoc +184 -35
- data/docs/modules/configure/pages/index.adoc +2 -3
- data/docs/modules/configure/pages/initializer.adoc +45 -31
- data/docs/modules/configure/pages/system.adoc +3 -3
- data/docs/modules/customize/assets/images/social-share-modal-default.png +0 -0
- data/docs/modules/customize/pages/admin_filters.adoc +2 -2
- data/docs/modules/customize/pages/content_security_policy.adoc +1 -1
- data/docs/modules/customize/pages/images.adoc +1 -1
- data/docs/modules/customize/pages/index.adoc +1 -0
- data/docs/modules/customize/pages/javascript.adoc +5 -18
- data/docs/modules/customize/pages/localization.adoc +75 -0
- data/docs/modules/customize/pages/oauth.adoc +12 -0
- data/docs/modules/customize/pages/social_shares.adoc +0 -3
- data/docs/modules/customize/pages/styles.adoc +3 -16
- data/docs/modules/develop/assets/attachments/grafana/metadecidim-csv.json +1106 -0
- data/docs/modules/develop/assets/attachments/grafana/metadecidim-graphql.json +632 -0
- data/docs/modules/develop/assets/images/grafana/create_account_confirm.png +0 -0
- data/docs/modules/develop/assets/images/grafana/create_account_form.png +0 -0
- data/docs/modules/develop/assets/images/grafana/create_account_setup.png +0 -0
- data/docs/modules/develop/assets/images/grafana/dashboard_example_csv.png +0 -0
- data/docs/modules/develop/assets/images/grafana/dashboard_example_graphql.png +0 -0
- data/docs/modules/develop/assets/images/grafana/dashboard_import.png +0 -0
- data/docs/modules/develop/assets/images/grafana/dashboard_import_csv.png +0 -0
- data/docs/modules/develop/assets/images/grafana/dashboards.png +0 -0
- data/docs/modules/develop/assets/images/grafana/homepage.png +0 -0
- data/docs/modules/develop/pages/api.adoc +12 -2
- data/docs/modules/develop/pages/classes/models.adoc +2 -2
- data/docs/modules/develop/pages/commentable.adoc +9 -11
- data/docs/modules/develop/pages/components.adoc +10 -10
- data/docs/modules/develop/pages/elections.adoc +101 -0
- data/docs/modules/develop/pages/fixing_locales.adoc +7 -12
- data/docs/modules/develop/pages/grafana.adoc +100 -0
- data/docs/modules/develop/pages/likeable.adoc +106 -0
- data/docs/modules/develop/pages/machine_translations.adoc +6 -2
- data/docs/modules/develop/pages/maintainers/releases.adoc +40 -202
- data/docs/modules/develop/pages/maps.adoc +8 -8
- data/docs/modules/develop/pages/modules.adoc +1 -1
- data/docs/modules/develop/pages/notifications.adoc +27 -56
- data/docs/modules/develop/pages/permissions.adoc +19 -19
- data/docs/modules/develop/pages/taxonomies.adoc +1 -15
- data/docs/modules/install/pages/checklist.adoc +2 -1
- data/docs/modules/install/pages/index.adoc +3 -3
- data/docs/modules/install/pages/manual.adoc +5 -5
- data/docs/modules/install/partials/version_matrix.adoc +4 -2
- data/docs/modules/services/pages/aitools.adoc +0 -2
- data/docs/modules/services/pages/etherpad.adoc +5 -20
- data/docs/modules/services/pages/machine_translation.adoc +38 -0
- data/docs/modules/services/pages/maps.adoc +8 -66
- data/docs/modules/services/pages/pdf.adoc +33 -0
- data/docs/modules/services/pages/sms.adoc +6 -7
- data/docs/modules/services/pages/social_providers.adoc +1 -1
- data/docs/modules/services/pages/timestamp.adoc +47 -0
- data/lib/decidim/version.rb +1 -1
- data/package-lock.json +2413 -2624
- data/package.json +3 -2
- data/packages/browserslist-config/package.json +1 -1
- data/packages/core/package.json +2 -3
- data/packages/dev/package.json +2 -2
- data/packages/eslint-config/package.json +1 -1
- data/packages/prettier-config/package.json +1 -1
- data/packages/stylelint-config/package.json +1 -1
- data/packages/webpacker/package.json +3 -2
- data/packages/webpacker/src/loaders/decidim-sass-loader.js +18 -11
- metadata +68 -54
- data/docs/modules/develop/pages/endorsable.adoc +0 -110
- data/docs/modules/develop/pages/guide_migrate_webpacker_app.adoc +0 -257
- data/docs/modules/develop/pages/guide_migrate_webpacker_module.adoc +0 -132
- data/docs/modules/develop/pages/metrics.adoc +0 -123
- data/docs/modules/develop/pages/troubleshooting_metrics.adoc +0 -255
- /data/decidim-core/lib/decidim/{webpacker → shakapacker}/esbuild.config.js +0 -0
- /data/decidim-core/lib/decidim/{webpacker → shakapacker}/postcss.config.js +0 -0
- /data/decidim-core/lib/decidim/{webpacker → shakapacker}/tsconfig.json +0 -0
- /data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/.modernizrrc +0 -0
- /data/decidim-core/lib/decidim/{webpacker → shakapacker}/webpack/webpack.config.js +0 -0
@@ -21,6 +21,7 @@ Inside of your application you can customize it in different ways:
|
|
21
21
|
* xref:customize:gemfile.adoc[Gemfile]
|
22
22
|
* xref:customize:images.adoc[Images]
|
23
23
|
* xref:customize:javascript.adoc[JavaScript]
|
24
|
+
* xref:customize:localization.adoc[Localization]
|
24
25
|
* xref:customize:logic.adoc[Logic]
|
25
26
|
* xref:customize:menu.adoc[Menu]
|
26
27
|
* xref:customize:admin_filters.adoc[Admin filters]
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
You can add JavaScript code by multiple ways in Decidim:
|
4
4
|
|
5
|
-
==
|
5
|
+
== Shakapacker
|
6
6
|
|
7
|
-
Decidim uses Webpack (via
|
7
|
+
Decidim uses Webpack (via Shakapacker) to compile assets, including javascript.
|
8
8
|
|
9
9
|
During the generation of a decidim app, the file `app/packs/src/decidim/decidim_application.js` is created and hooked to Decidim packs, so any javascript written there is compiled within Decidim assets. For example to create a new alert just add:
|
10
10
|
|
@@ -36,24 +36,11 @@ $(function(){
|
|
36
36
|
== Custom HTML Header snippets
|
37
37
|
|
38
38
|
If you need changes on a multitenant installation, you can do so by enabling a configuration
|
39
|
-
|
39
|
+
using your environment variables. Please do notice that this has security implications:
|
40
40
|
|
41
|
-
[source,
|
41
|
+
[source,bash]
|
42
42
|
----
|
43
|
-
|
44
|
-
#
|
45
|
-
# The most common use is to integrate third-party services that require some
|
46
|
-
# extra JavaScript or CSS. Also, you can use it to add extra meta tags to the
|
47
|
-
# HTML. Note that this will only be rendered in public pages, not in the admin
|
48
|
-
# section.
|
49
|
-
#
|
50
|
-
# Before enabling this you should ensure that any tracking that might be done
|
51
|
-
# is in accordance with the rules and regulations that apply to your
|
52
|
-
# environment and usage scenarios. This feature also comes with the risk
|
53
|
-
# that an organization's administrator injects malicious scripts to spy on or
|
54
|
-
# take over user accounts.
|
55
|
-
#
|
56
|
-
config.enable_html_header_snippets = true
|
43
|
+
export DECIDIM_ENABLE_HTML_HEADER_SNIPPETS=true
|
57
44
|
----
|
58
45
|
|
59
46
|
Then you will have a new textarea field called "Header snippets" in Administration -> Configuration -> Appearance (URL `/admin/organization/appearance/edit`):
|
@@ -0,0 +1,75 @@
|
|
1
|
+
= Localization
|
2
|
+
|
3
|
+
Depending on your country, you might want to adapt some details in the configuration.
|
4
|
+
|
5
|
+
Some are defined in the locales (your language configuration). If this is the same in all the countries that speak your language, then you can change it directly in the translations. You can read more about xref:contribute:translations.adoc[how to contribute translations to Decidim]).
|
6
|
+
If the changes that you need are only for your country or your installation, then you need to configure it on your application. This page explains how to do that.
|
7
|
+
|
8
|
+
== Date and time formats
|
9
|
+
|
10
|
+
These are defined in the YAML. You can read more about this in the link:https://guides.rubyonrails.org/i18n.html[Rails Internationalization (i18n) API] and also in the xref:customize:texts.adoc[Texts] page.
|
11
|
+
|
12
|
+
The following keys are relevant to time and date format:
|
13
|
+
|
14
|
+
```yaml
|
15
|
+
date:
|
16
|
+
formats:
|
17
|
+
decidim_short: "%d/%m/%Y"
|
18
|
+
decidim_short_dashed: "%d-%m-%Y"
|
19
|
+
decidim_short_with_month_name_short: "%d %b %Y"
|
20
|
+
decidim_with_day_and_month_name: "%A %d %b %Y"
|
21
|
+
decidim_with_month_name: "%d %B %Y"
|
22
|
+
decidim_with_month_name_short: "%d %b"
|
23
|
+
help:
|
24
|
+
date_format: 'Format: dd/mm/yyyy'
|
25
|
+
order: d-m-y
|
26
|
+
separator: "/"
|
27
|
+
```
|
28
|
+
|
29
|
+
If you need to change the format to comply with the United States of America standard, you must do the following:
|
30
|
+
|
31
|
+
. Create or update the file `config/locales/en.yml` in your generated application.
|
32
|
+
. Add the following snippet:
|
33
|
+
```yaml
|
34
|
+
en:
|
35
|
+
date:
|
36
|
+
formats:
|
37
|
+
decidim_short: "%m/%d/%Y"
|
38
|
+
decidim_short_dashed: "%m-%d-%Y"
|
39
|
+
decidim_short_with_month_name_short: "%b %d %Y"
|
40
|
+
decidim_with_day_and_month_name: "%A, %b %d %Y"
|
41
|
+
decidim_with_month_name: "%B %d %Y"
|
42
|
+
decidim_with_month_name_short: "%b %d"
|
43
|
+
help:
|
44
|
+
date_format: 'Format: mm/dd/yyyy'
|
45
|
+
order: m-d-y
|
46
|
+
separator: "/"
|
47
|
+
```
|
48
|
+
. Restart your application server.
|
49
|
+
|
50
|
+
Note that in the case of the `order` value, currently it only supports two values:
|
51
|
+
|
52
|
+
- `m-d-y`
|
53
|
+
- `d-m-y`
|
54
|
+
|
55
|
+
== Currency unit
|
56
|
+
|
57
|
+
If you are using the xref:admin:components/budgets.adoc[Budget] component or the xref:admin:components/proposals/answers.adoc[Proposals' answers with costs] feature, you may want to change the `DECIDIM_CURRENCY_UNIT` environment variable to a currency other than the default Euro (€). Read more about how to customize xref:configure:environment_variables.adoc[Environment Variables].
|
58
|
+
|
59
|
+
If you want to control where the currency unit (like `€`) and the number (like `999`) is shown, then you can do that by changing the order of the values %u and %n (for unit and number respectively).
|
60
|
+
|
61
|
+
```yaml
|
62
|
+
en:
|
63
|
+
number:
|
64
|
+
currency:
|
65
|
+
format:
|
66
|
+
format: "%u %n"
|
67
|
+
html_format: "<span>%u</span> %n"
|
68
|
+
```
|
69
|
+
|
70
|
+
Some examples:
|
71
|
+
|
72
|
+
- "%u %n" -> Shows it as € 999
|
73
|
+
- "%n%u"-> Shows it as 999€
|
74
|
+
|
75
|
+
The `html_format` key is used in the budgets component to style better the unit.
|
@@ -30,4 +30,16 @@ ActiveSupport::Notifications.subscribe "decidim.user.omniauth_registration" do |
|
|
30
30
|
end
|
31
31
|
----
|
32
32
|
|
33
|
+
Note that, if the user is already registered, the `CreateOmniauthRegistration` command will not trigger the "decidim.user.omniauth_registration" event by instead it will trigger the "decidim.user.omniauth_login" event, which has the same payload as the registration event.
|
34
|
+
|
35
|
+
For instance, to retrigger the `IdCatMobilVerificationJob` after a user logs in via omniauth, you can subscribe to the "decidim.user.omniauth_login" event as follows:
|
36
|
+
|
37
|
+
[source,ruby]
|
38
|
+
----
|
39
|
+
ActiveSupport::Notifications.subscribe "decidim.user.omniauth_login" do |name, started, finished, unique_id, data|
|
40
|
+
puts "the data: #{data.inspect}"
|
41
|
+
IdCatMobilVerificationJob.perform_later(data[:raw_data])
|
42
|
+
end
|
43
|
+
----
|
44
|
+
|
33
45
|
It is a good practice to delegate the required implementation to a Job to bring a fastest response to the user, also it will avoid that crashes in this code to propagate to the registration process.
|
@@ -44,15 +44,12 @@ If you have the need, you can enable your own service. To do that, as an example
|
|
44
44
|
|
45
45
|
. Alternatively, you can provide any https://remixicon.com/ logo also. Simply as adding the icon key for such social share, e.g. "reddit-line"
|
46
46
|
|
47
|
-
. In addition to the remixicon, icon_color property can be added, using an Hex color, e.g. "#ff4500"
|
48
|
-
|
49
47
|
. Add the social share service block configuration at the bottom of your Decidim initializer:
|
50
48
|
|
51
49
|
[source,ruby]
|
52
50
|
----
|
53
51
|
Decidim.register_social_share_service("Foo") do |service|
|
54
52
|
service.icon = "foo.svg" # (or "reddit-line")
|
55
|
-
service.icon_color = "#ff4500"
|
56
53
|
service.share_uri = "https://foo.example.com/share?url=%{url}"
|
57
54
|
end
|
58
55
|
----
|
@@ -24,24 +24,11 @@ There is an special partial file for adding inline content in every public page.
|
|
24
24
|
== Custom HTML Header snippets
|
25
25
|
|
26
26
|
If you need changes on a multitenant installation, you can do so by enabling a configuration
|
27
|
-
|
27
|
+
using your environment variables. Please do notice that this has security implications:
|
28
28
|
|
29
|
-
[source,
|
29
|
+
[source,bash]
|
30
30
|
----
|
31
|
-
|
32
|
-
#
|
33
|
-
# The most common use is to integrate third-party services that require some
|
34
|
-
# extra JavaScript or CSS. Also, you can use it to add extra meta tags to the
|
35
|
-
# HTML. Note that this will only be rendered in public pages, not in the admin
|
36
|
-
# section.
|
37
|
-
#
|
38
|
-
# Before enabling this you should ensure that any tracking that might be done
|
39
|
-
# is in accordance with the rules and regulations that apply to your
|
40
|
-
# environment and usage scenarios. This feature also comes with the risk
|
41
|
-
# that an organization's administrator injects malicious scripts to spy on or
|
42
|
-
# take over user accounts.
|
43
|
-
#
|
44
|
-
config.enable_html_header_snippets = true
|
31
|
+
export DECIDIM_ENABLE_HTML_HEADER_SNIPPETS=true
|
45
32
|
----
|
46
33
|
|
47
34
|
Then you will have a new textarea field called "Header snippets" in Administration -> Configuration -> Appearance (URL `/admin/organization/appearance/edit`):
|