decidim 0.23.6 → 0.24.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Rakefile +1 -0
- data/docs/README.adoc +74 -0
- data/docs/antora.yml +7 -0
- data/docs/modules/configure/pages/environment_variables.adoc +69 -0
- data/docs/modules/configure/pages/index.adoc +16 -0
- data/docs/modules/configure/pages/initializer.adoc +376 -0
- data/docs/modules/customize/assets/images/header-snippet.png +0 -0
- data/docs/modules/customize/assets/images/menu.png +0 -0
- data/docs/modules/customize/assets/images/organization-colors.png +0 -0
- data/docs/modules/customize/pages/authorizations.adoc +22 -0
- data/docs/{customization/code.md → modules/customize/pages/code.adoc} +12 -9
- data/docs/{customization/gemfile.md → modules/customize/pages/gemfile.adoc} +5 -4
- data/docs/modules/customize/pages/images.adoc +7 -0
- data/docs/modules/customize/pages/javascript.adoc +59 -0
- data/docs/modules/customize/pages/menu.adoc +25 -0
- data/docs/modules/customize/pages/oauth.adoc +33 -0
- data/docs/modules/customize/pages/styles.adoc +64 -0
- data/docs/modules/customize/pages/texts.adoc +30 -0
- data/docs/modules/customize/pages/users_registration_mode.adoc +17 -0
- data/docs/{customization/views.md → modules/customize/pages/views.adoc} +13 -13
- data/docs/modules/develop/assets/images/barcelona.png +0 -0
- data/docs/modules/develop/assets/images/helsinki.png +0 -0
- data/docs/modules/develop/assets/images/indices.png +0 -0
- data/docs/{advanced/api.md → modules/develop/pages/api.adoc} +2 -2
- data/docs/{advanced/authorship.md → modules/develop/pages/authorable.adoc} +5 -5
- data/docs/modules/develop/pages/c4_component.adoc +91 -0
- data/docs/modules/develop/pages/c4_container.adoc +42 -0
- data/docs/modules/develop/pages/c4_context.adoc +35 -0
- data/docs/{advanced/components.md → modules/develop/pages/components.adoc} +47 -10
- data/docs/{advanced/content_blocks.md → modules/develop/pages/content_blocks.adoc} +16 -13
- data/docs/{advanced/content_processors.md → modules/develop/pages/content_processors.adoc} +25 -19
- data/docs/modules/develop/pages/data-picker.adoc +85 -0
- data/docs/modules/develop/pages/deploy.adoc +15 -0
- data/docs/modules/develop/pages/docker.adoc +12 -0
- data/docs/{advanced/embeddable.md → modules/develop/pages/embeddable.adoc} +6 -6
- data/docs/{advanced/endorsable.md → modules/develop/pages/endorsable.adoc} +31 -25
- data/docs/{advanced/fixing_locales.md → modules/develop/pages/fixing_locales.adoc} +36 -23
- data/docs/{advanced/followers.md → modules/develop/pages/followable.adoc} +9 -8
- data/docs/modules/develop/pages/guide.adoc +16 -0
- data/docs/modules/develop/pages/guide_architecture.adoc +17 -0
- data/docs/modules/develop/pages/guide_changelog.adoc +8 -0
- data/docs/modules/develop/pages/guide_commands.adoc +86 -0
- data/docs/modules/develop/pages/guide_development_app.adoc +44 -0
- data/docs/modules/develop/pages/guide_development_with_custom_seed_data.adoc +31 -0
- data/docs/modules/develop/pages/guide_development_with_localhost_ssl.adoc +63 -0
- data/docs/modules/develop/pages/guide_example_apps.adoc +59 -0
- data/docs/modules/develop/pages/guide_git_conventions.adoc +75 -0
- data/docs/modules/develop/pages/guide_github_projects.adoc +42 -0
- data/docs/modules/develop/pages/guide_semver.adoc +7 -0
- data/docs/{advanced/how_to_fix_metrics.md → modules/develop/pages/how_to_fix_metrics.adoc} +76 -59
- data/docs/modules/develop/pages/machine_translations.adoc +42 -0
- data/docs/modules/develop/pages/managing_translations_i18n.adoc +24 -0
- data/docs/modules/develop/pages/maps.adoc +499 -0
- data/docs/modules/develop/pages/metrics.adoc +119 -0
- data/docs/{advanced/modules.md → modules/develop/pages/modules.adoc} +16 -6
- data/docs/{advanced/newsletter_templates.md → modules/develop/pages/newsletter_templates.adoc} +12 -10
- data/docs/{advanced/notifications.md → modules/develop/pages/notifications.adoc} +40 -38
- data/docs/{advanced/open-data.md → modules/develop/pages/open-data.adoc} +4 -3
- data/docs/modules/develop/pages/permissions.adoc +92 -0
- data/docs/{advanced/profiling.md → modules/develop/pages/profiling.adoc} +15 -12
- data/docs/modules/develop/pages/releases.adoc +148 -0
- data/docs/modules/develop/pages/reportable.adoc +31 -0
- data/docs/modules/develop/pages/security.adoc +33 -0
- data/docs/{advanced/share_tokens.md → modules/develop/pages/share_tokens.adoc} +18 -14
- data/docs/{advanced/templates.md → modules/develop/pages/templates.adoc} +14 -12
- data/docs/{advanced/testing.md → modules/develop/pages/testing.adoc} +21 -20
- data/docs/{advanced/activity_log.md → modules/develop/pages/traceable.adoc} +31 -26
- data/docs/modules/develop/pages/turbolinks.adoc +7 -0
- data/docs/{advanced/view_hooks.md → modules/develop/pages/view_hooks.adoc} +29 -23
- data/docs/modules/develop/pages/view_models_aka_cells.adoc +105 -0
- data/docs/modules/install/pages/checklist.adoc +39 -0
- data/docs/modules/install/pages/index.adoc +148 -0
- data/docs/{manual-installation.md → modules/install/pages/manual.adoc} +54 -42
- data/docs/modules/install/pages/update.adoc +95 -0
- data/docs/{services/activejob.md → modules/services/pages/activejob.adoc} +3 -3
- data/docs/modules/services/pages/elections_bulletin_board.adoc +52 -0
- data/docs/{services/etherpad.md → modules/services/pages/etherpad.adoc} +15 -12
- data/docs/modules/services/pages/maps.adoc +311 -0
- data/docs/modules/services/pages/smtp.adoc +10 -0
- data/docs/modules/services/pages/social_providers.adoc +122 -0
- data/lib/decidim/gem_manager.rb +5 -5
- data/lib/decidim/version.rb +1 -1
- metadata +137 -100
- data/README.md +0 -157
- data/docs/advanced/add_authorizable_action.md +0 -63
- data/docs/advanced/adding_fixtures_aka_dummy_content.md +0 -9
- data/docs/advanced/data-picker.md +0 -83
- data/docs/advanced/deploy.md +0 -9
- data/docs/advanced/how_to_create_a_module.md +0 -9
- data/docs/advanced/machine_translation_service.md +0 -12
- data/docs/advanced/managing_translations_i18n.md +0 -24
- data/docs/advanced/metrics.md +0 -114
- data/docs/advanced/permissions.md +0 -23
- data/docs/advanced/releases.md +0 -114
- data/docs/advanced/tradeoffs.md +0 -14
- data/docs/advanced/view_models_aka_cells.md +0 -99
- data/docs/checklist.md +0 -55
- data/docs/customization/authorizations.md +0 -5
- data/docs/customization/images.md +0 -7
- data/docs/customization/javascript.md +0 -9
- data/docs/customization/machine_translations.md +0 -30
- data/docs/customization/maps.md +0 -610
- data/docs/customization/oauth.md +0 -50
- data/docs/customization/styles.md +0 -11
- data/docs/customization/texts.md +0 -27
- data/docs/customization/users_registration_mode.md +0 -17
- data/docs/development_guide.md +0 -166
- data/docs/getting_started.md +0 -191
- data/docs/possible_flows_for_proposal.png +0 -0
- data/docs/services/analytics.md +0 -23
- data/docs/services/elections_bulletin_board.md +0 -38
- data/docs/services/maps.md +0 -362
- data/docs/services/social_providers.md +0 -98
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,22 @@
|
|
1
|
+
= Authorizations
|
2
|
+
|
3
|
+
Decidim offers several methods for allowing participants to get authorization to perform certain privileged actions. This module implements several of those methods and also offers a way for installation to implement their custom verification methods.
|
4
|
+
|
5
|
+
There are several use cases for this, such as
|
6
|
+
|
7
|
+
* Sending a SMS code to users to verify that their have a valid cellphone
|
8
|
+
* Allowing users to upload a photo or scanned image of their identity document
|
9
|
+
* Sending users a code through postal code
|
10
|
+
* Allowing users to go to to a physical office and check their documentation
|
11
|
+
* Checking some information through other systems (as a Municipal Census on the case of Municipalities, Cities or Towns)
|
12
|
+
* Having a list of valid users emails
|
13
|
+
|
14
|
+
Right now Decidim supports only a few of these cases, but we have an internal API where you can program your own kind of authorizations.
|
15
|
+
Introduction
|
16
|
+
|
17
|
+
Each decidim instance is in full control of its authorizations, and can customize:
|
18
|
+
|
19
|
+
* The different methods to be used by users to get verified. For example, through a census, by uploading their identity documents, or by receiving a verification home at their address.
|
20
|
+
* The different actions in decidim that require authorization, and which authorization method they require. For example, a decidim instance might choose to require census authorization to create proposals, but a fully verified address via a verification code sent by postal mail for voting on proposals.
|
21
|
+
|
22
|
+
See https://github.com/decidim/decidim/blob/develop/decidim-verifications/README.md[decidim-verifications's README] and https://decidim.org/modules[Decidim's Modules page].
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
= Code
|
2
2
|
|
3
3
|
Decidim is multiple things:
|
4
4
|
|
@@ -7,24 +7,27 @@ Decidim is multiple things:
|
|
7
7
|
|
8
8
|
Most of the time, you should work with the generated application. That application (development_app on this docs) should be named as your project, for instance for Barcelona City Council is `DecidimBarcelona`, so for creating it should be:
|
9
9
|
|
10
|
-
|
10
|
+
[source,console]
|
11
|
+
----
|
11
12
|
decidim DecidimBarcelona
|
12
|
-
|
13
|
+
----
|
13
14
|
|
14
15
|
If you want to override/change anything (for instance the homepage), you can just do it with the same name of the file, through Monkey Patching.
|
15
16
|
|
16
17
|
If you want to extend Decidim, the prefered way should be by having a Module. This is a Ruby on Rails Engine which provides ruby code (models, views, controllers, assets, etc). You can use it through multiple ways:
|
17
18
|
|
18
|
-
* Putting it on the same directory as your app and pointing on the Gemfile.
|
19
|
+
* Putting it on the same directory as your app and pointing on the Gemfile. https://github.com/AjuntamentdeBarcelona/decidim-barcelona/tree/c210b5338d7ba1338c9879627e081da1441f1946[See example on GitHub]. For instance:
|
19
20
|
|
20
|
-
|
21
|
+
[source,ruby]
|
22
|
+
----
|
21
23
|
gem "decidim-debates", path: "decidim-debates"
|
22
|
-
|
24
|
+
----
|
23
25
|
|
24
|
-
* Publishing on a git
|
26
|
+
* Publishing on a git repository and pointing in on the Gemfile. For instance:
|
25
27
|
|
26
|
-
|
28
|
+
[source,ruby]
|
29
|
+
----
|
27
30
|
gem "decidim-consultations", git: "https://github.com/decidim/decidim-module-consultations"
|
28
|
-
|
31
|
+
----
|
29
32
|
|
30
33
|
* Publishing it on rubygems.org
|
@@ -1,10 +1,11 @@
|
|
1
|
-
|
1
|
+
= Gemfile
|
2
2
|
|
3
|
-
You can add and change your Gemfile as you want, this is a classic Ruby on Rails application. For example to add
|
3
|
+
You can add and change your Gemfile as you want, this is a classic Ruby on Rails application. For example to add https://github.com/josevalim/rails-footnotes[rails-footnotes] gem you would just add:
|
4
4
|
|
5
|
-
|
5
|
+
[source,ruby]
|
6
|
+
----
|
6
7
|
gem 'rails-footnotes', '~> 4.0'
|
7
|
-
|
8
|
+
----
|
8
9
|
|
9
10
|
And then just do the classic Ruby on Rails flow bundle install and following any gem specific install steps from its own documentation.
|
10
11
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
= Images
|
2
|
+
|
3
|
+
You can change most of the images (for instance the logo, main banner on homepage, contents of participatory processes, etc) through the Administration panel.
|
4
|
+
|
5
|
+
If you want to override the standard images given by Decidim (for instance the initial image for user's avatars) you can do it by naming it the same way as the original image, in this case it should be `app/assets/images/decidim/default-avatar.svg`
|
6
|
+
|
7
|
+
If you want to add a new image you can do it as any Rails application, leaving it on your image's asset folder and using image_tag helper. You can see more documentation on http://guides.rubyonrails.org/asset_pipeline.html[Rails guide].
|
@@ -0,0 +1,59 @@
|
|
1
|
+
= Javascript
|
2
|
+
|
3
|
+
You can add Javascript code by multiple ways in Decidim:
|
4
|
+
|
5
|
+
== Asset pipeline
|
6
|
+
|
7
|
+
Just add it to `app/assets/javascripts/application.js`. For example to create a new alert just add:
|
8
|
+
|
9
|
+
[source,javascript]
|
10
|
+
----
|
11
|
+
$(function(){
|
12
|
+
alert('foobar');
|
13
|
+
});
|
14
|
+
----
|
15
|
+
|
16
|
+
More information in https://guides.rubyonrails.org/asset_pipeline.html[Rails Asset Pipeline documentation].
|
17
|
+
|
18
|
+
== Head extra file
|
19
|
+
|
20
|
+
There's an special partial file for adding inline content in every public page. You just need to create a file called `app/views/layouts/decidim/_head_extra.html.erb`:
|
21
|
+
|
22
|
+
[source,javascript]
|
23
|
+
----
|
24
|
+
<script type="text/javascript">
|
25
|
+
$(function(){
|
26
|
+
alert('foobar');
|
27
|
+
});
|
28
|
+
</script>
|
29
|
+
----
|
30
|
+
|
31
|
+
== Custom HTML Header snippets
|
32
|
+
|
33
|
+
If you need changes on a multitenant installation, you can do so by enabling a configuration
|
34
|
+
in your `config/initializers/decidim.rb` file. Please do notice that this has security implications:
|
35
|
+
|
36
|
+
[source,ruby]
|
37
|
+
----
|
38
|
+
# Custom HTML Header snippets
|
39
|
+
#
|
40
|
+
# The most common use is to integrate third-party services that require some
|
41
|
+
# extra JavaScript or CSS. Also, you can use it to add extra meta tags to the
|
42
|
+
# HTML. Note that this will only be rendered in public pages, not in the admin
|
43
|
+
# section.
|
44
|
+
#
|
45
|
+
# Before enabling this you should ensure that any tracking that might be done
|
46
|
+
# is in accordance with the rules and regulations that apply to your
|
47
|
+
# environment and usage scenarios. This feature also comes with the risk
|
48
|
+
# that an organization's administrator injects malicious scripts to spy on or
|
49
|
+
# take over user accounts.
|
50
|
+
#
|
51
|
+
config.enable_html_header_snippets = true
|
52
|
+
----
|
53
|
+
|
54
|
+
Then you'll have a new textarea field called "Header snippets" in Administration -> Configuration -> Appearance (URL `/admin/organization/appearance/edit`):
|
55
|
+
|
56
|
+
image::header-snippet.png[Header snippet]
|
57
|
+
|
58
|
+
Notice that you can resize this textarea.
|
59
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
= Menu
|
2
|
+
|
3
|
+
The menu also known as Navigation Bar, is the main way of navigation by Decidim.
|
4
|
+
|
5
|
+
image::menu.png[Decidim Menu]
|
6
|
+
|
7
|
+
After you install Decidim you can see it in several ways, depending on:
|
8
|
+
|
9
|
+
. Which modules do you have activated
|
10
|
+
. Which contents do you have in your database
|
11
|
+
|
12
|
+
If you have the default modules and no contents, then you'll only see Home and Help.
|
13
|
+
|
14
|
+
Depending in the kind of space and module, then you can see or not some of the spaces:
|
15
|
+
|
16
|
+
- For participatory processes, it appears when there's some published content by an administrator.
|
17
|
+
- For assemblies, it appears when there's some published content by an administrator.
|
18
|
+
- For consultations, you need to enable the module and it appears when there's some published content by an administrator.
|
19
|
+
- For conferences, you need to enable the module and it appears when there's some published content by an administrator.
|
20
|
+
- For initiatives, you need to enable the module. Every participant can see it, as anyone can create one. That's because is a bottom-up kind of mechanism.
|
21
|
+
|
22
|
+
There's also a https://github.com/OpenSourcePolitics/decidim-module-navbar_links[NavBar links module] made by the community that you can use to add your custom links.
|
23
|
+
|
24
|
+
Finally if you want to dive in the code that handles this, a good starting point is the https://rubydoc.info/github/decidim/decidim/develop/Decidim/Menu[Menu API].
|
25
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
= OAuth
|
2
|
+
|
3
|
+
Decidim is both and OAuth client (via https://github.com/omniauth/omniauth[omniauth]) and an OAuth provider (via https://github.com/doorkeeper-gem/doorkeeper[doorkeeper]).
|
4
|
+
|
5
|
+
Check the xref:services:social_providers.adoc[Social Providers] document to check the provider and client configurations.
|
6
|
+
|
7
|
+
== Performing more actions on omniauth registration
|
8
|
+
|
9
|
+
Some times, there is the need to perform more actions than just creating a user on registration, this is why `CreateOmniauthRegistration` command publishes a `"decidim.user.omniauth_registration` event after registration so that developers can subscribe to it and perform other actions like user verification or alike.
|
10
|
+
|
11
|
+
This event comes with the following payload:
|
12
|
+
|
13
|
+
* user_id: The id for the registered User.
|
14
|
+
* identity_id: The id for the social Identity.
|
15
|
+
* provider: The name for the social provider.
|
16
|
+
* uid: OAuth's uid
|
17
|
+
* email: User's email.
|
18
|
+
* name: User's name.
|
19
|
+
* nickname: User's nickname after being normalized.
|
20
|
+
* avatar_url: Avatar's url, if any.
|
21
|
+
* raw_data: The raw hash received directly from the Omniauth gem.
|
22
|
+
|
23
|
+
To be notified after a registration one should subscribe to the event, in the passed block the after registration code should be implemented:
|
24
|
+
|
25
|
+
[source,ruby]
|
26
|
+
----
|
27
|
+
ActiveSupport::Notifications.subscribe "decidim.user.omniauth_registration" do |name, started, finished, unique_id, data|
|
28
|
+
puts "the data: #{data.inspect}"
|
29
|
+
IdCatMobilVerificationJob.perform_later(data[:raw_data])
|
30
|
+
end
|
31
|
+
----
|
32
|
+
|
33
|
+
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.
|
@@ -0,0 +1,64 @@
|
|
1
|
+
= CSS Styles with SASS
|
2
|
+
|
3
|
+
One of the first things you'll want to do after you install Decidim is applying your own corporative image. You can do it on multiple ways:
|
4
|
+
|
5
|
+
== Organization colors
|
6
|
+
|
7
|
+
If you only want to change colors and anything more, the most easy and fast way is doing this in the Administrator panel, in Administration -> Configuration -> Appearance (URL `/admin/organization/appearance/edit`):
|
8
|
+
|
9
|
+
image::organization-colors.png[Organization colors]
|
10
|
+
|
11
|
+
This works for any Organization inside of a Muiltitenant.
|
12
|
+
|
13
|
+
== Head extra file
|
14
|
+
|
15
|
+
There's an special partial file for adding inline content in every public page. You just need to create a file called `app/views/layouts/decidim/_head_extra.html.erb`:
|
16
|
+
|
17
|
+
[source,stylesheet]
|
18
|
+
----
|
19
|
+
<style type="text/css">
|
20
|
+
p { color: red; }
|
21
|
+
</style>
|
22
|
+
----
|
23
|
+
|
24
|
+
== Custom HTML Header snippets
|
25
|
+
|
26
|
+
If you need changes on a multitenant installation, you can do so by enabling a configuration
|
27
|
+
in your `config/initializers/decidim.rb` file. Please do notice that this has security implications:
|
28
|
+
|
29
|
+
[source,ruby]
|
30
|
+
----
|
31
|
+
# Custom HTML Header snippets
|
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
|
45
|
+
----
|
46
|
+
|
47
|
+
Then you'll have a new textarea field called "Header snippets" in Administration -> Configuration -> Appearance (URL `/admin/organization/appearance/edit`):
|
48
|
+
|
49
|
+
image::header-snippet.png[Header snippet]
|
50
|
+
|
51
|
+
Notice that you can resize this textarea.
|
52
|
+
|
53
|
+
== Asset pipeline
|
54
|
+
|
55
|
+
You can go to app/assets/stylesheets/application.css.sass on your generated applications. There you can override any class using CSS with SASS.
|
56
|
+
|
57
|
+
In https://github.com/decidim/decidim/blob/develop/decidim-core/app/assets/stylesheets/decidim/_variables.scss[decidim-core/app/assets/stylesheets/decidim/_variables.scss] you can find the `variables` that can be overriden in your `sass`.
|
58
|
+
|
59
|
+
We use http://sass-lang.com/guide[SASS, with SCSS syntax] as CSS preprocessor.
|
60
|
+
|
61
|
+
== Accesibility
|
62
|
+
|
63
|
+
To maintain accesibility level, if you add new colors use a http://webaim.org/resources/contrastchecker/[Color contrast checker] (WCAG AA is mandatory, WCAG AAA is recommended)
|
64
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
= Custom Texts
|
2
|
+
|
3
|
+
== Using custom locales
|
4
|
+
|
5
|
+
You can change most of the texts through the Administration panel.
|
6
|
+
|
7
|
+
If you want to change a given text that isn't on the Administration panel, and belongs on Decidim code, you should first find out which key is being used. For instance, you want to change the home page text where it says "Let's build a more open, transparent and collaborative society.", you would search the text (using https://github.com/decidim/decidim/search?utf8=%E2%9C%93&q=%22Let%27s+build+a+more+open%2C+transparent+and+collaborative+society.%22&type=[github] or grep) and then you would extract that key and their parents. On this case it'd be:
|
8
|
+
|
9
|
+
[source,yml]
|
10
|
+
----
|
11
|
+
en:
|
12
|
+
pages:
|
13
|
+
home:
|
14
|
+
footer_sub_hero:
|
15
|
+
footer_sub_hero_body: Let's build a more open, transparent and collaborative society.<br /> Join, participate and decide.
|
16
|
+
----
|
17
|
+
|
18
|
+
You need to create a file for this translation as http://guides.rubyonrails.org/i18n.html[Ruby on Rails i18n documentation] says, for instance config/locales/home.en.yml, you can see a currently working example in https://github.com/AjuntamentdeBarcelona/decidim-barcelona/pull/206[this PR].
|
19
|
+
|
20
|
+
== Using external module
|
21
|
+
|
22
|
+
There is an external module https://github.com/mainio/decidim-module-term_customizer[decidim-term_customizer], according with the project README:
|
23
|
+
|
24
|
+
____
|
25
|
+
The module allows administrators to add "translation sets" through the admin panel which contain customized terms for any module in the system. These sets can be applied against different scopes within the system, e.g. the whole system, participatory space scope (e.g. all participatory processes or a specific participatory process) or a specific component within a participatory space.
|
26
|
+
____
|
27
|
+
|
28
|
+
To implement this on your decidim installation follow the https://github.com/mainio/decidim-module-term_customizer/blob/master/README.md[documentation in the external module].
|
29
|
+
|
30
|
+
You can see an example in https://github.com/decidim/metadecidim/pull/38[this PR].
|
@@ -0,0 +1,17 @@
|
|
1
|
+
= Users registration mode
|
2
|
+
|
3
|
+
Decidim allows organizations to choose one of the three modes related to the registration and login of users. This can be configured by the system user, in the organization manager zone.
|
4
|
+
|
5
|
+
== Allow users to register and login
|
6
|
+
|
7
|
+
This is the default mode. It enables the registration form and allow anyone to create a new account and log in.
|
8
|
+
|
9
|
+
== Don't allow users to register, but allow existing users to login
|
10
|
+
|
11
|
+
This mode disables the registration form, but allows existing users to log in. This mode could be useful for organizations with a closed census that do not want to offer other people to register.
|
12
|
+
|
13
|
+
NOTE: if you have configured xref:services:social_providers.adoc[social providers], users will still be able to sign in with external accounts even when this mode is configured.
|
14
|
+
|
15
|
+
== Access only can be done with external accounts
|
16
|
+
|
17
|
+
This mode disables the registration form and the login form. With this mode, users only can access through xref:services:social_providers.adoc[social providers], so it is recommended to configure at least one of them. This can be useful when an organization needs to allow participation only to users of another application of the organization itself.
|
@@ -1,34 +1,34 @@
|
|
1
|
-
|
1
|
+
= Views (HTML)
|
2
2
|
|
3
3
|
As usual you should make some tests with the changes that you made and configure a Continuous Integration environment for checking that your overrides doesn't get removed with new decidim versions.
|
4
4
|
|
5
|
-
|
5
|
+
== Overrides
|
6
6
|
|
7
7
|
To find what you need to change you'll need to make some detective work to find out which partial or view do you need to change. You can do so by:
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
* looking at your application log and finding the lines that start with "Rendered"
|
10
|
+
* inspecting with the web development tools of your browser, copying a special class and using `grep`, github search or your IDE search by multiple files to find out on which file this exists.
|
11
11
|
|
12
|
-
|
12
|
+
=== Filename method
|
13
13
|
|
14
14
|
If you want to override a view or partial given by Decidim you can do this just by naming it with the same filename that you already have. On more details, if you want to change the social media icons on the footer, you can do so by looking at which file you need to change, copying that file to your application with the same filename and directory structure, and making your local changes.
|
15
15
|
|
16
|
-
As an example, if I want to change the footer, you'd need to search for the file (on this case, it's on
|
16
|
+
As an example, if I want to change the footer, you'd need to search for the file (on this case, it's on https://github.com/decidim/decidim/blob/e181d7e67bdf915a3a8e58416c683f52346de047/decidim-core/app/views/layouts/decidim/_mini_footer.html.erb[`decidim-core/app/views/layouts/decidim/_mini_footer.html.erb`]), and copy that file to your own application on `app/views/layouts/decidim/_mini_footer.html.erb`).
|
17
17
|
|
18
|
-
|
18
|
+
== Deface method
|
19
19
|
|
20
|
-
You'll need the
|
20
|
+
You'll need the https://github.com/spree/deface[`deface` gem] installed on your application, and follow their instructions on how to use the different overridign methods that they support.
|
21
21
|
|
22
22
|
As an example, if you want to change the footer, you can do so by creating the file `app/overrides/layouts/decidim/_main_footer/pre_footer.html.erb.deface` with these contents:
|
23
23
|
|
24
|
-
|
24
|
+
[source,html]
|
25
|
+
----
|
25
26
|
<!-- insert_before ".main-footer" -->
|
26
27
|
hello world
|
27
|
-
|
28
|
+
----
|
28
29
|
|
29
|
-
|
30
|
+
== New pages
|
30
31
|
|
31
32
|
If you want to add a new HTML page, you can do this by working as a regular Rails application (ie, you can scaffold a new view and work with the HTML as usual).
|
32
33
|
|
33
|
-
As an example of how to do this on Decidim Barcelona application, there's the [StaticController](
|
34
|
-
https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/d47d4a9ae6be26a0c5c4000907dda3c195579636/app/controllers/static_controller.rb) (main accountability section pages). You should inherit your controller from Decidim::ApplicationController.
|
34
|
+
As an example of how to do this on Decidim Barcelona application, there's the https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/d47d4a9ae6be26a0c5c4000907dda3c195579636/app/controllers/static_controller.rb[StaticController] (main accountability section pages). You should inherit your controller from Decidim::ApplicationController.
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
= API
|
2
2
|
|
3
3
|
Decidim comes with a powerful API in read-only mode based in the GraphQL specification.
|
4
4
|
|
@@ -10,6 +10,6 @@ Accessing that URL will give a full details of all the objects that can be reque
|
|
10
10
|
|
11
11
|
For a quick introduction about how to use the Decidim API, please refer to this document:
|
12
12
|
|
13
|
-
[Using the Decidim GraphQL API]
|
13
|
+
xref:../../decidim-api/docs/usage.adoc[Using the Decidim GraphQL API]
|
14
14
|
|
15
15
|
Note that this document is available under the `api/docs` URL nicely formatted as well. It also includes the full field types reference.
|
@@ -1,14 +1,14 @@
|
|
1
|
-
|
1
|
+
= Authorship
|
2
2
|
|
3
3
|
Regarging authorship of Decidim resources/entities, there are three concerns
|
4
4
|
involved directly:
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
* `Decidim::ActsAsAuthor`: which defines how an author should behave.
|
7
|
+
* `Decidim::Authorable` and `Decidim::Coauthorable`: which define the behaviour around who authored a resource.
|
8
8
|
|
9
9
|
But the presenters for the classes including `ActsAsAuthor` should also behave
|
10
10
|
in a certain maneer. This has been resolved using the duck typing strategy
|
11
11
|
(remember, if it quaks as as duck, then it is a duck). Thus, there's not any
|
12
12
|
interface declaring which are the methods to be implemented by the presenter
|
13
|
-
of an author. Anyway one of the
|
14
|
-
reference.
|
13
|
+
of an author. Anyway one of the ``OfficialAuthorPresenter``s may be used as a
|
14
|
+
reference.
|
@@ -0,0 +1,91 @@
|
|
1
|
+
[plantuml]
|
2
|
+
....
|
3
|
+
@startuml
|
4
|
+
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/v2.0.1/C4_Component.puml
|
5
|
+
|
6
|
+
' uncomment the following line to make proposals
|
7
|
+
'LAYOUT_AS_SKETCH()
|
8
|
+
|
9
|
+
title System Component diagram for Decidim Applications (https://decidim.org)
|
10
|
+
|
11
|
+
|
12
|
+
ContainerDb(rel_db, "Relational Database", "PostgreSQL 9.5.x", "Stores users, participatory processes, assemblies, consultations, initiatives, proposals, meetings, etc.")
|
13
|
+
Container(filesystem, "File System", "Local or remote", "Stores uploads (images, documents, etc.)")
|
14
|
+
Container(worker, "Worker", "Ruby on Rails 5.2", "ActiveJob queues for non syncronuos jobs. Works for open data requests, sending emails, etc.")
|
15
|
+
|
16
|
+
Container_Boundary(web_app, "Web Application") {
|
17
|
+
|
18
|
+
Component(admin, "Admin module", "Ruby On Rails Engine", "Internal. Admin panel, mounted in /admin")
|
19
|
+
Component(api, "API module", "Ruby On Rails Engine", "Internal. GraphQL API, mounted in /api")
|
20
|
+
Component(core, "Core module", "Ruby On Rails Engine", "Internal. Provides APIs as building blocks to be consumed by the rest of the modules.")
|
21
|
+
Component(comments, "Comments module", "Ruby On Rails Engine", "Provides the Commentable capability to other modules.")
|
22
|
+
Component(dev, "Dev module", "Ruby On Rails Engine", "Aids the local development of Decidim's components.")
|
23
|
+
Component(forms, "Forms module", "Ruby On Rails Engine", "Provides APIs for working with forms to other modules (like Surveys and Meetings)")
|
24
|
+
Component(generators, "Generator module", "Ruby On Rails Engine", "Provides the decidim Command Line Interface.")
|
25
|
+
Component(system, "System module", "Ruby On Rails Engine", "Multitenant configuration, mounted in /system. Can create and manage all the instances of an installation.")
|
26
|
+
Component(verifications, "Verifications module", "Ruby On Rails Engine", " Offers several methods for allowing participants to get authorization to perform certain privileged actions.")
|
27
|
+
|
28
|
+
Component(assemblies, "Assemblies module", "Ruby On Rails Engine (Space)", "A permament Space, mounted in /assemblies.")
|
29
|
+
Component(conferences, "Conferences module", "Ruby On Rails Engine (Space)", "A temporal Space, mounted in /conferences.")
|
30
|
+
Component(consultations, "Consultations module", "Ruby On Rails Engine (Space)", "A temporal Space, mounted in /consultations.")
|
31
|
+
Component(initiatives, "Initiatives module", "Ruby On Rails Engine (Space)", "A bottom-up Space, mounted in /initiatives. A participant can collect signatures to bring an issue to the organization.")
|
32
|
+
Component(participatory_processes, "Participatory Processes module (Space)", "Ruby On Rails Engine", "A temporal Space, mounted in /processes.")
|
33
|
+
|
34
|
+
Component(accountability, "Accountability module", "Ruby On Rails Engine", "Component. Adds an accountability section to any participatory space so users can follow along the state of the accepted proposals.")
|
35
|
+
Component(budgets, "Budgets module", "Ruby On Rails Engine", "Component. Adds a participatory budgets system to any participatory space.")
|
36
|
+
Component(blogs, "Blogs module", "Ruby On Rails Engine", "Component. Makes possible to add posts ordered by publication time to spaces.")
|
37
|
+
Component(debates, "Debates module", "Ruby On Rails Engine", "Component. Adds a CRUD engine to the admin and public view scoped inside the participatory process.")
|
38
|
+
Component(elections, "Elections module", "Ruby On Rails Engine", "Components. Adds voting with cryptographic capabilities.")
|
39
|
+
Component(meetings, "Meetings module", "Ruby On Rails Engine", "Component. Adds a CRUD engine to the admin and public view scoped inside the participatory process.")
|
40
|
+
Component(pages, "Pages module", "Ruby On Rails Engine", "Component. adds static page capabilities to any participatory space. It basically provides an interface to include arbitrary HTML content to any step.")
|
41
|
+
Component(proposals, "Proposals module", "Ruby On Rails Engine", "Component. Adds one of the main components of Decidim: allows users to contribute to a participatory space by creating proposals.")
|
42
|
+
Component(surveys, "Surveys module", "Ruby On Rails Engine", "Component. Makes possible to publish surveys (for registered participants or visitors users).")
|
43
|
+
Component(sortitions, "Sortitions module", "Ruby On Rails Engine", "Component. makes possible to select randomly a number of proposals among a set of proposals (or a category of proposals within a set) maximizing guarantees of randomness and avoiding manipulation of results by the administrator.")
|
44
|
+
|
45
|
+
Rel(surveys, forms, "Consumes")
|
46
|
+
Rel(meetings, forms, "Consumes")
|
47
|
+
Rel_Back(forms, elections, "Consumes")
|
48
|
+
|
49
|
+
' Rel(proposals, assemblies, "Mounts in")
|
50
|
+
' Rel(proposals, participatory_processes, "Mounts in")
|
51
|
+
' Rel(proposals, conferences, "Mounts in")
|
52
|
+
'
|
53
|
+
' Rel(consultations, comments, "Consumes")
|
54
|
+
' Rel(initiatives, comments, "Consumes")
|
55
|
+
' Rel(accountability, comments, "Consumes")
|
56
|
+
' Rel(budgets, comments, "Consumes")
|
57
|
+
' Rel(sortitions, comments, "Consumes")
|
58
|
+
' Rel(dev, comments, "Consumes")
|
59
|
+
' Rel(meetings, comments, "Consumes")
|
60
|
+
' Rel(debates, comments, "Consumes")
|
61
|
+
' Rel(proposals, comments, "Consumes")
|
62
|
+
' Rel(blogs, comments, "Consumes")
|
63
|
+
'
|
64
|
+
' Rel(consultations, admin, "Managed in")
|
65
|
+
' Rel(initiatives, admin, "Managed in")
|
66
|
+
' Rel(accountability, admin, "Managed in")
|
67
|
+
' Rel(budgets, admin, "Managed in")
|
68
|
+
' Rel(sortitions, admin, "Managed in")
|
69
|
+
' Rel(meetings, admin, "Managed in")
|
70
|
+
' Rel(debates, admin, "Managed in")
|
71
|
+
' Rel(proposals, admin, "Managed in")
|
72
|
+
' Rel(blogs, admin, "Managed in")
|
73
|
+
' Rel(elections, admin, "Managed in")
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
System_Ext(decidim_bulletin_board_system, "Decidim Bulletin Board", "Allows participants to cast end-to-end verifiable secret votes.")
|
78
|
+
System_Ext(mail_system, "SMTP system (e-mail)", "Sends mails to users, like confirmations, reminders, notifications, etc.")
|
79
|
+
System_Ext(etherpad_system, "Etherpad-Lite system", "Optional. Allows real-time text edition in Meetings.")
|
80
|
+
System_Ext(geocoding_system, "Geocoding system", "Optional. An Open Street Maps provider, allows geographical localization of Proposals and Meetings..")
|
81
|
+
System_Ext(oauth_system, "OAUTH2 System", "Optional. Third party sign on systems. Could be Twitter, Facebook, Google or any other OAUTH2 providers.")
|
82
|
+
|
83
|
+
Rel_Back_Neighbor(decidim_bulletin_board_system, elections, "Uses")
|
84
|
+
Rel_Neighbor(worker, mail_system, "Sends e-mails", "SMTP")
|
85
|
+
Rel(web_app, rel_db, "Uses")
|
86
|
+
Rel(web_app, filesystem, "Uses")
|
87
|
+
Rel(web_app, oauth_system, "Uses")
|
88
|
+
Rel(web_app, geocoding_system, "Uses")
|
89
|
+
Rel(web_app, etherpad_system, "Embeds", "Through an Iframe")
|
90
|
+
@enduml
|
91
|
+
....
|