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
data/README.md
DELETED
@@ -1,157 +0,0 @@
|
|
1
|
-
<img src="https://cdn.rawgit.com/decidim/decidim/master/logo.svg" alt="Decidim Logo" width="400">
|
2
|
-
|
3
|
-
The participatory democracy framework.
|
4
|
-
|
5
|
-
> Free Open-Source participatory democracy, citizen participation and open government for cities and organizations
|
6
|
-
|
7
|
-
[Decidim](https://decidim.org) is a participatory democracy framework, written in Ruby on Rails, originally developed for the Barcelona City government online and offline participation website. Installing these libraries will provide you a generator and gems to help you develop web applications like the ones found on [example applications](#example-applications) or like [our demo application](http://staging.decidim.codegram.com).
|
8
|
-
|
9
|
-
All members of the Decidim community agree with [Decidim Social Contract or Code of Democratic Guarantees](http://www.decidim.org/contract/).
|
10
|
-
|
11
|
-
---
|
12
|
-
|
13
|
-
[![Gem](https://img.shields.io/gem/v/decidim.svg)](https://rubygems.org/gems/decidim)
|
14
|
-
[![Gem](https://img.shields.io/gem/dt/decidim.svg)](https://rubygems.org/gems/decidim)
|
15
|
-
[![GitHub contributors](https://img.shields.io/github/contributors/decidim/decidim.svg)](https://github.com/decidim/decidim/graphs/contributors)
|
16
|
-
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/decidim/decidim/master)
|
17
|
-
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/decidim/decidim)
|
18
|
-
|
19
|
-
Code quality
|
20
|
-
|
21
|
-
[![codecov](https://codecov.io/gh/decidim/decidim/branch/develop/graph/badge.svg)](https://codecov.io/gh/decidim/decidim)
|
22
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/ad8fa445086e491486b6/maintainability)](https://codeclimate.com/github/decidim/decidim/maintainability)
|
23
|
-
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/decidim/localized.svg)](https://crowdin.com/project/decidim)
|
24
|
-
[![Inline docs](http://inch-ci.org/github/decidim/decidim.svg?branch=master)](http://inch-ci.org/github/decidim/decidim)
|
25
|
-
[![Accessibility issues](https://rocketvalidator.com/badges/a11y_issues.svg?url=http://staging.decidim.codegram.com/)](https://rocketvalidator.com/badges/link?url=http://staging.decidim.codegram.com/&report=a11y)
|
26
|
-
[![HTML issues](https://rocketvalidator.com/badges/html_issues.svg?url=http://staging.decidim.codegram.com/)](https://rocketvalidator.com/badges/link?url=http://staging.decidim.codegram.com/&report=html)
|
27
|
-
|
28
|
-
Test suite
|
29
|
-
|
30
|
-
<details>
|
31
|
-
<summary>See all</summary>
|
32
|
-
|
33
|
-
[![Accountability](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Accountability/develop.svg?label=%5BCI%5D%20Accountability)](https://github.com/decidim/decidim/actions)
|
34
|
-
[![Admin](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Admin/develop.svg?label=%5BCI%5D%20Admin)](https://github.com/decidim/decidim/actions)
|
35
|
-
[![Api](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Api/develop.svg?label=%5BCI%5D%20Api)](https://github.com/decidim/decidim/actions)
|
36
|
-
[![Assemblies](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Assemblies/develop.svg?label=%5BCI%5D%20Assemblies)](https://github.com/decidim/decidim/actions)
|
37
|
-
[![Blogs](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Blogs/develop.svg?label=%5BCI%5D%20Blogs)](https://github.com/decidim/decidim/actions)
|
38
|
-
[![Budgets](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Budgets/develop.svg?label=%5BCI%5D%20Budgets)](https://github.com/decidim/decidim/actions)
|
39
|
-
[![Comments](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Comments/develop.svg?label=%5BCI%5D%20Comments)](https://github.com/decidim/decidim/actions)
|
40
|
-
[![Conferences](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Conferences/develop.svg?label=%5BCI%5D%20Conferences)](https://github.com/decidim/decidim/actions)
|
41
|
-
[![Consultations](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Consultations/develop.svg?label=%5BCI%5D%20Consultations)](https://github.com/decidim/decidim/actions)
|
42
|
-
[![Core](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Core/develop.svg?label=%5BCI%5D%20Core)](https://github.com/decidim/decidim/actions)
|
43
|
-
[![Debates](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Debates/develop.svg?label=%5BCI%5D%20Debates)](https://github.com/decidim/decidim/actions)
|
44
|
-
[![Forms](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Forms/develop.svg?label=%5BCI%5D%20Forms)](https://github.com/decidim/decidim/actions)
|
45
|
-
[![Generators](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Generators/develop.svg?label=%5BCI%5D%20Generators)](https://github.com/decidim/decidim/actions)
|
46
|
-
[![Initiatives](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Initiatives/develop.svg?label=%5BCI%5D%20Initiatives)](https://github.com/decidim/decidim/actions)
|
47
|
-
[![Main](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Main%20folder/develop.svg?label=%5BCI%5D%20Main)](https://github.com/decidim/decidim/actions)
|
48
|
-
[![Meetings](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Meetings/develop.svg?label=%5BCI%5D%20Meetings)](https://github.com/decidim/decidim/actions)
|
49
|
-
[![Pages](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Pages/develop.svg?label=%5BCI%5D%20Pages)](https://github.com/decidim/decidim/actions)
|
50
|
-
[![Participatory processes](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Participatory%20processes/develop.svg?label=%5BCI%5D%20Participatory%20processes)](https://github.com/decidim/decidim/actions)
|
51
|
-
[![Proposals (system admin)](<https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Proposals%20(system%20admin)/develop.svg?label=%5BCI%5D%20Proposals%20(system%20admin)>)](https://github.com/decidim/decidim/actions)
|
52
|
-
[![Proposals (system public)](<https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Proposals%20(system%20public)/develop.svg?label=%5BCI%5D%20Proposals%20(system%20public)>)](https://github.com/decidim/decidim/actions)
|
53
|
-
[![Proposals (unit tests)](<https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Proposals%20(unit%20tests)/develop.svg?label=%5BCI%5D%20Proposals%20(unit%20tests)>)](https://github.com/decidim/decidim/actions)
|
54
|
-
[![Sortitions](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Sortitions/develop.svg?label=%5BCI%5D%20Sortitions)](https://github.com/decidim/decidim/actions)
|
55
|
-
[![Surveys](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Surveys/develop.svg?label=%5BCI%5D%20Surveys)](https://github.com/decidim/decidim/actions)
|
56
|
-
[![System](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20System/develop.svg?label=%5BCI%5D%20System)](https://github.com/decidim/decidim/actions)
|
57
|
-
[![Verifications](https://img.shields.io/github/workflow/status/decidim/decidim/%5BCI%5D%20Verifications/develop.svg?label=%5BCI%5D%20Verifications)](https://github.com/decidim/decidim/actions)
|
58
|
-
|
59
|
-
</details>
|
60
|
-
|
61
|
-
---
|
62
|
-
|
63
|
-
# What do you need to do?
|
64
|
-
|
65
|
-
* [Official Documentation](https://docs.decidim.org/) **[NOT UP TO DATE]**
|
66
|
-
* [Getting started with Decidim](#getting-started-with-decidim)
|
67
|
-
* [Contribute to the project](#how-to-contribute)
|
68
|
-
* [Modules](#modules)
|
69
|
-
* [Create & browse development app](#browse-decidim)
|
70
|
-
|
71
|
-
---
|
72
|
-
|
73
|
-
## Getting started with Decidim
|
74
|
-
|
75
|
-
TLDR: install gem, generate a Ruby on Rails app, enjoy.
|
76
|
-
|
77
|
-
```console
|
78
|
-
gem install decidim
|
79
|
-
decidim decidim_application
|
80
|
-
```
|
81
|
-
|
82
|
-
We've set up a guide on how to install, set up and upgrade Decidim. See the [Getting started guide](https://github.com/decidim/decidim/blob/master/docs/getting_started.md).
|
83
|
-
|
84
|
-
## How to contribute
|
85
|
-
|
86
|
-
See [Contributing](CONTRIBUTING.md).
|
87
|
-
|
88
|
-
### Browse Decidim
|
89
|
-
|
90
|
-
After you create a development app (`bundle exec rake development_app`), you
|
91
|
-
have to switch to it and boot the rails server with `cd development_app &&
|
92
|
-
bundle exec rails s`.
|
93
|
-
|
94
|
-
After that, you can:
|
95
|
-
|
96
|
-
* Browse the main interface at `http://localhost:3000`, and log in as: user@example.org | decidim123456
|
97
|
-
* Browse the admin interface at `http://localhost:3000/admin`, and log in as: admin@example.org | decidim123456
|
98
|
-
* Browse the system interface at `http://localhost:3000/system`, and log in as: system@example.org | decidim123456
|
99
|
-
|
100
|
-
Also, if you want to verify yourself against the default authorization handler use a document number ended with "X".
|
101
|
-
|
102
|
-
## Modules
|
103
|
-
|
104
|
-
If you need to have some features that we don't have yet, we recommend that you make a module. This is a Ruby on Rails engine with some APIs specific to Decidim (for registering with the menus, integration with spaces like Participatory Processes or Assemblies, with /admin or /api, etc).
|
105
|
-
|
106
|
-
As a base you can use these modules, although check first that the version is compatible with your current Decidim version. Also you should know that until v1.0.0 We're under development and these internal APIs can change. We recommend that you extensively test your module.
|
107
|
-
|
108
|
-
See [Modules page on Decidim.org](https://decidim.org/modules).
|
109
|
-
|
110
|
-
### Authorizations Strategies
|
111
|
-
|
112
|
-
One specific thing regarding these kind of applications is the [authorization/verification](decidim-verifications/README.md) logic. Here are some examples:
|
113
|
-
|
114
|
-
* [Barcelona (City)](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/master/app/services/census_authorization_handler.rb)
|
115
|
-
* [Calafell](https://github.com/AjuntamentdeCalafell/decidim-calafell/blob/master/app/services/census_authorization_handler.rb)
|
116
|
-
* [DIBA (Barcelona Province)](https://github.com/diputacioBCN/decidim-diba/blob/master/decidim-diba_census_api/app/services/diba_census_api_authorization_handler.rb)
|
117
|
-
* [Gavà](https://github.com/AjuntamentDeGava/decidim-gava/blob/master/app/services/census_authorization_handler.rb)
|
118
|
-
* [Hospitalet de Llobregat](https://github.com/HospitaletDeLlobregat/decidim-hospitalet/blob/master/app/services/census_authorization_handler.rb)
|
119
|
-
* [Malgrat de Mar](https://github.com/AjMalgrat/decidim-malgrat/blob/master/app/services/carpetaciutada_handler.rb)
|
120
|
-
* [Mataró](https://github.com/AjuntamentDeMataro/decidimmataro.cat/blob/master/app/services/census_authorization_handler.rb)
|
121
|
-
* [Pamplona](https://github.com/ErabakiPamplona/erabaki/blob/master/app/services/census_authorization_handler.rb)
|
122
|
-
* [Reus](https://github.com/AjuntamentdeReus/decidim/blob/master/app/services/census_authorization_handler.rb)
|
123
|
-
* [Sabadell](https://github.com/AjuntamentDeSabadell/decidim-sabadell/blob/master/app/services/census_authorization_handler.rb)
|
124
|
-
* [Sant Cugat](https://github.com/AjuntamentdeSantCugat/decidim-sant_cugat/blob/master/app/services/census_authorization_handler.rb)
|
125
|
-
* [Terrassa](https://github.com/AjuntamentDeTerrassa/decidim-terrassa/blob/master/app/services/census_authorization_handler.rb)
|
126
|
-
* [Vilanova i la Geltrú](https://github.com/vilanovailageltru/decidim-vilanova/blob/master/app/services/vilanova_authorization_handler.rb)
|
127
|
-
|
128
|
-
Other special verifications:
|
129
|
-
|
130
|
-
* [Podemos](https://github.com/podemos-info/participa2/tree/master/decidim-module-census_connector)
|
131
|
-
* [FundAction](https://github.com/ElectricThings/fund_action/blob/master/app/services/anybody_authorization_handler.rb)
|
132
|
-
* [CSV emails](https://github.com/CodiTramuntana/decidim-verifications-csv_emails)
|
133
|
-
* [Access Requests](https://github.com/mainio/decidim-module-access_requests)
|
134
|
-
|
135
|
-
## Following our license
|
136
|
-
|
137
|
-
If you plan to release your application you'll need to publish it using the same license: GPL Affero 3. We recommend doing that on GitHub before publishing, you can read more on "[Being Open Source From Day One is Especially Important for Government Projects](http://producingoss.com/en/governments-and-open-source.html#starting-open-for-govs)". If you have any trouble you can contact us on [Gitter](https://gitter.im/decidim/decidim).
|
138
|
-
|
139
|
-
## Example applications
|
140
|
-
|
141
|
-
Since Decidim is a ruby gem, you can check out the [dependent repositories](https://github.com/decidim/decidim/network/dependents?type=application) to see how many applications are on the wild or tests that other developers have made. Here's a partial list with some of the projects that have used Decidim:
|
142
|
-
|
143
|
-
* [Demo](http://staging.decidim.codegram.com)
|
144
|
-
* [Decidim Barcelona](https://decidim.barcelona) - [View code](https://github.com/AjuntamentdeBarcelona/decidim-barcelona)
|
145
|
-
* [L'H ON Participa](https://www.lhon-participa.cat) - [View code](https://github.com/HospitaletDeLlobregat/decidim-hospitalet)
|
146
|
-
* [Decidim Terrassa](https://participa.terrassa.cat) - [View code](https://github.com/AjuntamentDeTerrassa/decidim-terrassa)
|
147
|
-
* [Decidim Sabadell](https://decidim.sabadell.cat) - [View code](https://github.com/AjuntamentDeSabadell/decidim-sabadell)
|
148
|
-
* [Decidim Gavà](https://participa.gavaciutat.cat) - [View code](https://github.com/AjuntamentDeGava/decidim-gava)
|
149
|
-
* [Decidim Sant Cugat](https://decidim.santcugat.cat/) - [View code](https://github.com/AjuntamentdeSantCugat/decidim-sant_cugat)
|
150
|
-
* [Vilanova Participa](http://participa.vilanova.cat) - [View code](https://github.com/vilanovailageltru/decidim-vilanova)
|
151
|
-
* [Erabaki Pamplona](https://erabaki.pamplona.es) - [View code](https://github.com/ErabakiPamplona/erabaki)
|
152
|
-
* [Decidim Mataró](https://www.decidimmataro.cat) - [View code](https://github.com/AjuntamentDeMataro/decidim-mataro)
|
153
|
-
* [MetaDecidim](https://meta.decidim.barcelona/) - [View Code](https://github.com/decidim/metadecidim)
|
154
|
-
|
155
|
-
## Security
|
156
|
-
|
157
|
-
Security is very important to us. If you have any issue regarding security, please disclose the information responsibly by sending an email to security [at] decidim [dot] org and not by creating a github/metadecidim issue. We appreciate your effort to make Decidim more secure. See [full security policy](SECURITY.md).
|
@@ -1,63 +0,0 @@
|
|
1
|
-
# How to add a new authorizable action?
|
2
|
-
|
3
|
-
## Proposals example
|
4
|
-
|
5
|
-
We're going to reproduce the steps to add an action (endorse) for a proposal step by step.
|
6
|
-
|
7
|
-
### Configuring a new 'endorse' action
|
8
|
-
|
9
|
-
1. Edit decidim-proposals/lib/decidim/proposals/component.rb
|
10
|
-
1. Add the new 'endorse' action into the `component.actions` array and save the file:
|
11
|
-
|
12
|
-
```ruby
|
13
|
-
component.actions = %w(endorse vote create)
|
14
|
-
```
|
15
|
-
|
16
|
-
1. Translate the action for the corresponding key: `en.decidim.components.proposals.actions.endorse = Endorse`
|
17
|
-
1. Edit `app/permissions/decidim/proposals/permissions.rb` and add the corresponding permission, using `authorized?` method to run the `authorization handler` logic.
|
18
|
-
1. In the endorse proposals controller, enforce that the user has permissions to perform the `endorse` action before actually doing it, using the `enforce_permission_to` method:
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
enforce_permission_to :endorse, :proposal, proposal: proposal
|
22
|
-
```
|
23
|
-
|
24
|
-
1. In the proposals templates, change regular links and buttons to endorse a proposal with calls to `action_authorized_link_to` and `action_authorized_button_to` helpers.
|
25
|
-
1. Restart the server to pick up the changes.
|
26
|
-
|
27
|
-
### Using the new 'endorse' action
|
28
|
-
|
29
|
-
1. Now an admin user should be able to go to a participatory space with a `proposals` component panel and click on its `Permissions` link (the icon with a key). There, an `authorization handler` can be set for the `endorse` action.
|
30
|
-
1. Go to a Proposal detail in the front-end
|
31
|
-
1. Try to endorse the current proposal
|
32
|
-
- If the user has not granted the selected permission, the 'endorse' button should block the action and allow the user to grant the permission with the selected `authorization handler` logic.
|
33
|
-
- If the logger user has already granted the selected permission, the user should be able to perform the endorsement.
|
34
|
-
|
35
|
-
### Allow to configure the related permissions at resource level
|
36
|
-
|
37
|
-
Permissions settings could also be set for an specific resources appart from the full component. Actions should also be related to the resource.
|
38
|
-
|
39
|
-
1. Edit decidim-proposals/lib/decidim/proposals/component.rb
|
40
|
-
1. Add the 'endorse' action into the `resource.actions` array for the `proposal` resource definition and save the file:
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
resource.actions = %w(endorse vote)
|
44
|
-
```
|
45
|
-
|
46
|
-
1. Only if this is the first resource action added, edit the proposals admin templates and use the `resource_permissions_link` helper to link the resource permissions page from each resource in the listing.
|
47
|
-
|
48
|
-
```erb
|
49
|
-
<%= resource_permissions_link(proposal) %>
|
50
|
-
```
|
51
|
-
|
52
|
-
1. In the proposals permission class, pass an extra `resource` named parameter to the calls to the `authorized?` method.
|
53
|
-
|
54
|
-
```ruby
|
55
|
-
authorized?(:endorse, resource: proposal)
|
56
|
-
```
|
57
|
-
|
58
|
-
1. In the proposals templates, also add the extra `resource` parameter to the `action_authorized_link_to` and `action_authorized_button_to` helpers.
|
59
|
-
1. Restart the server to pick up the changes.
|
60
|
-
|
61
|
-
### Using permissions at resource level
|
62
|
-
|
63
|
-
1. Now an admin user should be able to go to a participatory space with a `proposals` component panel and click on its `Permissions` link (the icon with a key). There, an `authorization handler` can be set for the `endorse` action.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# How to add dummy content to a development application?
|
2
|
-
|
3
|
-
## Proposals example
|
4
|
-
|
5
|
-
1. In decidim-proposals open `lib/decidim/proposals/component.rb`.
|
6
|
-
1. Find the `component.seeds do...` block.
|
7
|
-
1. Create your dummy content as if you were in a `db/seed.rb` script.
|
8
|
-
- Take advantage of the Faker gem, already in decidim.
|
9
|
-
- You can use https://github.com/decidim/decidim/blob/master/decidim-core/lib/decidim/faker/localized.rb, which uses `Faker` internally, if you need content for i18n fields.
|
@@ -1,83 +0,0 @@
|
|
1
|
-
# Data Picker
|
2
|
-
|
3
|
-
Simple HTML `select`s are not usable enough for the big collections of data Decidim has. We tried using `select2`, but we found problems with its usage and responsiveness, so we moved to a custom data picker. Also, there are many kinds of data that can be selected and many better usable ways to select this data than the simple select provided by html.
|
4
|
-
|
5
|
-
Current Decidim's selector is inspired on [this](https://medium.com/@mibosc/responsive-design-why-and-how-we-ditched-the-good-old-select-element-bc190d62eff5) article.
|
6
|
-
|
7
|
-
Data Picker is a selector thought to be reusable in many contexts and kinds of data. The idea behind it is a reusable widget that opens a popup where the user will perform a given selection and then return to the main page. The popup is accompained by a semitransparent layer behind it to blur the background and keep the user concentrated in the current action, the selection.
|
8
|
-
|
9
|
-
## Artifacts
|
10
|
-
|
11
|
-
Data Picker is composed by 2 visual artifacts, plus the javascript and one controller action for each selection type:
|
12
|
-
|
13
|
-
- **widget**: the first visual artifact is the widget that encapsulates the main Data Picker functionality. This widget manages the rendering of __the button__ that opens the selector and __the popup__. This button is managed via ujs (Unobtrusive JavaScript). The popup is empty and must be filled with a selection partial.
|
14
|
-
- **selection functionality** partial: There are many ways to select things (and many kinds of things to select). Thus, the selection functionality can be customized via a selection partial which will be rendered inside the widget's popup. This partial is supplied to the widget via ajax.
|
15
|
-
- **controller ajax action**: An ajax action will send the content of the popup in an html partial.
|
16
|
-
|
17
|
-
## How to
|
18
|
-
|
19
|
-
### Placing the Data Picker widget
|
20
|
-
|
21
|
-
The Data Picker widget structure is as follows:
|
22
|
-
|
23
|
-
```html
|
24
|
-
<div id="some-unique-id" class="data-picker <%= picker_options[:class]%>" data-picker-name="<%=picker_options[:name]%>">
|
25
|
-
<div class="picker-values"><% @form.proposals.each do |proposal, params| %>
|
26
|
-
<div><a href="<%= prompt_params[:url] %>" data-picker-value="<%=proposal%>"><%=proposal%></a></div>
|
27
|
-
<% end %></div>
|
28
|
-
<div class="picker-prompt"><a href="<%= prompt_params[:url] %>"><%= prompt_params[:text] %></a></div>
|
29
|
-
</div>
|
30
|
-
```
|
31
|
-
|
32
|
-
Placing the widget in a form requires two steps:
|
33
|
-
|
34
|
-
It is a good way to implement the widget to think that it is a component that takes parameters.
|
35
|
-
|
36
|
-
1. Prepare Data Picker parameters
|
37
|
-
Data Picker takes two arguments the `picker_params` hash (to fill the main div) and the `prompt_params` hash (for the `picker-prompt` div).
|
38
|
-
- `picker_params.id`: the html unique id of the widget instance, required by the JavaScript.
|
39
|
-
- `picker_params.name`: the html name of the widget which will be sent by the form.
|
40
|
-
- `picker_params.class`: one of `picker-multiple`, when user can select multiple data, or `picker-single`, when only one data is to be selected.
|
41
|
-
|
42
|
-
1. Html for the Data Picker widget
|
43
|
-
|
44
|
-
### Selector popup content
|
45
|
-
|
46
|
-
**Anchors** in the selector can have the following attributes:
|
47
|
-
|
48
|
-
- data-close: this anchor will be ignored and will close the picker
|
49
|
-
- href: the url to be used for choosing
|
50
|
-
- picker-choose: when not present the picker will navigate as a regular anchor. Otherwise a choose action in the component is invoked with params: `url: href, value: picker-value, text: picker-text`.
|
51
|
-
- picker-value: the selected value
|
52
|
-
- picker-text (optional): The text to be shown in the picker button.
|
53
|
-
|
54
|
-
This is an example of a link used to choose an element:
|
55
|
-
|
56
|
-
```html
|
57
|
-
<a class="button" href="[picker path browsing this element]" data-picker-text="[text]" data-picker-value="[value]" data-picker-choose>[text]</a>
|
58
|
-
```
|
59
|
-
|
60
|
-
**Checkboxes** also can be used in the selector, to allow to select several values at once. In this case, the `href` attribute is replaced with `data-picker-url` and the `data-picker-value` attribute is replaced with the `value` built-in attribute.
|
61
|
-
|
62
|
-
This is an example of a checkbox that allow to choose an element without closing the picker:
|
63
|
-
|
64
|
-
```html
|
65
|
-
<label><input type="checkbox" data-picker-url="[picker path browsing this element]" data-picker-text="[text]" value="[value]" data-picker-choose>[text]</label>
|
66
|
-
```
|
67
|
-
|
68
|
-
## Examples of use of the DataPicker
|
69
|
-
|
70
|
-
- Scopes picker: Allows to browse the tree of scopes and select one or several scopes.
|
71
|
-
- [FormBuilder scopes picker field](../../decidim-core/lib/decidim/form_builder.rb): Basic method to render a scope picker for a form.
|
72
|
-
- [FilterFormBuilder scopes picker field](../../decidim-core/lib/decidim/filter_form_builder.rb): Basic method to render a scope picker for a filter form.
|
73
|
-
- [Scopes pickers helpers](../../decidim-core/app/helpers/decidim/scopes_helper.rb): Helpers to simplify the call to basic methods.
|
74
|
-
- [Global scopes picker controller](../../decidim-core/app/controllers/decidim/scopes_controller.rb): Controller used to browse the scopes on a picker in any part of the application.
|
75
|
-
- [Proposals' frontend form using a scopes picker](../../decidim-proposals/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb): Use of a scope picker helper on a frontend page.
|
76
|
-
- [Proposals' admin form using a scopes picker](../../decidim-proposals/app/views/decidim/proposals/admin/proposals/_form.html.erb): Use of a scope picker helper on an admin page.
|
77
|
-
- [Meetings' multiple scopes picker for filtering](../../decidim-meetings/app/views/decidim/meetings/meetings/_filters.html.erb): Use of a multiple scopes picker on a filter form.
|
78
|
-
- Proposals picker: Allows to search and select multiple proposals to be referenced from other components.
|
79
|
-
- [Proposals pickers helper](../../decidim-proposals/app/helpers/decidim/proposals/admin/proposals_picker_helper.rb): Helper to render a DataPicker for proposals selection.
|
80
|
-
- [Proposals picker concern for admin pages](../../decidim-proposals/app/controllers/concerns/decidim/proposals/admin/picker.rb): You will need to add this concern to your controller, add a route for `proposals_picker` endpoint and create a view for it to show the proposals picker in your component context.
|
81
|
-
- [Proposals picker cell](../../decidim-proposals/app/cells/decidim/proposals/proposals_picker_cell.rb): You can use this cell to reuse the logic in your picker view.
|
82
|
-
- [Accountability's admin controller with a proposals picker](../../decidim-accountability/app/controllers/decidim/accountability/admin/results_controller.rb): It only needs to add the concern (and the endpoint to the routes).
|
83
|
-
- [Accountability's admin view with a proposals picker](../../decidim-accountability/app/views/decidim/accountability/admin/results/proposals_picker.html.erb): It only needs to render the cell.
|
data/docs/advanced/deploy.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# Deploy
|
2
|
-
|
3
|
-
## Self-hosted
|
4
|
-
|
5
|
-
You can install Decidim like a regular Ruby on Rails application, with nginx, Passenger, rbenv and PostgreSQL. You should also configure a valid SMTP account to send emails and add the delayed_job gem and execute it so you can receive emails (ie on user registration).
|
6
|
-
|
7
|
-
## Heroku
|
8
|
-
|
9
|
-
You can follow an opinionated Rails generator to configure your decidim app so that it can be [deployed to Heroku](https://github.com/codegram/decidim-deploy-heroku).
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# How to create a Decidim component
|
2
|
-
|
3
|
-
Use [decidim-generators](https://github.com/decidim/decidim/tree/master/decidim-generators) to
|
4
|
-
automatically generate a decidim component skeleton, or copy the basic structure
|
5
|
-
of an existing mantained plugin.
|
6
|
-
|
7
|
-
Upload the component to GitHub with the naming *decidim-module-<engine_name>*,
|
8
|
-
so it's easier to find on the
|
9
|
-
[dependency graph](https://github.com/decidim/decidim/network/dependents).
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# Create your own machine translation service
|
2
|
-
|
3
|
-
You can use the `Decidim::Dev::DummyTranslator` service as a base. Any new translator service will need to implement the same API as this class.
|
4
|
-
|
5
|
-
## Integrating with async services
|
6
|
-
|
7
|
-
Some translation services are async, which means that some extra work is needed. This is the main overview:
|
8
|
-
|
9
|
-
- The Translation service will only send the translation request. It should have a way to send what resource, field and target locale are related to that translation.
|
10
|
-
- You'll need to create a custom controller in your application to receive the callback from the translation service when the translation is finished
|
11
|
-
- From that new endpoint, find a way to find the related resource, field and target locale. Then start a `Decidim::MachineTranslationSaveJob` with that data. This job will handle how to save the data in the DB.
|
12
|
-
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Managing translations (i18n)
|
2
|
-
|
3
|
-
## The workflow
|
4
|
-
|
5
|
-
Decidim uses [Crowdin](https://crowdin.com/) to manage the translations.
|
6
|
-
|
7
|
-
- Whenever someone [adds a new translation key](https://github.com/decidim/decidim/pull/1814/files#diff-c78c80097da59920d55b3f462ca21afaR177) to _Decidim_, _Crowdin_ gets notified and the new content is available to be translated from [Crowdin's Decidim dashboard](https://crowdin.com/project/decidim).
|
8
|
-
- When a translator translates any key from Crowdin, it automatically creates a [PR in Github](https://github.com/decidim/decidim/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Adecidim-bot%20Crowdin), adding the keys in the corresponding _yaml_ files.
|
9
|
-
- 🌈
|
10
|
-
|
11
|
-
## Adding a new language
|
12
|
-
|
13
|
-
- Setup the new language in [_Crowdin's Decidim project_](https://crowdin.com/project/decidim) (or open an issue on Github asking an admin to do that).
|
14
|
-
- Add the locale mapping in the `crowdin.yml` file
|
15
|
-
- Translate at least one key from every engine, so, your _yaml_ files are not empty. The easiest way to do this is to automatically translate and sync all the content. Later you'll be able to fix the content that wasn't properly translated.
|
16
|
-
- Add [Foundation Datepicker](https://github.com/najlepsiwebdesigner/foundation-datepicker/tree/master/js/locales)'s translations ([PR](https://github.com/decidim/decidim/pull/2039)).
|
17
|
-
- Add the new language to `available_locales` ([PR](https://github.com/decidim/decidim/pull/1991)).
|
18
|
-
- Add the language in [decidim-core/spec/lib/available_locales_spec.rb](https://github.com/decidim/decidim/pull/5080/files#diff-9c9dc1c8c25dcecdfb8ce555d5ef5e47R15).
|
19
|
-
|
20
|
-
## Test the new language
|
21
|
-
|
22
|
-
- Generate the development app and `cd` into it.
|
23
|
-
- Change the `config/initializer/decidim.rb` file and add your locale to `Decidim.available_locales`.
|
24
|
-
- `rake db:drop db:setup` to drop, create, load schema and seed the DB.
|
data/docs/advanced/metrics.md
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
# Metrics
|
2
|
-
|
3
|
-
Metrics calculations must be executed everyday. Some `rake task` have been added to perform it.
|
4
|
-
|
5
|
-
- To execute all metrics at once. Related to previous date from *today*
|
6
|
-
|
7
|
-
```ruby
|
8
|
-
bundle exec rake decidim:metrics:all
|
9
|
-
```
|
10
|
-
|
11
|
-
- To execute an specific metric. Related to previous date from *today*
|
12
|
-
|
13
|
-
```ruby
|
14
|
-
bundle exec rake decidim:metrics:one["<metric name>"]
|
15
|
-
```
|
16
|
-
|
17
|
-
- To execute metrics for a given date (all or an specific one)
|
18
|
-
|
19
|
-
```ruby
|
20
|
-
bundle exec rake decidim:metrics:all["YYYY-MM-DD"]
|
21
|
-
bundle exec rake decidim:metrics:one["<metric name>","YYYY-MM-DD"]
|
22
|
-
```
|
23
|
-
|
24
|
-
- It is possible to rebuild one or all metrics since some specific day. This is useful in case current metrics are no generated or corrupt. **Depending on the size of the database this can take a long time!**. The command will execute the same calculations as the commands above for **each** day between *today* and the date specified.
|
25
|
-
|
26
|
-
- To rebuild metrics since a given date (all or an specific one)
|
27
|
-
|
28
|
-
```ruby
|
29
|
-
bundle exec rake decidim:metrics:rebuild["YYYY-MM-DD"]
|
30
|
-
bundle exec rake decidim:metrics:rebuild["<metric name>","YYYY-MM-DD"]
|
31
|
-
```
|
32
|
-
|
33
|
-
## Available metrics
|
34
|
-
|
35
|
-
- Use the command `decidim:metrics:list` to list all available metrics using the console:
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
bundle exec rake decidim:metrics:list
|
39
|
-
```
|
40
|
-
|
41
|
-
Currently, available metrics are:
|
42
|
-
|
43
|
-
- **users**, created `Users`
|
44
|
-
- **proposals**, published, not withdrawn and not *hidden* `Proposals`
|
45
|
-
- **accepted_proposals**, accepted `Proposals`
|
46
|
-
- **supports**, supports given to `Proposals`
|
47
|
-
- **assemblies**, published `Assemblies`
|
48
|
-
- **participatory_processes**, published `ParticipatoryProcesses`
|
49
|
-
- **results**, `Results` in `Accountability`
|
50
|
-
- **comments**, `Comments` generated by users, related to public elements and not *hidden*
|
51
|
-
- **meetings**, public `Meetings`
|
52
|
-
|
53
|
-
Only available for `ParticipatorySpaces` (restricted to `ParticipatoryProcesses`)
|
54
|
-
|
55
|
-
- **participants**, unique users who make at least one of the following actions:
|
56
|
-
- Answer a survey
|
57
|
-
- Create a debate
|
58
|
-
- Create a proposal
|
59
|
-
- Endorse a proposal
|
60
|
-
- Leave a comment
|
61
|
-
- Support a proposal
|
62
|
-
- Vote a participatory budgeting project
|
63
|
-
- **followers**, unique users who follow any participatory element in a `ParticipatorySpace`
|
64
|
-
- **endorsements**, number of `Endorsements` in `Proposals`, within a `ParticipatorySpace`
|
65
|
-
- **debates**, number of `Debates` within a `ParticipatorySpace`
|
66
|
-
- **survey_answers**, number of answered `Surveys` by users within a `ParticipatorySpace`
|
67
|
-
|
68
|
-
## Configuration
|
69
|
-
|
70
|
-
- A **crontab** line must be added to your server to maintain them updated daily. You could use [Whenever](https://github.com/javan/whenever) to manage it directly from the APP. You probably want to schedule a `bundle exec rake decidim:metrics:all` every night.
|
71
|
-
- An **ActiveJob** queue, like [Sidekiq](https://github.com/mperham/sidekiq) or [DelayedJob](https://github.com/collectiveidea/delayed_job/)
|
72
|
-
|
73
|
-
## Persistence
|
74
|
-
|
75
|
-
The metrics module percomutes calculations and persists them into
|
76
|
-
`decidim_metrics` database table. So this module only uses one single table to
|
77
|
-
persist metrics from all times and types.
|
78
|
-
|
79
|
-
The `decidim_metrics` table has the following fields:
|
80
|
-
|
81
|
-
- `day`: the day for which the metric has been computed.
|
82
|
-
- `metric_type`: the type of the metric. One of: users, proposals, accepted_proposals, supports, assemblies.
|
83
|
-
- `cumulative`: quantity accumulated to day ”day”.
|
84
|
-
- `quantity`: quantity for the current day, ”day”.
|
85
|
-
- `decidim_organization_id`: the FK to the organization to which this Metric belongs to.
|
86
|
-
- `participatory_space_type` + `participatory_space_id`: the FK to the participatory space to which this Metric belongs to, if any.
|
87
|
-
- `related_object_type` + `related_object_id`: the FK to the object to which this Metric belongs to, if any.
|
88
|
-
- `decidim_category_id`: the FK to the category for this Metric, if any.
|
89
|
-
|
90
|
-
Relations around `decidim_metrics` table:
|
91
|
-
|
92
|
-
```ascii
|
93
|
-
+------------------------+
|
94
|
-
+--------------+ | ParticipatoryProcesses |
|
95
|
-
| Organization | +----+------------------------+
|
96
|
-
+------+-------+ |
|
97
|
-
| +--------------------+ | +------------+
|
98
|
-
| | | +----+ Assemblies |
|
99
|
-
| +----->+ ParticipatorySpace +<----+ +------------+
|
100
|
-
| | | | | +-------------+
|
101
|
-
| | +--------------------+ +----+ Initiatives |
|
102
|
-
| | | +-------------+
|
103
|
-
| | |
|
104
|
-
| | | +---------------+
|
105
|
-
+-----+-------+---+ +----+ Consultations |
|
106
|
-
| | +---------------+
|
107
|
-
| decidim_metrics |
|
108
|
-
| |
|
109
|
-
+--------+--------+ +----------------+
|
110
|
-
| | related_object |
|
111
|
-
+--------------->+ |
|
112
|
-
| [polymorphic] |
|
113
|
-
+----------------+
|
114
|
-
```
|