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
@@ -4,8 +4,8 @@ In order to develop on decidim, you will need:
|
|
4
4
|
|
5
5
|
* *Git* 2.34+
|
6
6
|
* *PostgreSQL* 17.4+
|
7
|
-
* *Ruby* 3.
|
8
|
-
* *NodeJS*
|
7
|
+
* *Ruby* 3.3.0
|
8
|
+
* *NodeJS* 22.14.x
|
9
9
|
* *Npm* 10.9.x
|
10
10
|
* *ImageMagick*
|
11
11
|
* *Chrome* browser and https://sites.google.com/a/chromium.org/chromedriver/[chromedriver] (if you need to run specs/tests)
|
@@ -33,8 +33,8 @@ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
|
|
33
33
|
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
|
34
34
|
source ~/.bashrc
|
35
35
|
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
|
36
|
-
rbenv install 3.
|
37
|
-
rbenv global 3.
|
36
|
+
rbenv install 3.3.0
|
37
|
+
rbenv global 3.3.0
|
38
38
|
----
|
39
39
|
|
40
40
|
== 2. Installing PostgreSQL
|
@@ -57,7 +57,7 @@ An important component for Decidim is Node.js and Yarn. With this commands you w
|
|
57
57
|
----
|
58
58
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
|
59
59
|
source "$HOME/.nvm/nvm.sh"
|
60
|
-
nvm install
|
60
|
+
nvm install 24
|
61
61
|
npm install -g yarn
|
62
62
|
----
|
63
63
|
|
@@ -2,11 +2,13 @@
|
|
2
2
|
|===
|
3
3
|
|Decidim version |Ruby version |Node version | Status
|
4
4
|
|
5
|
-
|develop | 3.3.4 |
|
5
|
+
|develop | 3.3.4 | 22.14.x | Unreleased
|
6
|
+
|
7
|
+
|v0.30 | 3.3.4 | 18.17.x | Bug fixes and security updates
|
6
8
|
|
7
9
|
|v0.29 | 3.2.2 | 18.17.x | Bug fixes and security updates
|
8
10
|
|
9
|
-
|v0.28 | 3.1.1 | 18.17.x |
|
11
|
+
|v0.28 | 3.1.1 | 18.17.x | Not maintained
|
10
12
|
|
11
13
|
|v0.27 | 3.0.2 | 16.18.x | Security updates
|
12
14
|
|
@@ -72,7 +72,6 @@ Decidim::Ai::SpamDetection.resource_models = {
|
|
72
72
|
"Decidim::Meetings::Meeting" => "Decidim::Ai::SpamDetection::Resource::Meeting",
|
73
73
|
"Decidim::Proposals::Proposal" => "Decidim::Ai::SpamDetection::Resource::Proposal",
|
74
74
|
"Decidim::Proposals::CollaborativeDraft" => "Decidim::Ai::SpamDetection::Resource::CollaborativeDraft",
|
75
|
-
"Decidim::UserGroup" => "Decidim::Ai::SpamDetection::Resource::UserBaseEntity",
|
76
75
|
"Decidim::User" => "Decidim::Ai::SpamDetection::Resource::UserBaseEntity"
|
77
76
|
}
|
78
77
|
|
@@ -110,7 +109,6 @@ Decidim::Ai::SpamDetection.user_analyzers = [
|
|
110
109
|
# override what we register by default, or to register your own resources.
|
111
110
|
# Follow the documentation on how to trail more resources
|
112
111
|
Decidim::Ai::SpamDetection.user_models = {
|
113
|
-
"Decidim::UserGroup" => "Decidim::Ai::SpamDetection::Resource::UserBaseEntity",
|
114
112
|
"Decidim::User" => "Decidim::Ai::SpamDetection::Resource::UserBaseEntity"
|
115
113
|
}
|
116
114
|
|
@@ -18,28 +18,13 @@ docker swarm init # just one time
|
|
18
18
|
docker stack deploy --compose-file docker-compose-etherpad.yml decidim-etherpad
|
19
19
|
----
|
20
20
|
|
21
|
-
After deploying Etherpad, you should get back to Decidim's server and set the Etherpad host and API Key
|
22
|
-
`config/initializers/decidim.rb` and `config/secrets.yml`
|
21
|
+
After deploying Etherpad, you should get back to Decidim's server and set the Etherpad host and API Key using the xref:configure:environment_variables.adoc[environment variables].
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
[source,ruby]
|
27
|
-
----
|
28
|
-
config.etherpad = {
|
29
|
-
server: Rails.application.secrets.etherpad[:server],
|
30
|
-
api_key: Rails.application.secrets.etherpad[:api_key],
|
31
|
-
api_version: Rails.application.secrets.etherpad[:api_version]
|
32
|
-
}
|
33
|
-
----
|
34
|
-
|
35
|
-
and then in `config/secrets.yml`:
|
36
|
-
|
37
|
-
[source,yaml]
|
23
|
+
[source,console]
|
38
24
|
----
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
api_version: <%= ENV["ETHERPAD_API_VERSION"] %>
|
25
|
+
export ETHERPAD_SERVER=...
|
26
|
+
export ETHERPAD_API_KEY=....
|
27
|
+
export ETHERPAD_API_VERSION=...
|
43
28
|
----
|
44
29
|
|
45
30
|
== How is Etherpad Lite integrated in Meetings?
|
@@ -0,0 +1,38 @@
|
|
1
|
+
= Machine Translations
|
2
|
+
|
3
|
+
To enable machine translations you need to enable the service and specify the class used for translation (this usually is the one contacting an external API from a 3d party service that actually translates the string).
|
4
|
+
|
5
|
+
[source,ruby]
|
6
|
+
....
|
7
|
+
class MyTranslationService
|
8
|
+
attr_reader :text, :source_locale, :target_locale, :resource, :field_name
|
9
|
+
|
10
|
+
def initialize(resource, field_name, text, target_locale, source_locale)
|
11
|
+
@resource = resource
|
12
|
+
@field_name = field_name
|
13
|
+
@text = text
|
14
|
+
@target_locale = target_locale
|
15
|
+
@source_locale = source_locale
|
16
|
+
end
|
17
|
+
|
18
|
+
def translate
|
19
|
+
# Actual code to translate the text
|
20
|
+
end
|
21
|
+
end
|
22
|
+
....
|
23
|
+
|
24
|
+
The arguments provided for the initialize method are:
|
25
|
+
|
26
|
+
- `resource` - The object of the resource that being translated (ex: a `Decidim::Meetings::Meeting` instance )
|
27
|
+
- `field_name` - The name of the field that is being translated (ex: "title")
|
28
|
+
- `text` - The text that is going to be translated (ex: "This meeting is great" )
|
29
|
+
- `target_locale` - The language in which you want to translate ( ex: "ca" )
|
30
|
+
- `source_locale` - The language in which the content has been created (ex: "en")
|
31
|
+
|
32
|
+
Then you will need to configure it with the help of Environment Variables:
|
33
|
+
|
34
|
+
[source,bash]
|
35
|
+
....
|
36
|
+
export DECIDIM_ENABLE_MACHINE_TRANSLATION="true"
|
37
|
+
export DECIDIM_MACHINE_TRANSLATION_SERVICE="MyTranslator"
|
38
|
+
....
|
@@ -26,56 +26,20 @@ If you want to integrate Decidim to some other map service provider, read how to
|
|
26
26
|
|
27
27
|
== Configuring maps and geocoding
|
28
28
|
|
29
|
-
After generating your app, you will
|
29
|
+
After generating your app, you will need to configure the maps service by setting your environment variables.
|
30
30
|
|
31
|
-
[source,ruby]
|
32
|
-
----
|
33
|
-
# Map and Geocoder configuration
|
34
|
-
# config.maps = {
|
35
|
-
# ...
|
36
|
-
# }
|
37
|
-
----
|
38
|
-
|
39
|
-
The initializer comments provide examples for the services mentioned in this documentation.
|
40
31
|
Please refer to the section below for the service you have registered for the maps functionality.
|
41
32
|
|
42
33
|
If you want to enable geocoding in your app:
|
43
34
|
|
44
35
|
. Select a service provider for the maps functionality and register an account with that provider
|
45
|
-
.
|
46
|
-
. Make sure your `config/secrets.yml` file has the needed section (it should be added by the generator automatically).
|
47
|
-
. Configure the service provider credentials in `config/secrets.yml` and refer to them from your `config/initializers/decidim.rb`.
|
36
|
+
. Set the `MAPS_GEOCODING_HOST` environment variable, or, if the setup is more complex, customize using the initializer.
|
48
37
|
. If you had your Rails server running, restart it so the changes apply.
|
49
38
|
|
50
39
|
=== Configuring HERE Maps
|
51
40
|
|
52
41
|
Use the following configuration for HERE Maps:
|
53
42
|
|
54
|
-
`config/initializers/decidim.rb`:
|
55
|
-
|
56
|
-
[source,ruby]
|
57
|
-
----
|
58
|
-
# Map and Geocoder configuration
|
59
|
-
# == HERE Maps ==
|
60
|
-
config.maps = {
|
61
|
-
provider: :here,
|
62
|
-
api_key: Rails.application.secrets.maps[:api_key],
|
63
|
-
static: { url: "https://image.maps.hereapi.com/mia/v3/base/mc/overlay" }
|
64
|
-
}
|
65
|
-
----
|
66
|
-
|
67
|
-
`config/secrets.yml`:
|
68
|
-
|
69
|
-
[source,yaml]
|
70
|
-
----
|
71
|
-
default: &default
|
72
|
-
# ...
|
73
|
-
maps:
|
74
|
-
api_key: <%= ENV["MAPS_API_KEY"] %>
|
75
|
-
----
|
76
|
-
|
77
|
-
`.env`:
|
78
|
-
|
79
43
|
[source,bash]
|
80
44
|
----
|
81
45
|
MAPS_PROVIDER=here
|
@@ -84,9 +48,7 @@ MAPS_API_KEY=your_api_key_here
|
|
84
48
|
|
85
49
|
=== Configuring Open Street Maps based service providers
|
86
50
|
|
87
|
-
Use the following configuration for Open Street Maps based service providers:
|
88
|
-
|
89
|
-
`config/initializers/decidim.rb`:
|
51
|
+
Use the following configuration for Open Street Maps based service providers, by creating your xref:configure:initializer.adoc[initializer]:
|
90
52
|
|
91
53
|
[source,ruby]
|
92
54
|
----
|
@@ -94,7 +56,7 @@ Use the following configuration for Open Street Maps based service providers:
|
|
94
56
|
# == OpenStreetMap (OSM) services ==
|
95
57
|
config.maps = {
|
96
58
|
provider: :osm,
|
97
|
-
api_key:
|
59
|
+
api_key: ENV["MAPS_API_KEY"],
|
98
60
|
dynamic: {
|
99
61
|
tile_layer: {
|
100
62
|
url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}",
|
@@ -112,16 +74,6 @@ config.maps = {
|
|
112
74
|
}
|
113
75
|
----
|
114
76
|
|
115
|
-
`config/secrets.yml`:
|
116
|
-
|
117
|
-
[source,yaml]
|
118
|
-
----
|
119
|
-
default: &default
|
120
|
-
# ...
|
121
|
-
maps:
|
122
|
-
api_key: <%= ENV["MAPS_API_KEY"] %>
|
123
|
-
----
|
124
|
-
|
125
77
|
`.env`:
|
126
78
|
|
127
79
|
[source,bash]
|
@@ -134,7 +86,7 @@ For further information, see the service provider's documentation or take a look
|
|
134
86
|
=== Combining multiple service providers
|
135
87
|
|
136
88
|
It is also possible to combine multiple service providers for the different categories of map services.
|
137
|
-
For instance, if you want to use HERE Maps for the map tiles but host the other services yourself, use the following configuration:
|
89
|
+
For instance, if you want to use HERE Maps for the map tiles but host the other services yourself, use the following configuration, that can be added only in an initializer:
|
138
90
|
|
139
91
|
[source,ruby]
|
140
92
|
----
|
@@ -144,7 +96,7 @@ config.maps = {
|
|
144
96
|
provider: :osm,
|
145
97
|
dynamic: {
|
146
98
|
provider: :here,
|
147
|
-
api_key:
|
99
|
+
api_key: ENV["MAPS_API_KEY"]
|
148
100
|
},
|
149
101
|
static: { url: "https://staticmap.example.org/" },
|
150
102
|
geocoding: { host: "nominatim.example.org", use_https: true },
|
@@ -152,16 +104,6 @@ config.maps = {
|
|
152
104
|
}
|
153
105
|
----
|
154
106
|
|
155
|
-
`config/secrets.yml`:
|
156
|
-
|
157
|
-
[source,yaml]
|
158
|
-
----
|
159
|
-
default: &default
|
160
|
-
# ...
|
161
|
-
maps:
|
162
|
-
here_api_key: <%= ENV["MAPS_HERE_API_KEY"] %>
|
163
|
-
----
|
164
|
-
|
165
107
|
`.env`:
|
166
108
|
|
167
109
|
[source,bash]
|
@@ -181,7 +123,7 @@ For example, if you want to use HERE Maps as your default but disable the static
|
|
181
123
|
----
|
182
124
|
config.maps = {
|
183
125
|
provider: :here,
|
184
|
-
api_key:
|
126
|
+
api_key: ENV["MAPS_API_KEY"],
|
185
127
|
static: false,
|
186
128
|
autocomplete: false
|
187
129
|
}
|
@@ -191,7 +133,7 @@ Decidim works fine when some of the services are disabled individually but obvio
|
|
191
133
|
|
192
134
|
=== Global geocoder configurations
|
193
135
|
|
194
|
-
In
|
136
|
+
In order to fully customize the geocoding service, you may need to create the xref:configure:initializer.adoc[initializer] file, and customize your config as follows:
|
195
137
|
|
196
138
|
[source,ruby]
|
197
139
|
----
|
@@ -0,0 +1,33 @@
|
|
1
|
+
= PDF signature service
|
2
|
+
|
3
|
+
Used by `decidim-initiatives` and `decidim-budgets`.
|
4
|
+
|
5
|
+
Provide a class to process a pdf and return the document including a digital signature. The instances of this class are initialized with a hash containing the :pdf key with the pdf file content as value. The instances respond to a signed_pdf method containing the pdf with the signature.
|
6
|
+
|
7
|
+
An example class would be something like:
|
8
|
+
|
9
|
+
[source,ruby]
|
10
|
+
....
|
11
|
+
class MyPDFSignatureService
|
12
|
+
attr_accessor :pdf
|
13
|
+
|
14
|
+
def initialize(args = {})
|
15
|
+
@pdf = args.fetch(:pdf)
|
16
|
+
end
|
17
|
+
|
18
|
+
def signed_pdf
|
19
|
+
# Code to return the pdf signed
|
20
|
+
end
|
21
|
+
end
|
22
|
+
....
|
23
|
+
|
24
|
+
The arguments provided for the initialize method are:
|
25
|
+
|
26
|
+
- `pdf` - The document that needs to be signed
|
27
|
+
|
28
|
+
Then you will need to configure it with the help of Environment Variables:
|
29
|
+
|
30
|
+
[source,bash]
|
31
|
+
....
|
32
|
+
export DECIDIM_PDF_SIGNATURE_SERVICE="PdfSignatureExample"
|
33
|
+
....
|
@@ -1,8 +1,7 @@
|
|
1
|
-
= SMS
|
1
|
+
= SMS gateway configuration
|
2
2
|
|
3
|
-
If you want to verify your users by sending a verification code via
|
4
|
-
|
5
|
-
This service can also be used by some spaces, and external modules could use it too.
|
3
|
+
If you want to verify your users by sending a verification code via
|
4
|
+
SMS (mobile/cell phones text messages) you need to provide a SMS gateway service class.
|
6
5
|
|
7
6
|
An example class would be something like:
|
8
7
|
|
@@ -28,11 +27,11 @@ The arguments provided for the initialize method are:
|
|
28
27
|
- `code` - The code or the message to be sent to the given mobile phone number.
|
29
28
|
- `context` - An extra context attribute which can be used to pass e.g. the correct organization for the gateway to utilize.
|
30
29
|
|
31
|
-
Then you will need to configure it
|
30
|
+
Then you will need to configure it with the help of Environment Variables:
|
32
31
|
|
33
|
-
[source,
|
32
|
+
[source,bash]
|
34
33
|
....
|
35
|
-
|
34
|
+
export DECIDIM_SMS_GATEWAY_SERVICE="MySMSGatewayService"
|
36
35
|
....
|
37
36
|
|
38
37
|
You can find an example on how this is set up at https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/672f5a8938d884940899b4304f0a17e25d42d2a0/app/services/sms_gateway.rb[DecidimBarcelona's app/services/sms_gateway.rb]. Your final implementation will depend on how your SMS provider works.
|
@@ -101,7 +101,7 @@ An example of custom initializer could be written as:
|
|
101
101
|
[source,ruby]
|
102
102
|
----
|
103
103
|
#config/initializers/omniauth_myprovider.rb
|
104
|
-
if
|
104
|
+
if Decidim.omniauth_providers[:myprovider]
|
105
105
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
106
106
|
provider(
|
107
107
|
:myprovider,
|
@@ -0,0 +1,47 @@
|
|
1
|
+
= Timestamp service configuration
|
2
|
+
|
3
|
+
Used by `decidim-initiatives`.
|
4
|
+
|
5
|
+
Provide a class to generate a timestamp for a document. The instances of this class are initialized with a hash containing the :document key with the document to be timestamped as value. The instances respond to a timestamp public method with the timestamp.
|
6
|
+
|
7
|
+
An example class would be something like:
|
8
|
+
|
9
|
+
[source,ruby]
|
10
|
+
....
|
11
|
+
class MyTimestampService
|
12
|
+
attr_accessor :document
|
13
|
+
def initialize(args = {})
|
14
|
+
@document = args.fetch(:document)
|
15
|
+
end
|
16
|
+
def timestamp
|
17
|
+
# Code to generate timestamp
|
18
|
+
"My timestamp"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
....
|
22
|
+
|
23
|
+
[source,ruby]
|
24
|
+
....
|
25
|
+
class MyTimestampService
|
26
|
+
attr_accessor :document
|
27
|
+
|
28
|
+
def initialize(args = {})
|
29
|
+
@document = args.fetch(:document)
|
30
|
+
end
|
31
|
+
|
32
|
+
def timestamp
|
33
|
+
# Actual code to add the timestamp
|
34
|
+
end
|
35
|
+
end
|
36
|
+
....
|
37
|
+
|
38
|
+
The arguments provided for the initialize method are:
|
39
|
+
|
40
|
+
- `document` - The document that needs to be timestamped
|
41
|
+
|
42
|
+
Then you will need to configure it with the help of Environment Variables:
|
43
|
+
|
44
|
+
[source,bash]
|
45
|
+
....
|
46
|
+
export DECIDIM_TIMESTAMP_SERVICE="MyTimestampService"
|
47
|
+
....
|