decidim 0.11.2 → 0.12.0.pre

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44335d5db1b687057f003385304e02646cd98d0ab416541f59a2b714977e36d7
4
- data.tar.gz: d8b6c3816a6763174c4409050d256ee6954dcd61122aa82d6313f1e7fcc6c771
3
+ metadata.gz: 691d709e4a2e216be645f0c1a5d9ded3d4d9849c690563090cb6e444eb5f4334
4
+ data.tar.gz: 68a932289f8fb391e439a07267663cf55c4e0ee38b95853d8084124c5e7edc45
5
5
  SHA512:
6
- metadata.gz: 79bb89bc717986ddd50af246bc18b086313c5739ac11ffd62650dff1bbc79e6d1bf7ab2b340f9434199a1c7e5a383c0178d0b22707721aaf190a9daffb5a5004
7
- data.tar.gz: 12db015e4bc5219d762bb4984a1a4fc482ef54d751cf2fea8db860f1ae667b9d4aede6a8e2c2c8e21db9b73e246a9e878cc68a5569e0a245a4d79c03288912c8
6
+ metadata.gz: 2b61b7cb86bf1d8ab99f158299b4be6bf3a9b47e372f8e0dd58d8ad38127295d46dde3689417f3808c54bbdb1fb8abcf2f6984b6965b088f8ead6c1088c18d44
7
+ data.tar.gz: 21a6c3fa4a1a6418c1e4a2cfd81800c5374b5bc9f40e9944b4eed7b5c297099f8d1cd4ba327135e2f4fa3afa63c4a074c8e45a80bdd2d524dffac31de7bd856c
data/README.md CHANGED
@@ -98,13 +98,7 @@ Also, if you want to verify yourself against the default authorization handler u
98
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
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
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. |
102
-
103
- ### Official (on development)
104
-
105
- | Module | Description |
106
- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
107
- | [Blogs](https://github.com/decidim/decidim-module-blogs) | This component makes possible to add posts ordered by publication time to spaces. |
101
+ | [Blogs](https://github.com/decidim/decidim/tree/master/decidim-blogs) | This component makes possible to add posts ordered by publication time to spaces. |
108
102
 
109
103
  ### Community
110
104
 
data/Rakefile CHANGED
@@ -68,3 +68,12 @@ desc "Build webpack bundle files"
68
68
  task :webpack do
69
69
  sh "npm install && npm run build:prod"
70
70
  end
71
+
72
+ desc "Bundle all Gemfiles"
73
+ task :bundle do
74
+ [".", "decidim-generators", "decidim_app-design"].each do |dir|
75
+ Bundler.with_original_env do
76
+ Dir.chdir(dir) { sh "BUNDLE_GEMFILE=Gemfile bundle install" }
77
+ end
78
+ end
79
+ end
@@ -14,7 +14,7 @@ component.actions = %w(adhere vote create)
14
14
  ```
15
15
 
16
16
  1. Translate the action for the corresponding key: `en.decidim.components.proposals.actions.adhere = Adhere`
17
- 1. Edit `app/models/decidim/proposals/abilities/current_user_ability.rb` and add the corresponding cancancan ability like `can :adhere, Proposal do |_proposal| ...`.
17
+ 1. Edit `app/permissions/decidim/proposals/permissions.rb` and add the corresponding permission.
18
18
  1. Restart the server to pick up the changes.
19
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.
20
20
 
File without changes
@@ -13,17 +13,27 @@ Think of cells, or view models, as small Rails controllers, but without any HTTP
13
13
  ## Decidim Cards
14
14
 
15
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.
16
+ If a card for the given resource is not registered, a _basic_ (default) card is shown.
17
17
 
18
18
  To render a specified size/variation include the `size` option as a `symbol`: `card_for @instance, size: :m`
19
19
 
20
+ ### Card M
21
+
22
+ To render a label to identify the type of component renderized add to the `context` the `label` option.
23
+
24
+ The `label` option accepts this arguments:
25
+
26
+ - `false` or `"false"` will not render the label from the locales `t(model.class.model_name.i18n_key, scope: "activerecord.models", count: 1)`
27
+ - `true` or `"true"` will render the translation from
28
+ - `"whathever string"` will render it as String
29
+
20
30
  ## Introducing a Card Cell to a `component`
21
31
 
22
32
  - add **dependency** to "decidim-*.gemspec"
23
33
 
24
34
  ```rb
25
35
  s.add_dependency "cells-erb", "~> 0.1.0"
26
- s.add_dependency "cells-rails", "~> 0.0.8"
36
+ s.add_dependency "cells-rails", "~> 0.0.9"
27
37
  ```
28
38
 
29
39
  - **autoload** view_model to module `decidim-<module>/lib/decidim/<module>.rb`
@@ -44,45 +54,38 @@ To render a specified size/variation include the `size` option as a `symbol`: `c
44
54
  end
45
55
  ```
46
56
 
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`:
57
+ - The attribute `card` of the resource is defined in `decidim-core/lib/decidim/resource_manifest.rb`:
59
58
 
60
59
  ```rb
61
60
  # The cell to use to render the card of a resource.
62
61
  attribute :card, String
63
62
  ```
64
63
 
65
- In your `decidim-<component>/lib/decidim/<component>/component.rb` register the cell value:
64
+ In your `decidim-<component>/lib/decidim/<component>/component.rb` register the resource and set the card value:
66
65
 
67
66
  ```rb
68
- component.card = "decidim/<component>s/<component>"
67
+ component.register_resource(:<my_resource>) do |resource|
68
+ resource.class = "Decidim::<Component>/<MyResource>" # eg. "Decidim::Proposals::ProposalDraft
69
+ resource.card = "decidim/<component>/<my_resource>" # eg. "decidim/proposals/proposal_draft"
70
+ resource.component_manifest = component
71
+ end
69
72
  ```
70
73
 
71
- - The **Cell Class**, following the convention will reside in `decidim-<component>s/app/cells/decidim/<component>s/<component>_cell.rb`:
74
+ - The **Cell Class**, following the convention, will reside in `decidim-<component>/app/cells/decidim/<component>/<my_resource>_cell.rb`:
72
75
 
73
76
  ```rb
74
77
  module Decidim
75
78
  module <Component>s
76
- class <Component>Cell < Decidim::<Component>s::ViewModel
79
+ class <MyResource>Cell < Decidim::ViewModel
77
80
  def show
78
- render # renders decidim-<component>s/app/cells/decidim/<component>s/<component>
81
+ render # renders decidim-<component>/app/cells/decidim/<component>/<my_resource>
79
82
  end
80
83
  end
81
84
  end
82
85
  end
83
86
  ```
84
87
 
85
- - The **Cell Views** will be in the `decidim-<component>s/app/cells/decidim/<component>s/<component>` and defaults to `show.erb`
88
+ - The **Cell Views** will be in the `decidim-<component>/app/cells/decidim/<component>/<my_resource>` and defaults to `show.erb`
86
89
 
87
90
  ## More Info
88
91
 
data/docs/checklist.md CHANGED
@@ -34,7 +34,7 @@ As a technopolitical project, Decidim needs several things to work. This is a no
34
34
 
35
35
  1. Ideally you'll have a **Team** formed with experts on IT, Communication, Participation, Design and Law.
36
36
 
37
- 1. Texts for at least, **terms of use, privacy policy and frequently asked questions**.
37
+ 1. Texts for at least, **terms of use, privacy policy and frequently asked questions**. To show the "Terms and conditions" body text in the "Sign Up Form", it is a requirement that the slug of this page to be equal `terms-and-conditions`.
38
38
 
39
39
  1. Comply with your current **legal requirements**, like to registrate your privacy policy with the autorities (eg LOPD on Spain).
40
40
 
@@ -1,29 +1,5 @@
1
1
  # Authorizations
2
2
 
3
- One particular thing about this kind of applications is the need to Authorize a given user. This is specially important when you want to have legally bindings decisions taken on the platform. There are several ways that this could be done:
3
+ See [decidim-verifications's README][README].
4
4
 
5
- * By sending a SMS code to users to verify that their have a valid cellphone
6
-
7
- * By allowing users to upload a photo or scanned image of their identity document
8
-
9
- * By sending users a code through postal code
10
-
11
- * By allowing users to go to to a physical office and check their documentation
12
-
13
- * By checking some information through other systems (as a Municipal Census on the case of Municipalities, Cities or Towns)
14
-
15
- * By having a list of valid users emails
16
-
17
- Right now Decidim supports only a few of these cases, but we have an internal API where you can program your own kind of authorizations. To create your own `AuthorizationHandler` for an external API (ie a Municipal Census) you should add a `app/services/` file, then activate it on `config/initializers/decidim.rb` and finally enabling it on `/system` for the tenant.
18
-
19
- You can go see some example code on:
20
-
21
- * [Erabaki Pamplona](https://github.com/ErabakiPamplona/erabaki/blob/master/app/services/census_authorization_handler.rb)
22
-
23
- * [Decidim Barcelona](https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/master/app/services/census_authorization_handler.rb)
24
-
25
- * [Decidim Terrassa](https://github.com/AjuntamentDeTerrassa/decidim-terrassa/blob/master/app/services/census_authorization_handler.rb)
26
-
27
- * [Decidim Sant Cugat](https://github.com/AjuntamentdeSantCugat/decidim-sant_cugat/blob/master/app/services/census_authorization_handler.rb)
28
-
29
- These are just a few examples but mostly all the Municipal installations have somekind of Authorization.
5
+ [README]: https://github.com/decidim/decidim/blob/master/decidim-verifications/README.md
@@ -2,7 +2,7 @@
2
2
 
3
3
  You can change most of the texts through the Administration panel.
4
4
 
5
- If you want to change a given text that isn’t on the Administration panel, and belongs on Decidim code, you should first find out which key is being used. For instance, we want to change the home page text where it says "Let's build a more open, transparent and collaborative society.", we would search the text (using [github](https://github.com/decidim/decidim/search?utf8=%E2%9C%93&q=%22Let%27s+build+a+more+open%2C+transparent+and+collaborative+society.%22&type= ) or grep) and then I’d extract that key and their parents. On this case it’d be:
5
+ If you want to change a given text that isn’t on the Administration panel, and belongs on Decidim code, you should first find out which key is being used. For instance, you want to change the home page text where it says "Let's build a more open, transparent and collaborative society.", you would search the text (using [github](https://github.com/decidim/decidim/search?utf8=%E2%9C%93&q=%22Let%27s+build+a+more+open%2C+transparent+and+collaborative+society.%22&type= ) or grep) and then you would extract that key and their parents. On this case it’d be:
6
6
 
7
7
  ```yml
8
8
  en:
@@ -12,4 +12,4 @@ en:
12
12
  footer_sub_hero_body: Let's build a more open, transparent and collaborative society.<br /> Join, participate and decide.
13
13
  ```
14
14
 
15
- We need to create a file for this translation as Rails documentation says, for instance config/locales/home.en.yml
15
+ You need to create a file for this translation as [Ruby on Rails i18n documentation](http://guides.rubyonrails.org/i18n.html) says, for instance config/locales/home.en.yml
@@ -0,0 +1,110 @@
1
+ # Developing Decidim
2
+
3
+ ## Create a development_app
4
+
5
+ In order to start developing you will need what is called a `development_app`. This is nearly the same as a new Decidim app (that you can create with `decidim app_name`) but with a Gemfile pre-configured for local development and some other small config modifications.
6
+ You need it in order to have a Rails application configured to lookup Decidim modules from your filesystem. This way changes in your modules will be directly observed by this `development_app`.
7
+
8
+ You can create a `development_app` from inside the project's root folder with the command:
9
+
10
+ ```console
11
+ git clone https://github.com/decidim/decidim.git
12
+ cd decidim
13
+ bundle install
14
+ bundle exec rake development_app
15
+ cd development_app
16
+ ```
17
+
18
+ A development_app/ entry appears in the .gitignore file, so you don't have to worry about commiting the development app by mistake.
19
+
20
+ On creation, this steps are automatically invoked by the generator:
21
+
22
+ - create a `config/database.yml`
23
+ - `bundle install`
24
+ - `bin/rails decidim:upgrade`
25
+ - `bin/rails db:migrate db:seed`
26
+
27
+ If the default database.yml does not suit your needs you can always configure it at your will and run this steps manually.
28
+
29
+ Once created you are ready to:
30
+
31
+ - `bin/rails s`
32
+
33
+ ## During development
34
+
35
+ When creating new migrations in Decidim's modules, you will need to "apply" this migrations to your development_app. The way to do this is by copying the migration from your module into the db/migrate dir of your development_app. Luckily we already have a script that automates this: it copies all missing migrations in development_app/db/migrate. The command is:
36
+
37
+ ```console
38
+ bin/rails decidim:upgrade
39
+ ```
40
+
41
+ ## Useful commands
42
+
43
+ ### erb-lint
44
+
45
+ We use erblint gem to ensure homogeneous formatting of erb files.
46
+
47
+ ```console
48
+ bundle exec erblint --lint-all --autocorrect
49
+ # shortest
50
+ bundle exec erblint --lint-all -a
51
+ # even shortest
52
+ bundle exec erblint -la -a
53
+ ```
54
+
55
+ ### I18n
56
+
57
+ We use i18n-tasks gem to keep translations ordered and without missing/unused keys.
58
+
59
+ ```console
60
+ # from the root of the project
61
+ bundle exec i18n-tasks normalize --locales en
62
+ ```
63
+
64
+ ### JavaScript linter
65
+
66
+ We use JavaScript's lint library to ensure homogeneous formatting of JavaScrip code.
67
+
68
+ ```console
69
+ yarn install
70
+ yarn run lint --fix
71
+ ```
72
+
73
+ ### Stylelinter
74
+
75
+ [stylelint](https://stylelint.io/) is a CSS linter and fixer that helps to avoid errors and enforce consistent conventions in the stylesheets. Is an npm package, install it using:
76
+
77
+ ```console
78
+ npm install -g stylelint
79
+ ```
80
+
81
+ Linting a `.scss` file:
82
+
83
+ ```console
84
+ stylelint [path-to-file]
85
+ ```
86
+
87
+ With `--fix` option [stylelint](https://stylelint.io/user-guide/cli/#autofixing-errors) will fix as many errors as possible. The fixes are made to the actual source files. All unfixed errors will be reported.
88
+
89
+ ```console
90
+ stylelint [path-to-file] --fix
91
+ ```
92
+
93
+ ### Rubocop
94
+
95
+ RuboCop is a code analyzer tool we use at Decidim to enforce our code formatting guidelines.
96
+
97
+ ```console
98
+ # Run Rubocop
99
+ bundle exec rubocop
100
+ # Run Rubocop and automatically correct offenses
101
+ bundle exec rubocop -a
102
+ ```
103
+
104
+ ## Good to know
105
+
106
+ - There is an application with current designs at: https://decidim-design.herokuapp.com/
107
+
108
+ ## Testing
109
+
110
+ Refer to the [testing](docs/advanced/testing.md) guide.
@@ -56,29 +56,7 @@ running `bundle install`, you would run `d/bundle install`.
56
56
 
57
57
  ### C. Step by step
58
58
 
59
- In order to develop on decidim, you'll need:
60
-
61
- * **Git** 2.15+
62
- * **PostgreSQL** 9.4+
63
- * **Ruby** 2.5.0 (2.3+ should work just fine, but that's the version we test against)
64
- * **NodeJS** 9.x.x
65
- * **ImageMagick**
66
- * **Chrome** browser and [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/).
67
-
68
- First of all, you need to install the `decidim` gem:
69
-
70
- ```console
71
- gem install decidim
72
- ```
73
-
74
- afterwards, you can create an application with the nice `decidim` executable:
75
-
76
- ```console
77
- decidim decidim_application
78
- cd decidim_application
79
- bundle install
80
- rails server
81
- ```
59
+ See our [manual installation tutorial](/docs/manual-installation.md).
82
60
 
83
61
  ## Initializing your app for local development
84
62
 
@@ -170,7 +148,15 @@ also manually check your application before upgrading.
170
148
 
171
149
  ## Checklist
172
150
 
173
- There are several things you need to check before making your putting your application on production. See the [checklist](docs/checklist.md).
151
+ There are several things you need to check before making your putting your application on production. See the [checklist](checklist.md).
174
152
 
175
153
  [docker]: https://docs.docker.com/engine/installation/
176
154
  [docker-compose]: https://docs.docker.com/compose/install/
155
+
156
+ ## Contributing
157
+
158
+ We always welcome new contributors of all levels to the project. If you are not confident enough with Ruby or web development you can look for [issues](https://github.com/decidim/decidim/issues) labeled `good first issue` to start contibuting and learning the internals of the project by doing easy jobs.
159
+
160
+ We also have a [developer's reference](/docs/development_guide.md) that will help you getting started with your environment and our daily commands, routines, etc.
161
+
162
+ Finally, you can also find other ways of helping us on our [contribution guide](/CONTRIBUTING.md).
@@ -0,0 +1,128 @@
1
+ # Manual installation tutorial
2
+
3
+ ## Step by step
4
+
5
+ In order to develop on decidim, you'll need:
6
+
7
+ * **Git** 2.15+
8
+ * **PostgreSQL** 9.5+
9
+ * **Ruby** 2.5.0 (2.3+ should work just fine, but that's the version we test against)
10
+ * **NodeJS** 9.x.x
11
+ * **ImageMagick**
12
+ * **Chrome** browser and [chromedriver](https://sites.google.com/a/chromium.org/chromedriver/).
13
+
14
+ We're starting with an Ubuntu 16.04 LTS. This is an opinionated guide and YMMV, so if you're free to use the technology that you fell most comfortable on. If you have any doubts and you're blocked you can go and ask on [our Gitter](https://gitter.im/decidim/decidim). We recommend that you follow some Ruby on Rails tutorials (like [Getting Started with Ruby on Rails](http://guides.rubyonrails.org/getting_started.html)) and have some knowledge on how gems and engines work.
15
+
16
+ On this tutorial we'll see how to install rbenv, PostgreSQL and Decidim, and how to configure everything together.
17
+
18
+ ### Installing rbenv
19
+
20
+ First we're going to install rbenv, for managing various ruby versions. We're following the guide from [DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-16-04). You could also use [rvm](https://rvm.io/) as an alternative on this step. On these instruction we're using the latest ruby published version at the moment (2.5.1), but you should check this out on [Ruby official website](https://www.ruby-lang.org/en/downloads/).
21
+
22
+ ```bash
23
+ sudo apt-get update
24
+ sudo apt-get install -y build-essential autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
25
+ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
26
+ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
27
+ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
28
+ source ~/.bashrc
29
+ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
30
+ rbenv install 2.5.1
31
+ rbenv global 2.5.1
32
+ echo "gem: --no-document" > ~/.gemrc
33
+ gem install bundler
34
+ ```
35
+
36
+ ### Installing PostgreSQL
37
+
38
+ Now we're going to install PostgreSQL for the database:
39
+
40
+ ```bash
41
+ sudo apt-get install -y postgresql libpq-dev
42
+ sudo -u postgres psql -c "CREATE USER decidim_app WITH SUPERUSER CREATEDB NOCREATEROLE PASSWORD 'thepassword'"
43
+ ```
44
+
45
+ You need to change the password (on this example is "thepassword") and save it somewhere to configure it later with the application.
46
+
47
+ ### Installing Decidim
48
+
49
+ Next, we need to install the `decidim` gem:
50
+
51
+ ```bash
52
+ gem install decidim
53
+ ```
54
+
55
+ Afterwards, we can create an application with the nice `decidim` executable, where `decidim_application` is your application name (ie decidim.barcelona):
56
+
57
+ ```bash
58
+ decidim decidim_application
59
+ cd decidim_application
60
+ ```
61
+
62
+ We recommend that you save it all on Git.
63
+
64
+ ```bash
65
+ git init .
66
+ git commit -m "Initial commit. Generated with Decidim 0.X https://decidim.org"
67
+ ```
68
+
69
+ ### Configure the database
70
+
71
+ You need to modify your secrets (see `config/database.yml`). For this you can use [figaro](https://github.com/laserlemon/figaro), [dotenv](https://github.com/bkeepers/dotenv) or [rbenv-vars](https://github.com/rbenv/rbenv-vars). You should always be careful of not uploading your plain secrets on git or your version control system. You can also upload the encrypted secrets, using the sekrets gem or if you're on Ruby on Rails greater than 5.1 you can do it natively.
72
+
73
+ For instance, for working with figaro, add this to your `Gemfile`:
74
+
75
+ ```ruby
76
+ gem "figaro"
77
+ ```
78
+
79
+ Then install it:
80
+
81
+ ```bash
82
+ bundle install
83
+ bundle exec figaro install
84
+ ```
85
+
86
+ Next add this to your `config/application.yml`, using the setup the PostgreSQL database name, user and password that you configure before.
87
+
88
+ ```yaml
89
+ DATABASE_HOST: localhost
90
+ DATABASE_USERNAME: decidim_app
91
+ DATABASE_PASSWORD: your_password
92
+ ```
93
+
94
+ Finally, save it all to git:
95
+
96
+ ```bash
97
+ git add .
98
+ git commit -m "Adds figaro configuration management"
99
+ ```
100
+
101
+ ### Initializing your app for local development
102
+
103
+ We should now setup your database:
104
+
105
+ ```bash
106
+ bin/rails db:create db:migrate db:seed
107
+ ```
108
+
109
+ This will also create some default data so you can start testing the app:
110
+
111
+ * A `Decidim::System::Admin` with email `system@example.org` and password `decidim123456`, to log in at `/system`.
112
+ * A `Decidim::Organization` named `Decidim Staging`. You probably want to change its name and hostname to match your needs.
113
+ * A `Decidim::User` acting as an admin for the organization, with email `admin@example.org` and password `decidim123456`.
114
+ * A `Decidim::User` that also belongs to the organization but it's a regular user, with email `user@example.org` and password `decidim123456`.
115
+
116
+ This data won't be created in production environments, if you still want to do it, run:
117
+
118
+ ```bash
119
+ SEED=true rails db:setup
120
+ ```
121
+
122
+ You can now start your server!
123
+
124
+ ```bash
125
+ bin/rails s
126
+ ```
127
+
128
+ Visit [http://localhost:3000](http://localhost:3000) to see your app running. 🎉 🎉
@@ -10,7 +10,7 @@ If you want to enable sign up through social providers like Facebook you will ne
10
10
  1. Fill in your application name and click "Create New Facebook App ID" button.
11
11
  1. Fill in the contact email info and category.
12
12
  1. Validate the captcha.
13
- 1. Ignore the source code and fill in the URL field.
13
+ 1. Ignore the source code and fill in the URL field with `https://YOUR_DECIDIM_HOST/users/auth/facebook/callback`
14
14
  1. Navigate to the application dashboard and copy the APP_ID and APP_SECRET
15
15
  1. Paste credentials in `config/secrets.yml`. Ensure the `enabled` attribute is `true`.
16
16
 
@@ -41,9 +41,14 @@ module Decidim
41
41
  end
42
42
 
43
43
  def run(command, out: STDOUT)
44
- Dir.chdir(@dir) do
45
- command = command.gsub("%version", version).gsub("%name", name)
46
- self.class.run(command, out: out)
44
+ interpolated_in_folder(command) do |cmd|
45
+ self.class.run(cmd, out: out)
46
+ end
47
+ end
48
+
49
+ def capture(command)
50
+ interpolated_in_folder(command) do |cmd|
51
+ self.class.capture(cmd)
47
52
  end
48
53
  end
49
54
 
@@ -62,18 +67,12 @@ module Decidim
62
67
  end
63
68
 
64
69
  class << self
65
- def run(cmd, out: STDOUT)
66
- output, status = Open3.capture2e(cmd)
67
-
68
- STDOUT.puts output if out == STDOUT || !continue?(status)
69
-
70
- abort unless continue?(status)
71
-
72
- [output, status]
70
+ def capture(cmd, env: {})
71
+ Open3.capture2e(env, cmd)
73
72
  end
74
73
 
75
- def continue?(status)
76
- status.success? || ENV["FAIL_FAST"] == "false"
74
+ def run(cmd, out: STDOUT)
75
+ system(cmd, out: out)
77
76
  end
78
77
 
79
78
  def test_participatory_space
@@ -88,7 +87,7 @@ module Decidim
88
87
  replace_file(
89
88
  "package.json",
90
89
  /^ "version": "[^"]*"/,
91
- " \"version\": \"#{version.gsub(/\.pre/, "-pre")}\""
90
+ " \"version\": \"#{semver_friendly_version}\""
92
91
  )
93
92
 
94
93
  all_dirs do |dir|
@@ -98,16 +97,14 @@ module Decidim
98
97
 
99
98
  def run_all(command, out: STDOUT, include_root: true)
100
99
  all_dirs(include_root: include_root) do |dir|
101
- new(dir).run(command, out: out)
100
+ status = new(dir).run(command, out: out)
101
+
102
+ break unless status || ENV["FAIL_FAST"] == "false"
102
103
  end
103
104
  end
104
105
 
105
106
  def version
106
- File.read(version_file).strip
107
- end
108
-
109
- def version_file
110
- File.expand_path(File.join("..", "..", ".decidim-version"), __dir__)
107
+ @version ||= File.read(version_file).strip
111
108
  end
112
109
 
113
110
  def replace_file(name, regexp, replacement)
@@ -125,10 +122,26 @@ module Decidim
125
122
  .select { |f| File.directory?(f) }
126
123
  .each { |dir| yield(dir) }
127
124
  end
125
+
126
+ private
127
+
128
+ def semver_friendly_version
129
+ version.gsub(/\.pre/, "-pre").gsub(/\.dev/, "-dev")
130
+ end
131
+
132
+ def version_file
133
+ File.expand_path(File.join("..", "..", ".decidim-version"), __dir__)
134
+ end
128
135
  end
129
136
 
130
137
  private
131
138
 
139
+ def interpolated_in_folder(command)
140
+ Dir.chdir(@dir) do
141
+ yield command.gsub("%version", version).gsub("%name", name)
142
+ end
143
+ end
144
+
132
145
  def folder_name
133
146
  File.basename(@dir)
134
147
  end
@@ -3,6 +3,6 @@
3
3
  # This holds the decidim version and the faker version it uses.
4
4
  module Decidim
5
5
  def self.version
6
- "0.11.2"
6
+ "0.12.0.pre"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.12.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-06-13 00:00:00.000000000 Z
13
+ date: 2018-06-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-accountability
@@ -18,252 +18,252 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.11.2
21
+ version: 0.12.0.pre
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.11.2
28
+ version: 0.12.0.pre
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: decidim-admin
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.11.2
35
+ version: 0.12.0.pre
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.11.2
42
+ version: 0.12.0.pre
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: decidim-api
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.11.2
49
+ version: 0.12.0.pre
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.11.2
56
+ version: 0.12.0.pre
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: decidim-assemblies
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - '='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.11.2
63
+ version: 0.12.0.pre
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - '='
69
69
  - !ruby/object:Gem::Version
70
- version: 0.11.2
70
+ version: 0.12.0.pre
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: decidim-blogs
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - '='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.11.2
77
+ version: 0.12.0.pre
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - '='
83
83
  - !ruby/object:Gem::Version
84
- version: 0.11.2
84
+ version: 0.12.0.pre
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: decidim-budgets
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - '='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.11.2
91
+ version: 0.12.0.pre
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.11.2
98
+ version: 0.12.0.pre
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: decidim-comments
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
103
  - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.11.2
105
+ version: 0.12.0.pre
106
106
  type: :runtime
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.11.2
112
+ version: 0.12.0.pre
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: decidim-core
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - '='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.11.2
119
+ version: 0.12.0.pre
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - '='
125
125
  - !ruby/object:Gem::Version
126
- version: 0.11.2
126
+ version: 0.12.0.pre
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: decidim-debates
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - '='
132
132
  - !ruby/object:Gem::Version
133
- version: 0.11.2
133
+ version: 0.12.0.pre
134
134
  type: :runtime
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - '='
139
139
  - !ruby/object:Gem::Version
140
- version: 0.11.2
140
+ version: 0.12.0.pre
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: decidim-generators
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - '='
146
146
  - !ruby/object:Gem::Version
147
- version: 0.11.2
147
+ version: 0.12.0.pre
148
148
  type: :runtime
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - '='
153
153
  - !ruby/object:Gem::Version
154
- version: 0.11.2
154
+ version: 0.12.0.pre
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: decidim-meetings
157
157
  requirement: !ruby/object:Gem::Requirement
158
158
  requirements:
159
159
  - - '='
160
160
  - !ruby/object:Gem::Version
161
- version: 0.11.2
161
+ version: 0.12.0.pre
162
162
  type: :runtime
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - '='
167
167
  - !ruby/object:Gem::Version
168
- version: 0.11.2
168
+ version: 0.12.0.pre
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: decidim-pages
171
171
  requirement: !ruby/object:Gem::Requirement
172
172
  requirements:
173
173
  - - '='
174
174
  - !ruby/object:Gem::Version
175
- version: 0.11.2
175
+ version: 0.12.0.pre
176
176
  type: :runtime
177
177
  prerelease: false
178
178
  version_requirements: !ruby/object:Gem::Requirement
179
179
  requirements:
180
180
  - - '='
181
181
  - !ruby/object:Gem::Version
182
- version: 0.11.2
182
+ version: 0.12.0.pre
183
183
  - !ruby/object:Gem::Dependency
184
184
  name: decidim-participatory_processes
185
185
  requirement: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - '='
188
188
  - !ruby/object:Gem::Version
189
- version: 0.11.2
189
+ version: 0.12.0.pre
190
190
  type: :runtime
191
191
  prerelease: false
192
192
  version_requirements: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - - '='
195
195
  - !ruby/object:Gem::Version
196
- version: 0.11.2
196
+ version: 0.12.0.pre
197
197
  - !ruby/object:Gem::Dependency
198
198
  name: decidim-proposals
199
199
  requirement: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - '='
202
202
  - !ruby/object:Gem::Version
203
- version: 0.11.2
203
+ version: 0.12.0.pre
204
204
  type: :runtime
205
205
  prerelease: false
206
206
  version_requirements: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - '='
209
209
  - !ruby/object:Gem::Version
210
- version: 0.11.2
210
+ version: 0.12.0.pre
211
211
  - !ruby/object:Gem::Dependency
212
212
  name: decidim-sortitions
213
213
  requirement: !ruby/object:Gem::Requirement
214
214
  requirements:
215
215
  - - '='
216
216
  - !ruby/object:Gem::Version
217
- version: 0.11.2
217
+ version: 0.12.0.pre
218
218
  type: :runtime
219
219
  prerelease: false
220
220
  version_requirements: !ruby/object:Gem::Requirement
221
221
  requirements:
222
222
  - - '='
223
223
  - !ruby/object:Gem::Version
224
- version: 0.11.2
224
+ version: 0.12.0.pre
225
225
  - !ruby/object:Gem::Dependency
226
226
  name: decidim-surveys
227
227
  requirement: !ruby/object:Gem::Requirement
228
228
  requirements:
229
229
  - - '='
230
230
  - !ruby/object:Gem::Version
231
- version: 0.11.2
231
+ version: 0.12.0.pre
232
232
  type: :runtime
233
233
  prerelease: false
234
234
  version_requirements: !ruby/object:Gem::Requirement
235
235
  requirements:
236
236
  - - '='
237
237
  - !ruby/object:Gem::Version
238
- version: 0.11.2
238
+ version: 0.12.0.pre
239
239
  - !ruby/object:Gem::Dependency
240
240
  name: decidim-system
241
241
  requirement: !ruby/object:Gem::Requirement
242
242
  requirements:
243
243
  - - '='
244
244
  - !ruby/object:Gem::Version
245
- version: 0.11.2
245
+ version: 0.12.0.pre
246
246
  type: :runtime
247
247
  prerelease: false
248
248
  version_requirements: !ruby/object:Gem::Requirement
249
249
  requirements:
250
250
  - - '='
251
251
  - !ruby/object:Gem::Version
252
- version: 0.11.2
252
+ version: 0.12.0.pre
253
253
  - !ruby/object:Gem::Dependency
254
254
  name: decidim-verifications
255
255
  requirement: !ruby/object:Gem::Requirement
256
256
  requirements:
257
257
  - - '='
258
258
  - !ruby/object:Gem::Version
259
- version: 0.11.2
259
+ version: 0.12.0.pre
260
260
  type: :runtime
261
261
  prerelease: false
262
262
  version_requirements: !ruby/object:Gem::Requirement
263
263
  requirements:
264
264
  - - '='
265
265
  - !ruby/object:Gem::Version
266
- version: 0.11.2
266
+ version: 0.12.0.pre
267
267
  - !ruby/object:Gem::Dependency
268
268
  name: bundler
269
269
  requirement: !ruby/object:Gem::Requirement
@@ -318,11 +318,12 @@ files:
318
318
  - LICENSE-AGPLv3.txt
319
319
  - README.md
320
320
  - Rakefile
321
- - docs/add_authenticable_action.md
322
- - docs/adding_fixtures_aka_dummy_content.md
323
321
  - docs/advanced/activity_log.md
322
+ - docs/advanced/add_authenticable_action.md
323
+ - docs/advanced/adding_fixtures_aka_dummy_content.md
324
324
  - docs/advanced/components.md
325
325
  - docs/advanced/content_processors.md
326
+ - docs/advanced/data-picker.md
326
327
  - docs/advanced/deploy.md
327
328
  - docs/advanced/followers.md
328
329
  - docs/advanced/how_to_create_a_module.md
@@ -342,8 +343,9 @@ files:
342
343
  - docs/customization/styles.md
343
344
  - docs/customization/texts.md
344
345
  - docs/customization/views.md
345
- - docs/data-picker.md
346
+ - docs/development_guide.md
346
347
  - docs/getting_started.md
348
+ - docs/manual-installation.md
347
349
  - docs/services/activejob.md
348
350
  - docs/services/analytics.md
349
351
  - docs/services/geocoding.md
@@ -366,9 +368,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
366
368
  version: '2.3'
367
369
  required_rubygems_version: !ruby/object:Gem::Requirement
368
370
  requirements:
369
- - - ">="
371
+ - - ">"
370
372
  - !ruby/object:Gem::Version
371
- version: '0'
373
+ version: 1.3.1
372
374
  requirements: []
373
375
  rubyforge_project:
374
376
  rubygems_version: 2.7.6