decidim 0.0.7 → 0.0.8.1
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/.circleci/config.yml +67 -0
- data/.eslintignore +1 -1
- data/.eslintrc.json +1 -0
- data/.travis.yml +4 -1
- data/Gemfile.lock +49 -48
- data/README.md +44 -118
- data/Rakefile +9 -13
- data/decidim-admin/README.md +2 -2
- data/decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6 +13 -0
- data/decidim-admin/app/assets/javascripts/decidim/admin/toggle_nav.js.es6 +17 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_decidim.scss +0 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_datepicker.scss +224 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_modules.scss +1 -0
- data/decidim-admin/app/controllers/decidim/admin/newsletters_controller.rb +1 -1
- data/decidim-admin/app/forms/decidim/admin/participatory_process_user_role_form.rb +9 -0
- data/decidim-admin/app/helpers/decidim/admin/application_helper.rb +6 -0
- data/decidim-admin/app/views/decidim/admin/categories/index.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/index.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/_form.html.erb +2 -3
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +1 -1
- data/decidim-admin/app/views/decidim/admin/static_pages/index.html.erb +2 -2
- data/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb +2 -1
- data/decidim-admin/app/views/layouts/decidim/admin/pages.html.erb +1 -1
- data/decidim-admin/config/i18n-tasks.yml +2 -0
- data/decidim-admin/config/locales/ca.yml +22 -17
- data/decidim-admin/config/locales/en.yml +22 -17
- data/decidim-admin/config/locales/es.yml +23 -18
- data/decidim-admin/config/locales/eu.yml +0 -19
- data/decidim-admin/config/locales/fi.yml +0 -14
- data/decidim-admin/config/locales/fr.yml +141 -0
- data/decidim-admin/config/locales/nl.yml +5 -0
- data/decidim-admin/spec/features/admin_invite_spec.rb +7 -1
- data/decidim-admin/spec/features/admin_manages_organization_spec.rb +1 -1
- data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +1 -1
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +1 -1
- data/decidim-admin/spec/features/static_pages_spec.rb +0 -5
- data/decidim-admin/spec/forms/organization_form_spec.rb +6 -1
- data/decidim-admin/spec/shared/manage_process_admins_examples.rb +2 -2
- data/decidim-admin/spec/shared/manage_process_steps_examples.rb +21 -17
- data/decidim-admin/spec/shared/manage_processes_examples.rb +13 -10
- data/decidim-admin/spec/shared/participatory_admin_shared_context.rb +3 -3
- data/decidim-admin/vendor/assets/javascripts/moment.min.js +7 -0
- data/decidim-api/README.md +2 -2
- data/decidim-budgets/README.md +2 -2
- data/decidim-budgets/config/locales/ca.yml +3 -3
- data/decidim-budgets/config/locales/en.yml +3 -3
- data/decidim-budgets/config/locales/es.yml +3 -3
- data/decidim-budgets/config/locales/eu.yml +0 -3
- data/decidim-budgets/config/locales/fi.yml +0 -3
- data/decidim-budgets/config/locales/fr.yml +97 -0
- data/decidim-budgets/config/locales/nl.yml +5 -0
- data/decidim-budgets/db/migrate/20170410074214_remove_not_null_reference_budgets.rb +5 -0
- data/decidim-budgets/spec/shared/manage_projects_examples.rb +1 -1
- data/decidim-comments/README.md +2 -2
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/config/locales/fr.yml +5 -0
- data/decidim-comments/config/locales/nl.yml +5 -0
- data/decidim-dev/README.md +2 -2
- data/decidim-dev/config/locales/fr.yml +5 -0
- data/decidim-dev/config/locales/nl.yml +5 -0
- data/decidim-dev/lib/decidim/dev.rb +8 -5
- data/decidim-dev/lib/decidim/dev/common_rake.rb +1 -23
- data/decidim-dev/lib/decidim/dev/railtie.rb +13 -0
- data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +6 -5
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +13 -16
- data/decidim-dev/lib/tasks/test_app.rake +18 -0
- data/decidim-meetings/README.md +2 -2
- data/decidim-meetings/app/controllers/decidim/meetings/meeting_widgets_controller.rb +21 -0
- data/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb +2 -0
- data/decidim-meetings/app/views/decidim/meetings/meeting_widgets/.erb +16 -0
- data/decidim-meetings/app/views/decidim/meetings/meeting_widgets/show.html.erb +18 -0
- data/decidim-meetings/app/views/decidim/meetings/meetings/show.html.erb +1 -0
- data/decidim-meetings/config/locales/ca.yml +5 -5
- data/decidim-meetings/config/locales/en.yml +5 -5
- data/decidim-meetings/config/locales/es.yml +5 -5
- data/decidim-meetings/config/locales/eu.yml +0 -7
- data/decidim-meetings/config/locales/fi.yml +0 -7
- data/decidim-meetings/config/locales/fr.yml +5 -0
- data/decidim-meetings/config/locales/nl.yml +5 -0
- data/decidim-meetings/db/migrate/20170410074252_remove_not_null_reference_meetings.rb +5 -0
- data/decidim-meetings/lib/decidim/meetings/list_engine.rb +3 -1
- data/decidim-meetings/spec/shared/manage_meetings_examples.rb +87 -72
- data/decidim-pages/README.md +2 -2
- data/decidim-pages/config/locales/ca.yml +1 -1
- data/decidim-pages/config/locales/en.yml +1 -1
- data/decidim-pages/config/locales/es.yml +1 -1
- data/decidim-pages/config/locales/eu.yml +0 -1
- data/decidim-pages/config/locales/fi.yml +0 -1
- data/decidim-pages/config/locales/fr.yml +5 -0
- data/decidim-pages/config/locales/nl.yml +5 -0
- data/decidim-proposals/README.md +2 -2
- data/decidim-proposals/app/controllers/decidim/proposals/proposal_widgets_controller.rb +24 -0
- data/decidim-proposals/app/controllers/decidim/proposals/proposals_controller.rb +13 -4
- data/decidim-proposals/app/helpers/decidim/proposals/application_helper.rb +15 -0
- data/decidim-proposals/app/helpers/decidim/proposals/proposal_order_helper.rb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/index.html.erb +6 -9
- data/decidim-proposals/app/views/decidim/proposals/proposal_widgets/show.html.erb +25 -0
- data/decidim-proposals/app/views/decidim/proposals/proposals/_vote_button.html.erb +9 -3
- data/decidim-proposals/app/views/decidim/proposals/proposals/_votes_count.html.erb +8 -7
- data/decidim-proposals/app/views/decidim/proposals/proposals/show.html.erb +3 -6
- data/decidim-proposals/config/locales/ca.yml +5 -5
- data/decidim-proposals/config/locales/en.yml +6 -5
- data/decidim-proposals/config/locales/es.yml +5 -5
- data/decidim-proposals/config/locales/eu.yml +0 -6
- data/decidim-proposals/config/locales/fi.yml +0 -5
- data/decidim-proposals/config/locales/fr.yml +5 -0
- data/decidim-proposals/config/locales/nl.yml +5 -0
- data/decidim-proposals/db/migrate/20170410073742_remove_not_null_reference_proposals.rb +5 -0
- data/decidim-proposals/lib/decidim/proposals/engine.rb +1 -0
- data/decidim-proposals/lib/decidim/proposals/feature.rb +1 -0
- data/decidim-proposals/spec/features/proposals_spec.rb +1 -6
- data/decidim-proposals/spec/features/vote_proposal_spec.rb +15 -0
- data/decidim-proposals/spec/helpers/proposal_order_helper_spec.rb +13 -3
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +43 -9
- data/decidim-results/README.md +2 -2
- data/decidim-results/app/controllers/decidim/results/result_widgets_controller.rb +17 -0
- data/decidim-results/app/controllers/decidim/results/results_controller.rb +1 -0
- data/decidim-results/app/views/decidim/results/result_widgets/show.html.erb +10 -0
- data/decidim-results/app/views/decidim/results/results/show.html.erb +1 -0
- data/decidim-results/config/locales/ca.yml +3 -3
- data/decidim-results/config/locales/en.yml +3 -3
- data/decidim-results/config/locales/es.yml +3 -3
- data/decidim-results/config/locales/eu.yml +0 -3
- data/decidim-results/config/locales/fi.yml +0 -3
- data/decidim-results/config/locales/fr.yml +5 -0
- data/decidim-results/config/locales/nl.yml +5 -0
- data/decidim-results/db/migrate/20170410074358_remove_not_null_reference_results.rb +5 -0
- data/decidim-results/lib/decidim/results/list_engine.rb +3 -1
- data/decidim-results/spec/shared/manage_results_examples.rb +1 -1
- data/decidim-system/config/locales/ca.yml +3 -3
- data/decidim-system/config/locales/en.yml +3 -3
- data/decidim-system/config/locales/es.yml +3 -3
- data/decidim-system/config/locales/eu.yml +0 -3
- data/decidim-system/config/locales/fi.yml +0 -3
- data/decidim-system/config/locales/fr.yml +5 -0
- data/decidim-system/config/locales/nl.yml +5 -0
- data/docs/features_and_components.md +1 -1
- data/docs/geocoding.md +34 -0
- data/docs/getting_started.md +135 -0
- data/docs/testing.md +17 -0
- data/lib/generators/decidim/app_generator.rb +7 -0
- data/lib/generators/decidim/templates/Gemfile.erb +4 -4
- data/lib/generators/decidim/templates/README.md.erb +1 -1
- data/lib/generators/decidim/templates/authorization_handler.rb +5 -1
- data/package.json +1 -1
- data/run_ci.sh +6 -6
- metadata +61 -23
@@ -11,7 +11,9 @@ module Decidim
|
|
11
11
|
isolate_namespace Decidim::Results
|
12
12
|
|
13
13
|
routes do
|
14
|
-
resources :results, only: [:index, :show]
|
14
|
+
resources :results, only: [:index, :show] do
|
15
|
+
resource :result_widget, only: :show, path: "embed"
|
16
|
+
end
|
15
17
|
root to: "results#index"
|
16
18
|
end
|
17
19
|
end
|
@@ -5,7 +5,7 @@ ca:
|
|
5
5
|
confirm_destroy: Segur que ho vols eliminar?
|
6
6
|
destroy: Eliminar
|
7
7
|
edit: Editar
|
8
|
-
new: Nou
|
8
|
+
new: Nou
|
9
9
|
save: Desar
|
10
10
|
title: Accions
|
11
11
|
admins:
|
@@ -16,11 +16,11 @@ ca:
|
|
16
16
|
success: L'administrador s'ha eliminat correctament
|
17
17
|
edit:
|
18
18
|
title: Editar administrador
|
19
|
-
update: Actualitzar
|
19
|
+
update: Actualitzar
|
20
20
|
index:
|
21
21
|
title: Administradors
|
22
22
|
new:
|
23
|
-
create: Crear
|
23
|
+
create: Crear
|
24
24
|
title: Nou administrador
|
25
25
|
update:
|
26
26
|
error: S'ha produït un error en actualitzar aquest administrador.
|
@@ -6,7 +6,7 @@ en:
|
|
6
6
|
confirm_destroy: Are you sure you want to delete this?
|
7
7
|
destroy: Destroy
|
8
8
|
edit: Edit
|
9
|
-
new: New
|
9
|
+
new: New
|
10
10
|
save: Save
|
11
11
|
title: Actions
|
12
12
|
admins:
|
@@ -17,11 +17,11 @@ en:
|
|
17
17
|
success: Admin successfully destroyed
|
18
18
|
edit:
|
19
19
|
title: Edit admin
|
20
|
-
update: Update
|
20
|
+
update: Update
|
21
21
|
index:
|
22
22
|
title: Admins
|
23
23
|
new:
|
24
|
-
create: Create
|
24
|
+
create: Create
|
25
25
|
title: New admin
|
26
26
|
update:
|
27
27
|
error: There was an error when updating this admin.
|
@@ -5,7 +5,7 @@ es:
|
|
5
5
|
confirm_destroy: '¿Seguro que lo quieres eliminar?'
|
6
6
|
destroy: Eliminar
|
7
7
|
edit: Editar
|
8
|
-
new: Nuevo
|
8
|
+
new: Nuevo
|
9
9
|
save: Guardar
|
10
10
|
title: Acciones
|
11
11
|
admins:
|
@@ -16,11 +16,11 @@ es:
|
|
16
16
|
success: El administrador se ha eliminado correctamente.
|
17
17
|
edit:
|
18
18
|
title: Editar administrador
|
19
|
-
update: Actualizar
|
19
|
+
update: Actualizar
|
20
20
|
index:
|
21
21
|
title: Administradores
|
22
22
|
new:
|
23
|
-
create: Crear
|
23
|
+
create: Crear
|
24
24
|
title: Nuevo administrador
|
25
25
|
update:
|
26
26
|
error: Se ha producido un error al actualizar este administrador.
|
@@ -5,7 +5,6 @@ eu:
|
|
5
5
|
confirm_destroy: Ziur hau ezabatu nahi duzula?
|
6
6
|
destroy: Ezabatu
|
7
7
|
edit: Editatu
|
8
|
-
new: '%{name} berria'
|
9
8
|
save: Gorde
|
10
9
|
title: Ekintzak
|
11
10
|
admins:
|
@@ -16,11 +15,9 @@ eu:
|
|
16
15
|
success: Administratzailea zuzen sortu da
|
17
16
|
edit:
|
18
17
|
title: Editatu administratzailea
|
19
|
-
update: Eguneratu administratzailea
|
20
18
|
index:
|
21
19
|
title: Administratzaileak
|
22
20
|
new:
|
23
|
-
create: Sortu administratzailea
|
24
21
|
title: Administratzaile berria
|
25
22
|
update:
|
26
23
|
error: Errorea gertatu da administratzaile hau eguneratzean.
|
@@ -5,7 +5,6 @@ fi:
|
|
5
5
|
confirm_destroy: Haluatko varmasti poistaa tämän?
|
6
6
|
destroy: Poista
|
7
7
|
edit: Muokkaa
|
8
|
-
new: Uusi %{name}
|
9
8
|
save: Tallenna
|
10
9
|
title: Toiminnot
|
11
10
|
admins:
|
@@ -16,11 +15,9 @@ fi:
|
|
16
15
|
success: Hallinnoija poistettu onnistuneesti
|
17
16
|
edit:
|
18
17
|
title: Muokkaa hallinnoijaa
|
19
|
-
update: Päivitä hallinnoija
|
20
18
|
index:
|
21
19
|
title: Hallinnoijat
|
22
20
|
new:
|
23
|
-
create: Luo hallinnoija
|
24
21
|
title: Uusi hallinnoija
|
25
22
|
update:
|
26
23
|
error: Hallinnoijan päivityksessä tapahtui virhe.
|
@@ -4,7 +4,7 @@ Features are the core contract between external modules and the core. They're us
|
|
4
4
|
|
5
5
|
## How do I create a new feature?
|
6
6
|
|
7
|
-
Features are just gems with one or more Rails engines included in it. You can use as an example [decidim-pages](https://github.com/
|
7
|
+
Features 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
8
|
|
9
9
|
Check out the `lib/decidim/pages` folder: It includes several files, the most important of which is `feature.rb`.
|
10
10
|
|
data/docs/geocoding.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Geocoding
|
2
|
+
|
3
|
+
## Configuring geocoding
|
4
|
+
|
5
|
+
Decidim has the ability to geocode proposals and meetings using the [Here](http://here.com) service, and no other provider is officially supported.
|
6
|
+
|
7
|
+
After generating your app, you'll see that your `config/initializers/decidim.rb` file has come commented code about geocoding:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
# Geocoder configuration
|
11
|
+
# config.geocoder = {
|
12
|
+
# static_map_url: "https://image.maps.cit.api.here.com/mia/1.6/mapview",
|
13
|
+
# here_app_id: Rails.application.secrets.geocoder["here_app_id"],
|
14
|
+
# here_app_code: Rails.application.secrets.geocoder["here_app_code"]
|
15
|
+
# }
|
16
|
+
```
|
17
|
+
|
18
|
+
If you want to enable geocoding in your app:
|
19
|
+
|
20
|
+
1. Uncomment or add the previous code in your `config/initializers/decidim.rb`.
|
21
|
+
1. Make sure your `config/secrets.yml` file has the needed section (it should be added by the genertator automatically).
|
22
|
+
1. Get your app ID and code from Here.com and set them as environment variables, as required by your `config/secrets.yml` file.
|
23
|
+
|
24
|
+
## Enabling geocoding
|
25
|
+
|
26
|
+
Once geocoding is configured, you'll need to activate it. As of April 2017, only proposals and meetings have geocoding.
|
27
|
+
|
28
|
+
### Proposals
|
29
|
+
|
30
|
+
In order to enable geocoding for proposals you'll need to edit the fature configuration and set the global flag to true. This works for that specific feature, so you can have geocoding enabled for meetings in a participatory process, and disabled for another one.
|
31
|
+
|
32
|
+
### Meetings
|
33
|
+
|
34
|
+
Meetings do not have a configuration option for geocoding. Instead, if geocoding is configured it will try to geocode the address every time you create or update a meeting.. As of April 2017 there's no way to enable or disable geocoding per meetings feature.
|
@@ -0,0 +1,135 @@
|
|
1
|
+
# Getting started with Decidim
|
2
|
+
|
3
|
+
## What is and what isn't Decidim?
|
4
|
+
|
5
|
+
Decidim is a set of Ruby on Rails engines to create a participatory democracy framework on top of a Ruby on Rails app. This system allows having Decidim code separated from custom code for each installation and still enabling easy updates.
|
6
|
+
|
7
|
+
These libraries are published to Rubygems.org, so you can add Decidim to your Ruby on Rails app as external dependencies.
|
8
|
+
|
9
|
+
If you want to start your own installation of Decidim, you don't need to clone this repo. Keep reading to find out how to install Decidim.
|
10
|
+
|
11
|
+
## Creating your Decidim app
|
12
|
+
|
13
|
+
### Using Docker [experimental]
|
14
|
+
|
15
|
+
> *Please note that this is **experimental***
|
16
|
+
|
17
|
+
Make sure you [have Docker v17 at least](https://docs.docker.com/engine/installation/). `cd` to your preferred folder and run this command:
|
18
|
+
|
19
|
+
```
|
20
|
+
docker run --rm -v $(pwd):/tmp codegram/decidim bash -c "bundle exec decidim /tmp/decidim_application"
|
21
|
+
```
|
22
|
+
|
23
|
+
This will create a `decidim_application` Ruby on Rails app using Decidim in the current folder. It will install the latest released version of the gem.
|
24
|
+
|
25
|
+
### Step by step
|
26
|
+
|
27
|
+
First of all, you need to install the `decidim` gem:
|
28
|
+
|
29
|
+
```
|
30
|
+
$ gem install decidim
|
31
|
+
```
|
32
|
+
|
33
|
+
Afterwards, you can create an application with the nice `decidim` executable:
|
34
|
+
|
35
|
+
```
|
36
|
+
$ decidim decidim_application
|
37
|
+
$ cd decidim_application
|
38
|
+
```
|
39
|
+
|
40
|
+
### Initializing your app for local development
|
41
|
+
|
42
|
+
You should now setup your database:
|
43
|
+
|
44
|
+
```
|
45
|
+
$ bin/rails db:create db:migrate db:seed
|
46
|
+
```
|
47
|
+
|
48
|
+
This will also create some default data so you can start testing the app:
|
49
|
+
|
50
|
+
* A `Decidim::System::Admin` with email `system@example.org` and password `decidim123456`, to log in at `/system`.
|
51
|
+
* A `Decidim::Organization` named `Decidim Staging`. You probably want to change its name and hostname to match your needs.
|
52
|
+
* A `Decidim::User` acting as an admin for the organization, with email `admin@example.org` and password `decidim123456`.
|
53
|
+
* A `Decidim::User` that also belongs to the organization but it's a regular user, with email `user@example.org` and password `decidim123456`.
|
54
|
+
|
55
|
+
This data won't be created in production environments, if you still want to do it, run:
|
56
|
+
|
57
|
+
```
|
58
|
+
$ SEED=true rails db:setup
|
59
|
+
```
|
60
|
+
|
61
|
+
You can now start your server!
|
62
|
+
|
63
|
+
```
|
64
|
+
$ bin/rails s
|
65
|
+
```
|
66
|
+
|
67
|
+
Visit [http://localhost:3000](http://localhost:3000) to see your app running.
|
68
|
+
|
69
|
+
## Configuration & setup
|
70
|
+
|
71
|
+
Decidim comes pre-configured with some safe defaults, but can be changed through the `config/initializers/decidim.rb` file in your app. Check the comments there or read the comments in [the source file](https://github.com/decidim/decidim/blob/master/decidim-core/lib/decidim/core.rb) (the part with the `config_accessor` calls) for more up-to-date info.
|
72
|
+
|
73
|
+
We also have other guides on how to configure some extra features:
|
74
|
+
|
75
|
+
- [Social providers integration](https://github.com/decidim/decidim/blob/master/docs/social_providers.md): Enable sign up from social networks.
|
76
|
+
- [Analytics](https://github.com/decidim/decidim/blob/master/docs/analytics.md): How to enable analytics
|
77
|
+
- [Geocoding](https://github.com/decidim/decidim/blob/master/docs/geocoding.md): How to enable geocoding for proposals and meetings
|
78
|
+
|
79
|
+
## Creating an Authorization handler
|
80
|
+
|
81
|
+
Authorization handlers are used to validate users following some criteria. The most common use case is validating a user against a census, so that you can differentiate users living in your city from users living outside.
|
82
|
+
|
83
|
+
The generator will have created an `ExampleAuthorizationHandler` so you can learn how to implement your own. You'll usually want to define some fields that you will use to authenticate against a census (for example, an ID and a Postal Code). In this class you'll need to write the logic to validate the user against the census. See the documentation for [the parent class](https://github.com/decidim/decidim/blob/master/decidim-core/app/services/decidim/authorization_handler.rb) and a [live example in Decidim Barcelona](https://github.com/decidim/decidim-barcelona/blob/master/app/services/census_authorization_handler.rb).
|
84
|
+
|
85
|
+
You'll need to reference it from the Decidim initializer:
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
# config/initializers/decidim.rb
|
89
|
+
|
90
|
+
config.authorization_handlers = [<my authorization handler class>]
|
91
|
+
```
|
92
|
+
|
93
|
+
## Deploy
|
94
|
+
|
95
|
+
Once you've generated the Decidim app you might need to do some changes in order to deploy it. You can check [`codegram/decidim-deploy-heroku`](https://github.com/codegram/decidim-deploy-heroku) for an opinionated example of things to do before deploying to Heroku, for example.
|
96
|
+
|
97
|
+
Once you've successfully deployed your app to your favorite platform, you'll need to create your `System` user. First you'll need to create your `Decidim::System` user in your production Ruby on Rails console:
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
email = <your email>
|
101
|
+
password = <a secure password>
|
102
|
+
user = Decidim::System::Admin.new(email: my_email, password: my_password, password_confirmation: my_password)
|
103
|
+
user.save!
|
104
|
+
```
|
105
|
+
|
106
|
+
This will create a system user with the email and password you set. We recommend using a random password generator and saving it to a password manager, so you have a more secure login.
|
107
|
+
|
108
|
+
Then, visit the `/system` dashboard and login with the email and passwords you just entered and create your organization. You're done! :tada:
|
109
|
+
|
110
|
+
You can check the [`decidim-system` README file](https://github.com/decidim/decidim/tree/master/decidim-system/README.md) for more info on how organizations work.
|
111
|
+
|
112
|
+
### Seed data in production
|
113
|
+
|
114
|
+
If you want, you can create seed data in production. Run this command in your production console:
|
115
|
+
|
116
|
+
```
|
117
|
+
$ SEED=true rails db:seed
|
118
|
+
```
|
119
|
+
|
120
|
+
If you used Codegram's [`decidim-deploy-heroku`](https://github.com/codegram/decidim-deploy-heroku), then you're all set. Otherwise you'll need to login as system user and edit the host for the organization. Set it to you production host, without the protocol and the port (so if your host is `https://my.host:3001`, you need to write `my.host`).
|
121
|
+
|
122
|
+
## Keeping your app up-to-date
|
123
|
+
|
124
|
+
We keep releasing new versions of Decidim. In order to get the latest one, update your dependencies:
|
125
|
+
|
126
|
+
```
|
127
|
+
$ bundle update decidim
|
128
|
+
```
|
129
|
+
|
130
|
+
And make sure you get all the latest migrations:
|
131
|
+
|
132
|
+
```
|
133
|
+
$ bin/rails decidim:upgrade
|
134
|
+
$ bin/rails db:migrate
|
135
|
+
```
|
data/docs/testing.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# How to test Decidim engines
|
2
|
+
|
3
|
+
## Requirements
|
4
|
+
|
5
|
+
You need to create a dummy application to run your tests. Run the following command in the decidim root's folder:
|
6
|
+
|
7
|
+
```bash
|
8
|
+
bundle exec rake decidim:generate_test_app
|
9
|
+
```
|
10
|
+
|
11
|
+
## Running the test suite
|
12
|
+
|
13
|
+
A Decidim engine can be tested running the following command inside its folder:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
bundle exec rake
|
17
|
+
```
|
@@ -46,6 +46,9 @@ module Decidim
|
|
46
46
|
class_option :migrate, type: :boolean, default: false,
|
47
47
|
desc: "Run migrations after installing decidim"
|
48
48
|
|
49
|
+
class_option :app_const_base, type: :string,
|
50
|
+
desc: "The application constant name"
|
51
|
+
|
49
52
|
def database_yml
|
50
53
|
template "database.yml.erb", "config/database.yml", force: true
|
51
54
|
end
|
@@ -80,6 +83,10 @@ module Decidim
|
|
80
83
|
]
|
81
84
|
end
|
82
85
|
|
86
|
+
def app_const_base
|
87
|
+
options["app_const_base"] || super
|
88
|
+
end
|
89
|
+
|
83
90
|
def add_ignore_uploads
|
84
91
|
unless options["skip_git"]
|
85
92
|
append_file ".gitignore", "\n# Ignore public uploads\npublic/uploads"
|
@@ -4,9 +4,9 @@ ruby '<%= RUBY_VERSION %>'
|
|
4
4
|
<% if options[:path] %>
|
5
5
|
gem "decidim", path: "<%= options[:path] %>"
|
6
6
|
<% elsif options[:edge] %>
|
7
|
-
gem "decidim", git: 'https://github.com/
|
7
|
+
gem "decidim", git: 'https://github.com/decidim/decidim.git'
|
8
8
|
<% elsif options[:branch] %>
|
9
|
-
gem "decidim", git: 'https://github.com/
|
9
|
+
gem "decidim", git: 'https://github.com/decidim/decidim.git', branch: "<%= options[:branch] %>"
|
10
10
|
<% else %>
|
11
11
|
gem "decidim", "<%= Gem::Specification.find_by_name("decidim").version %>"
|
12
12
|
<% end %>
|
@@ -19,9 +19,9 @@ group :development, :test do
|
|
19
19
|
<% if options[:path] %>
|
20
20
|
gem "decidim-dev", path: "<%= options[:path] %>"
|
21
21
|
<% elsif options[:edge] %>
|
22
|
-
gem "decidim-dev", git: 'https://github.com/
|
22
|
+
gem "decidim-dev", git: 'https://github.com/decidim/decidim.git'
|
23
23
|
<% elsif options[:branch] %>
|
24
|
-
gem "decidim-dev", git: 'https://github.com/
|
24
|
+
gem "decidim-dev", git: 'https://github.com/decidim/decidim.git', branch: "<%= options[:branch] %>"
|
25
25
|
<% else %>
|
26
26
|
gem "decidim-dev", "<%= Gem::Specification.find_by_name("decidim").version %>"
|
27
27
|
<% end %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Citizen Participation and Open Government application.
|
4
4
|
|
5
|
-
This is the open-source repository for <%= app_name %>, based on [Decidim](https://github.com/
|
5
|
+
This is the open-source repository for <%= app_name %>, based on [Decidim](https://github.com/decidim/decidim).
|
6
6
|
|
7
7
|
## Deploying the app
|
8
8
|
|
@@ -34,7 +34,11 @@ class ExampleAuthorizationHandler < Decidim::AuthorizationHandler
|
|
34
34
|
# The only method that needs to be implemented for an authorization handler.
|
35
35
|
# Here you can add your business logic to check if the authorization should
|
36
36
|
# be created or not, you should return a Boolean value.
|
37
|
-
|
37
|
+
#
|
38
|
+
# Note that if you set some validations and overwrite this method, then the
|
39
|
+
# validations will not run, so it's easier to just remove this method and reite
|
40
|
+
# your logic using ActiveModel validations.
|
41
|
+
def valid?
|
38
42
|
raise NotImplementedError
|
39
43
|
end
|
40
44
|
|
data/package.json
CHANGED
data/run_ci.sh
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
set -ev
|
3
|
+
|
3
4
|
if [ "$GEM" == "." ]; then
|
4
|
-
yarn
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
yarn lint
|
6
|
+
bundle exec rspec spec
|
7
|
+
else
|
8
|
+
yarn test -- $GEM
|
9
|
+
cd $GEM && bundle exec rake
|
8
10
|
fi
|
9
|
-
|
10
|
-
bundle exec rake
|