decidim 0.10.1 → 0.11.0.pre1
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/README.md +8 -7
- data/Rakefile +17 -31
- data/docs/add_authenticable_action.md +12 -5
- data/docs/adding_fixtures_aka_dummy_content.md +4 -2
- data/docs/advanced/components.md +60 -0
- data/docs/advanced/content_processors.md +20 -0
- data/docs/advanced/followers.md +2 -2
- data/docs/advanced/view_models_aka_cells.md +91 -0
- data/docs/checklist.md +47 -0
- data/docs/customization/code.md +5 -3
- data/docs/customization/gemfile.md +2 -2
- data/docs/customization/javascript.md +1 -1
- data/docs/customization/oauth.md +23 -0
- data/docs/customization/styles.md +3 -7
- data/docs/data-picker.md +10 -3
- data/docs/getting_started.md +60 -25
- data/docs/services/analytics.md +1 -1
- data/docs/services/geocoding.md +4 -4
- data/docs/services/social_providers.md +26 -26
- data/lib/decidim.rb +2 -0
- data/lib/decidim/{component_manager.rb → gem_manager.rb} +49 -4
- data/lib/decidim/version.rb +1 -1
- metadata +82 -55
- data/Gemfile +0 -26
- data/Gemfile.lock +0 -606
- data/bin/decidim +0 -6
- data/docs/advanced/features.md +0 -60
- data/lib/generators/decidim/app_generator.rb +0 -159
- data/lib/generators/decidim/install_generator.rb +0 -138
- data/lib/generators/decidim/templates/Dockerfile.erb +0 -1
- data/lib/generators/decidim/templates/README.md.erb +0 -22
- data/lib/generators/decidim/templates/cable.yml.erb +0 -9
- data/lib/generators/decidim/templates/carrierwave.rb +0 -28
- data/lib/generators/decidim/templates/database.yml.erb +0 -87
- data/lib/generators/decidim/templates/decidim.scss.erb +0 -3
- data/lib/generators/decidim/templates/decidim_controller.rb.erb +0 -5
- data/lib/generators/decidim/templates/docker-compose.yml.erb +0 -26
- data/lib/generators/decidim/templates/example_authorization_handler.rb +0 -55
- data/lib/generators/decidim/templates/initializer.rb +0 -47
- data/lib/generators/decidim/templates/secrets.yml.erb +0 -61
- data/lib/generators/decidim/templates/social_share_button.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8869506923bb1b565c76cbe0463fd7b1f7d4083a5aa00da273c8a9cdde4d6dc2
|
4
|
+
data.tar.gz: 770aec669bd01da230f273005c91ebd93d72b097b967896db63aa2520d683394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8449a22cb0385d2e3f07541ed922f5af8da6377a8a9aaf1c1711bfdf26ec325fb48c94451b980d4988ca4c9b6cf350ef070a7707ada051749930983346ecfa
|
7
|
+
data.tar.gz: c01c852c89029bc624042c33e6c8fbb1273232fc68d059d744b162ea9d45765f0e121edbe6979170b8f97773c341a1f9cb9e360a90e9e68c87d17e574260decf
|
data/README.md
CHANGED
@@ -20,7 +20,6 @@ Code quality
|
|
20
20
|
|
21
21
|
[![Build Status](https://img.shields.io/circleci/project/github/decidim/decidim/master.svg)](https://circleci.com/gh/decidim/decidim)
|
22
22
|
[![Maintainability](https://api.codeclimate.com/v1/badges/ad8fa445086e491486b6/maintainability)](https://codeclimate.com/github/decidim/decidim/maintainability)
|
23
|
-
[![codecov](https://img.shields.io/codecov/c/github/decidim/decidim.svg)](https://codecov.io/gh/decidim/decidim)
|
24
23
|
[![Dependency Status](https://img.shields.io/gemnasium/decidim/decidim.svg)](https://gemnasium.com/github.com/decidim/decidim)
|
25
24
|
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/decidim/localized.svg)](https://crowdin.com/project/decidim)
|
26
25
|
[![Inline docs](http://inch-ci.org/github/decidim/decidim.svg?branch=master)](http://inch-ci.org/github/decidim/decidim)
|
@@ -88,29 +87,31 @@ Also, if you want to verify yourself against the default authorization handler u
|
|
88
87
|
| [Budgets](https://github.com/decidim/decidim/tree/master/decidim-budgets) | Adds a participatory budgets system to any participatory space. |
|
89
88
|
| [Comments](https://github.com/decidim/decidim/tree/master/decidim-comments) | The Comments module adds the ability to include comments to any resource which can be commentable by users. |
|
90
89
|
| [Core](https://github.com/decidim/decidim/tree/master/decidim-core) | The basics of Decidim: users, organizations, etc. This is the only required engine to run Decidim, all the others are optional. |
|
90
|
+
| [Generators](https://github.com/decidim/decidim/tree/master/decidim-generators) | It helps you with generating decidim applications & new components. It provides the `decidim` executable.
|
91
91
|
| [Participatory Processes](https://github.com/decidim/decidim/tree/master/decidim-participatory_processes) | The main concept of a Decidim installation: participatory processes. |
|
92
|
-
| [Dev](https://github.com/decidim/decidim/tree/master/decidim-dev) | Aids the local development of Decidim's
|
92
|
+
| [Dev](https://github.com/decidim/decidim/tree/master/decidim-dev) | Aids the local development of Decidim's components. |
|
93
93
|
| [Meeting](https://github.com/decidim/decidim/tree/master/decidim-meetings) | The Meeting module adds meeting to any participatory space. It adds a CRUD engine to the admin and public view scoped inside the participatory space. |
|
94
94
|
| [Pages](https://github.com/decidim/decidim/tree/master/decidim-pages) | The Pages module adds static page capabilities to any participatory space. It basically provides an interface to include arbitrary HTML content to any step. |
|
95
|
-
| [Proposals](https://github.com/decidim/decidim/tree/master/decidim-proposals) | The Proposals module adds one of the main
|
95
|
+
| [Proposals](https://github.com/decidim/decidim/tree/master/decidim-proposals) | The Proposals module adds one of the main components of Decidim: allows users to contribute to a participatory space by creating proposals. |
|
96
96
|
| [Surveys](https://github.com/decidim/decidim/tree/master/decidim-surveys) | Adds the ability for admins to create arbitrary surveys. |
|
97
97
|
| [System](https://github.com/decidim/decidim/tree/master/decidim-system) | Multitenant Admin to manage multiple organizations in a single installation. |
|
98
|
+
| [Sortitions](https://github.com/decidim/decidim/tree/master/decidim-sortitions) | This 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. |
|
99
|
+
| [Consultations](https://github.com/decidim/decidim/tree/master/decidim-consultations) | This module creates a new space for decidim to host consultations: debates around critical questions and a proxy for eVoting |
|
100
|
+
| [Initiatives](https://github.com/decidim/decidim/tree/master/decidim-initiatives) | Initiatives is the place on Decidim's where citizens can promote a civic initiative. Unlike participatory processes that must be created by an administrator, Civic initiatives can be created by any user of the platform. |
|
101
|
+
| [Blogs](https://github.com/decidim/decidim-module-blogs) | This component makes possible to add posts ordered by publication time to spaces. |
|
98
102
|
|
99
103
|
### Official (on development)
|
100
104
|
|
101
105
|
| Module | Description |
|
102
106
|
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
103
107
|
| [Blogs](https://github.com/decidim/decidim-module-blogs) | This component makes possible to add posts ordered by publication time to spaces. |
|
104
|
-
| [Consultations](https://github.com/decidim/decidim-module-consultations) | This module creates a new space for decidim to host consultations: debates around critical questions and a proxy for eVoting |
|
105
|
-
| [Initiatives](https://github.com/decidim/decidim-initiatives) | Initiatives is the place on Decidim's where citizens can promote a civic initiative. Unlike participatory processes that must be created by an administrator, Civic initiatives can be created by any user of the platform. |
|
106
|
-
| [Sortitions](https://github.com/decidim/decidim-module-sortitions) | This 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. |
|
107
108
|
|
108
109
|
### Community
|
109
110
|
|
110
111
|
| Module | Description |
|
111
112
|
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
112
113
|
| [Census](https://github.com/diputacioBCN/decidim-diba/tree/master/decidim-census) | Allows to upload a census CSV file to perform authorizations against real users parameterised by their age. |
|
113
|
-
| [Crowdfunding](https://github.com/podemos-info/decidim-module-crowdfundings) | This rails engine implements a Decidim
|
114
|
+
| [Crowdfunding](https://github.com/podemos-info/decidim-module-crowdfundings) | This rails engine implements a Decidim component that allows to the administrators to configure crowfunding campaigns for a participatory space. |
|
114
115
|
| [DataViz](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/tree/master/decidim-dataviz) | The Dataviz module adds the PAM data visualizations to any participatory process but it is intended to be used just for the PAM participatory process. |
|
115
116
|
| [Members](https://github.com/ElectricThings/decidim-members) | Members list and search plugin for Decidim |
|
116
117
|
| [Pol.is](https://github.com/OpenSourcePolitics/decidim-polis) | Pol.is integration on Decidim |
|
data/Rakefile
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rspec/core/rake_task"
|
5
|
-
require "
|
6
|
-
require "decidim/component_manager"
|
5
|
+
require "decidim/gem_manager"
|
7
6
|
|
8
7
|
RSpec::Core::RakeTask.new(:spec)
|
9
8
|
|
@@ -14,44 +13,21 @@ task test_all: [:test_main, :test_subgems]
|
|
14
13
|
|
15
14
|
desc "Runs all tests in decidim subgems"
|
16
15
|
task test_subgems: :test_app do
|
17
|
-
Decidim::
|
16
|
+
Decidim::GemManager.run_all("rake", include_root: false)
|
18
17
|
end
|
19
18
|
|
20
19
|
desc "Runs all tests in the main decidim gem"
|
21
20
|
task :test_main do
|
22
|
-
Decidim::
|
21
|
+
Decidim::GemManager.new(__dir__).run("rake")
|
23
22
|
end
|
24
23
|
|
25
24
|
desc "Update version in all gems to the one set in the `.decidim-version` file"
|
26
25
|
task :update_versions do
|
27
|
-
Decidim::
|
26
|
+
Decidim::GemManager.replace_versions
|
28
27
|
end
|
29
28
|
|
30
|
-
|
31
|
-
|
32
|
-
Decidim::ComponentManager.run_all(
|
33
|
-
"gem build %name && mv %name-%version.gem ..",
|
34
|
-
include_root: false
|
35
|
-
)
|
36
|
-
|
37
|
-
Decidim::ComponentManager.new(__dir__).run(
|
38
|
-
"gem build %name && gem install *.gem"
|
39
|
-
)
|
40
|
-
end
|
41
|
-
|
42
|
-
desc "Uninstalls all gems locally."
|
43
|
-
task :uninstall_all do
|
44
|
-
Decidim::ComponentManager.run_all(
|
45
|
-
"gem uninstall %name -v %version --executables --force"
|
46
|
-
)
|
47
|
-
|
48
|
-
Decidim::ComponentManager.new(__dir__).run(
|
49
|
-
"rm decidim-*.gem"
|
50
|
-
)
|
51
|
-
end
|
52
|
-
|
53
|
-
Decidim::ComponentManager.all_dirs(include_root: false) do |dir|
|
54
|
-
manager = Decidim::ComponentManager.new(dir)
|
29
|
+
Decidim::GemManager.all_dirs(include_root: false) do |dir|
|
30
|
+
manager = Decidim::GemManager.new(dir)
|
55
31
|
name = manager.short_name
|
56
32
|
|
57
33
|
desc "Runs tests on #{name}"
|
@@ -60,9 +36,19 @@ Decidim::ComponentManager.all_dirs(include_root: false) do |dir|
|
|
60
36
|
end
|
61
37
|
end
|
62
38
|
|
39
|
+
desc "Runs tests for a random participatory space"
|
40
|
+
task :test_participatory_space do
|
41
|
+
Decidim::GemManager.test_participatory_space
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Runs tests for a random component"
|
45
|
+
task :test_component do
|
46
|
+
Decidim::GemManager.test_component
|
47
|
+
end
|
48
|
+
|
63
49
|
desc "Pushes a new build for each gem."
|
64
50
|
task release_all: [:update_versions, :check_locale_completeness, :webpack] do
|
65
|
-
Decidim::
|
51
|
+
Decidim::GemManager.run_all("rake release")
|
66
52
|
end
|
67
53
|
|
68
54
|
desc "Makes sure all official locales are complete and clean."
|
@@ -1,20 +1,27 @@
|
|
1
1
|
# How to add a new authenticable action?
|
2
|
+
|
2
3
|
## Proposals example
|
4
|
+
|
3
5
|
We're going to reproduce the steps to add an action (adhere) for a proposal step by step.
|
6
|
+
|
4
7
|
### Configuring a new 'adhere' action
|
5
|
-
|
6
|
-
1.
|
7
|
-
|
8
|
-
|
8
|
+
|
9
|
+
1. Edit decidim-proposals/lib/decidim/proposals/component.rb
|
10
|
+
1. Add the new 'adhere' action into the `component.actions` array and save the file:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
component.actions = %w(adhere vote create)
|
9
14
|
```
|
10
15
|
|
11
|
-
|
16
|
+
1. Translate the action for the corresponding key: `en.decidim.components.proposals.actions.adhere = Adhere`
|
12
17
|
1. Edit `app/models/decidim/proposals/abilities/current_user_ability.rb` and add the corresponding cancancan ability like `can :adhere, Proposal do |_proposal| ...`.
|
13
18
|
1. Restart the server to pick up the changes.
|
14
19
|
1. Now the admin should be able to go to the Control Panel and edit `PROCESSES/Proposals/Permissions/Adhere` panel. There an `Authorization Handler` can be set.
|
15
20
|
|
16
21
|
### Using the new 'adhere' action
|
22
|
+
|
17
23
|
With a user which has the selected permission verified:
|
24
|
+
|
18
25
|
1. Go to a Proposal detail in the front-end
|
19
26
|
1. Adhere to the current proposal (see ProposalAdhesionsController): the user should be able to perform an adhesion.
|
20
27
|
- If the user had the required permission unverified, the 'adhere' button should block the action. You can check it with an unverified user.
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# How to add dummy content to a development application?
|
2
|
+
|
2
3
|
## Proposals example
|
3
|
-
|
4
|
-
1.
|
4
|
+
|
5
|
+
1. In decidim-proposals open `lib/decidim/proposals/component.rb`.
|
6
|
+
1. Find the `component.seeds do...` block.
|
5
7
|
1. Create your dummy content as if you were in a `db/seed.rb` script.
|
6
8
|
- Take advantage of the Faker gem, already in decidim.
|
7
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.
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Components
|
2
|
+
|
3
|
+
Components are the core contract between external modules and the core. They're used to define pieces of functionality that are pluggable to participatory processes and can be enabled or disabled by the administrator.
|
4
|
+
|
5
|
+
## How do I create a new component?
|
6
|
+
|
7
|
+
Components are just gems with one or more Rails engines included in it. You can use as an example [decidim-pages](https://github.com/decidim/decidim/tree/master/decidim-pages).
|
8
|
+
|
9
|
+
Check out the `lib/decidim/pages` folder: It includes several files, the most important of which is `component.rb`.
|
10
|
+
|
11
|
+
## Defining a component manifest
|
12
|
+
|
13
|
+
Components are defined in a manifest, along with its engine and admin engine counterpart.
|
14
|
+
|
15
|
+
There's a DSL available to describe all this:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
# :my_component is the unique name of the component that will be globally registered.
|
19
|
+
Decidim.register_component(:my_component) do |component|
|
20
|
+
# The user will be redirected to the component's engine when accessing it through
|
21
|
+
# the public page of a participatory process. A component's engine is isolated
|
22
|
+
# from the outside so it can deal with its own dependencies without having to
|
23
|
+
# know its render path or its parent resources.
|
24
|
+
component.engine = MyComponent::Engine
|
25
|
+
|
26
|
+
# A component's admin engine will get rendered on the admin panel and follows
|
27
|
+
# the same principles as the engine. It's isolated from the outside and
|
28
|
+
# doesn't care about external dependencies. It only needs to care about its
|
29
|
+
# underlying `component`.
|
30
|
+
component.admin_engine = MyComponent::AdminEngine
|
31
|
+
|
32
|
+
# Component hooks get called whenever relevant lifecycle events happen, like
|
33
|
+
# adding a new component o destroying it. You always get passed the instance
|
34
|
+
# so you can act on it. Creating or destroying a comoponent is transactional
|
35
|
+
# along with its hooks, so you can decide to halt the transaction by raising
|
36
|
+
# an exception.
|
37
|
+
#
|
38
|
+
# Valid hook names are :create and :destroy.
|
39
|
+
component.on(:create) do |component|
|
40
|
+
MyComponent::DoSomething.with(component)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Export definitions allow components to declare any number of exportable files.
|
44
|
+
#
|
45
|
+
# An export definition needs a unique name, a collection, and a Serializer. If
|
46
|
+
# no serializer is provided, a default, naive one will be used.
|
47
|
+
#
|
48
|
+
# Exports are then exposed via the UI, so the implementer only needs to care
|
49
|
+
# about the export definitions.
|
50
|
+
component.exports :component_resources do |exports|
|
51
|
+
exports.collection do |component|
|
52
|
+
MyComponent::Resource.where(component: component)
|
53
|
+
end
|
54
|
+
|
55
|
+
exports.serializer MyComponent::ResourceSerializer
|
56
|
+
end
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
60
|
+
Every model in a component doesn't have to (and should not) know about its parent participatory process, but instead should be scoped to the components.
|
@@ -12,6 +12,26 @@ Register the content processor in an `initializer`:
|
|
12
12
|
Decidim.content_processors += [:special_words]
|
13
13
|
```
|
14
14
|
|
15
|
+
This symbol will be used to instantiate parsers and processors using the following convention:
|
16
|
+
|
17
|
+
- "Decidim::ContentParsers::#{type.to_s.camelize}Parser"
|
18
|
+
- "Decidim::ContentRenderers::#{type.to_s.camelize}Renderer"
|
19
|
+
|
20
|
+
Autoload parser and renderer if in the lib/ dir. For example if in proposals module edit `lib/decidim/proposals.rb`:
|
21
|
+
|
22
|
+
```rb
|
23
|
+
module Decidim
|
24
|
+
...
|
25
|
+
module ContentParsers
|
26
|
+
autoload :ProposalParser, "decidim/content_parsers/proposal_parser"
|
27
|
+
end
|
28
|
+
module ContentRenderers
|
29
|
+
autoload :ProposalRenderer, "decidim/content_renderers/proposal_renderer"
|
30
|
+
end
|
31
|
+
...
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
15
35
|
Declare the parser class:
|
16
36
|
|
17
37
|
```rb
|
data/docs/advanced/followers.md
CHANGED
@@ -18,8 +18,8 @@ end; p 1
|
|
18
18
|
Run the following script to make all resource authors follow the resource:
|
19
19
|
|
20
20
|
```ruby
|
21
|
-
Decidim.
|
22
|
-
|
21
|
+
Decidim.component_manifests.each do |component_manifest|
|
22
|
+
component_manifest.resource_manifests.each do |resource_manifest|
|
23
23
|
klass = resource_manifest.model_class_name.constantize
|
24
24
|
next unless klass.included_modules.include? Decidim::Authorable
|
25
25
|
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# View Models (a.k.a. Cells)
|
2
|
+
|
3
|
+
## General description
|
4
|
+
|
5
|
+
A cell is an object that represent a fragment of your UI. The scope of that fragment can embrace an entire page, a single comment container in a thread or just an avatar image link.
|
6
|
+
|
7
|
+
Cells are faster than ActionView. While exposing a better performance, you step-wise encapsulate fragments into cell widgets and enforce interfaces.
|
8
|
+
|
9
|
+
### View Model
|
10
|
+
|
11
|
+
Think of cells, or view models, as small Rails controllers, but without any HTTP coupling. Cells embrace all presentation and rendering logic to present a fragment of the UI.
|
12
|
+
|
13
|
+
## Decidim Cards
|
14
|
+
|
15
|
+
`card_for @instance` will render the corresponding default card for each component instance.
|
16
|
+
If a `component.card` is not registered a _basic_ (deafult) card is shown.
|
17
|
+
|
18
|
+
To render a specified size/variation include the `size` option as a `symbol`: `card_for @instance, size: :m`
|
19
|
+
|
20
|
+
## Introducing a Card Cell to a `component`
|
21
|
+
|
22
|
+
- add **dependency** to "decidim-*.gemspec"
|
23
|
+
|
24
|
+
```rb
|
25
|
+
s.add_dependency "cells-erb", "~> 0.1.0"
|
26
|
+
s.add_dependency "cells-rails", "~> 0.0.8"
|
27
|
+
```
|
28
|
+
|
29
|
+
- **autoload** view_model to module `decidim-<module>/lib/decidim/<module>.rb`
|
30
|
+
|
31
|
+
```rb
|
32
|
+
autoload :ViewModel, "decidim/<module>/view_model"
|
33
|
+
```
|
34
|
+
|
35
|
+
- **require** cells in `decidim-<module>/lib/decidim/<module>/engine.rb`
|
36
|
+
|
37
|
+
```rb
|
38
|
+
require "cells/rails"
|
39
|
+
require "cells-erb"
|
40
|
+
|
41
|
+
initializer "decidim_<module>.add_cells_view_paths" do
|
42
|
+
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::<Module>::Engine.root}/app/cells")
|
43
|
+
Cell::ViewModel.view_paths << File.expand_path("#{Decidim::<Module>::Engine.root}/app/views") # for partials
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
- add the *ViewModel* `decidim-<module>/lib/decidim/<module>/view_model.rb`
|
48
|
+
|
49
|
+
```rb
|
50
|
+
module Decidim
|
51
|
+
module <Module>
|
52
|
+
class ViewModel < Decidim::ViewModel
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
- The attribute `card` of the Components is defined in `decidim-core/lib/decidim/component_manifest.rb`:
|
59
|
+
|
60
|
+
```rb
|
61
|
+
# The cell to use to render the card of a resource.
|
62
|
+
attribute :card, String
|
63
|
+
```
|
64
|
+
|
65
|
+
In your `decidim-<component>/lib/decidim/<component>/component.rb` register the cell value:
|
66
|
+
|
67
|
+
```rb
|
68
|
+
component.card = "decidim/<component>s/<component>"
|
69
|
+
```
|
70
|
+
|
71
|
+
- The **Cell Class**, following the convention will reside in `decidim-<component>s/app/cells/decidim/<component>s/<component>_cell.rb`:
|
72
|
+
|
73
|
+
```rb
|
74
|
+
module Decidim
|
75
|
+
module <Component>s
|
76
|
+
class <Component>Cell < Decidim::<Component>s::ViewModel
|
77
|
+
def show
|
78
|
+
render # renders decidim-<component>s/app/cells/decidim/<component>s/<component>
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
85
|
+
- The **Cell Views** will be in the `decidim-<component>s/app/cells/decidim/<component>s/<component>` and defaults to `show.erb`
|
86
|
+
|
87
|
+
## More Info
|
88
|
+
|
89
|
+
- [cells/README.md at master · trailblazer/cells](https://github.com/trailblazer/cells/blob/master/README.md)
|
90
|
+
- [Trailblazer: Cells](http://trailblazer.to/gems/cells/) / [Trailblazer: Cells API](http://trailblazer.to/gems/cells/api.html)
|
91
|
+
- [Introduction to Cells: A Better View Layer for Rails — SitePoint](https://www.sitepoint.com/introduction-to-cells-a-better-view-layer-for-rails/)
|
data/docs/checklist.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Checklist
|
2
|
+
|
3
|
+
As a technopolitical project, Decidim needs several things to work. This is a non comprehensive list that serves as a general recommendation of what things you need to have it working with the best practices:
|
4
|
+
|
5
|
+
## Technological
|
6
|
+
|
7
|
+
1. Choose a **domain** for your application. Some typical names involve "Participation" or "Decision" conjugations.
|
8
|
+
|
9
|
+
1. Choose which **languages** do you want for your application. In case that your language isn't supported you should translate it on [Crowdin](https://crowdin.com/project/decidim).
|
10
|
+
|
11
|
+
1. Customize the [**look and feel**](https://github.com/decidim/decidim/blob/master/docs/customization/styles.md) (colors, pictures, fonts, etc).
|
12
|
+
|
13
|
+
1. Configure **SSL**. We recommend using at least [Let's Encrypt](https://letsencrypt.org/) for a minimum security.
|
14
|
+
|
15
|
+
1. Configure your **SMTP** server.
|
16
|
+
|
17
|
+
1. Setup the **geolocation** service. We recommend using [Here Maps](https://developer.here.com/), but you can use other kind of tiling server compatible with [Open Street Maps](https://www.openstreetmap.org/).
|
18
|
+
|
19
|
+
1. Setup an **analytics** server. For better compliance with Decidim Social Contract, we recommend using [Matomo](https://matomo.org/).
|
20
|
+
|
21
|
+
1. Setup **backup** on your server. The most important things to save are the `public/uploads` and the database.
|
22
|
+
|
23
|
+
1. Decide and implement which kind of **[Authorization](docs/customization/authorization.md)** you're going to use.
|
24
|
+
|
25
|
+
1. Comply with our License (Affero GPL 3) and **publish your code** to [GitHub](http://github.com) or wherever you want.
|
26
|
+
|
27
|
+
1. Review your **decidim initializer** on your application (config/initializers/decidim.rb).
|
28
|
+
|
29
|
+
1. Configure your [**ActiveJob**](https://github.com/decidim/decidim/blob/master/docs/services/activejob.md) background queue.
|
30
|
+
|
31
|
+
1. If you want, configure your [**social providers**](https://github.com/decidim/decidim/blob/master/docs/services/social_providers.md) to enable login using external applications.
|
32
|
+
|
33
|
+
## Contents
|
34
|
+
|
35
|
+
1. Ideally you'll have a **Team** formed with experts on IT, Communication, Participation, Design and Law.
|
36
|
+
|
37
|
+
1. Texts for at least, **terms of use, privacy policy and frequently asked questions**.
|
38
|
+
|
39
|
+
1. Comply with your current **legal requirements**, like to registrate your privacy policy with the autorities (eg LOPD on Spain).
|
40
|
+
|
41
|
+
1. Fill the **Participatory Processes Configuration Form** to prepare your Participatory Process for Decidim.
|
42
|
+
|
43
|
+
1. Read the **[Administration manual](https://decidim.org/docs/)**.
|
44
|
+
|
45
|
+
1. Participate on **[MetaDecidim](http://meta.decidim.barcelona)**.
|
46
|
+
|
47
|
+
1. Read the Decidim **[Social Contract](https://decidim.org/contract/)**.
|
data/docs/customization/code.md
CHANGED
@@ -7,7 +7,7 @@ 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
|
+
```console
|
11
11
|
decidim DecidimBarcelona
|
12
12
|
```
|
13
13
|
|
@@ -16,12 +16,14 @@ If you want to override/change anything (for instance the homepage), you can jus
|
|
16
16
|
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
17
|
|
18
18
|
* Putting it on the same directory as your app and pointing on the Gemfile. [See example on GitHub](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/tree/c210b5338d7ba1338c9879627e081da1441f1946). For instance:
|
19
|
-
|
19
|
+
|
20
|
+
```ruby
|
20
21
|
gem "decidim-debates", path: "decidim-debates"
|
21
22
|
```
|
22
23
|
|
23
24
|
* Publishing on a git reposotory and pointing in on the Gemfile. For instance:
|
24
|
-
|
25
|
+
|
26
|
+
```ruby
|
25
27
|
gem "decidim-consultations", git: "https://github.com/decidim/decidim-module-consultations"
|
26
28
|
```
|
27
29
|
|