https://github.com/gencat/participa
Codi portal participa.gencat.cat basat en codi Decidim
https://github.com/gencat/participa
decidim hacktoberfest rails ruby
Last synced: about 18 hours ago
JSON representation
Codi portal participa.gencat.cat basat en codi Decidim
- Host: GitHub
- URL: https://github.com/gencat/participa
- Owner: gencat
- Created: 2018-11-02T08:43:08.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2026-07-07T11:54:44.000Z (8 days ago)
- Last Synced: 2026-07-07T13:20:08.424Z (8 days ago)
- Topics: decidim, hacktoberfest, rails, ruby
- Language: HTML
- Homepage:
- Size: 13.6 MB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-catalunya - Participa Gencat - square&label=%E2%AD%90)](https://github.com/gencat/participa/stargazers) [](https://github.com/gencat/participa/commits/main) [](https://github.com/gencat/participa) [](https://github.com/gencat/participa/blob/main/LICENSE) [](https://web.gencat.cat/) [](https://decidim.org/) - Portal participa.gencat.cat basado en Decidim. (Participación Ciudadana)
README
# participa
Citizen Participation and Open Government application.
This is the open-source repository for "participa", based on [Decidim](https://github.com/decidim/decidim).
## Customizations
- `Decidim::Home`, customizes the main page of Decidim.
- `Decidim::Admin::SearchUser`, adds a search bar to Admin/users dashboard.
- `Decidim::Process::Extended`, customizes Decidim Participatory processes.
- `Decidim::Regulations`, adds Regulations, a new type of Participatory process.
- `Decidim::Admin::Extended`, customize admin menu adding custom configurations.
- `Decidim::Recaptcha`, use recaptcha instead invisible captcha.
- Static pages admin: adds attachment and gallery support to `Decidim::Admin::StaticPage` (form, command and controller helper) via decorators.
- Proposals admin index: adds an "Attachments" column with ascending/descending sort support (see `app/overrides/decidim/admin/proposals_index_attachments_th.rb`, `app/overrides/decidim/admin/proposals_tr_attachments_td.rb`, and `app/decorators/decidim/proposals/proposal_decorator.rb`).
## Decidim Core Overrides
Customizations applied on top of Decidim core via decorators (`app/decorators/`) and Deface view overrides (`app/overrides/`).
### Google Maps URL for meetings
Adds an optional **Google Maps URL** field to in-person and hybrid meetings, allowing admins to link participants directly to the meeting location on Google Maps.
**Behavior:**
- Field is visible only in the **admin** meeting form.
- Shown/hidden dynamically by the existing meeting-type JavaScript: visible when type is _In-person_ or _Hybrid_, hidden for _Online_.
- On the **public meeting show page**, the address text becomes a clickable link that opens Google Maps in a new browser tab when a URL is set.
- The address renders as plain text when no URL is set, or for online meetings.
**Implementation files:**
| File | Purpose |
|---|---|
| `db/migrate/20260427100000_add_google_maps_url_to_meetings.rb` | Adds `google_maps_url` column to `decidim_meetings_meetings` |
| `app/decorators/decidim/meetings/admin/meeting_form_decorator.rb` | Adds `google_maps_url` attribute + URL validation to the admin form |
| `app/decorators/decidim/meetings/admin/create_meeting_decorator.rb` | Persists `google_maps_url` when creating a meeting |
| `app/decorators/decidim/meetings/admin/update_meeting_decorator.rb` | Persists `google_maps_url` when updating a meeting |
| `app/overrides/decidim/meetings/admin/meetings/form_google_maps_url.rb` | Deface override — inserts the field in the admin form view |
| `app/decorators/decidim/address_cell_decorator.rb` | Decorator — overrides `AddressCell#address` to wrap the address in a Google Maps link |
| `config/locales/{en,ca,es}_meetings.yml` | Translations (new files) |
| `config/locales/oc_meetings.yml` | Occitan translations (updated) |
## Deploying the app
An opinionated guide to deploy this app to Heroku can be found at [https://github.com/codegram/decidim-deploy-heroku](https://github.com/codegram/decidim-deploy-heroku).
## Setting up the application
You will need to do some steps before having the app working properly once you've deployed it:
1. Open a Rails console in the server: `bundle exec rails console`
2. Create a System Admin user:
```ruby
user = Decidim::System::Admin.new(email: , password: , password_confirmation: )
user.save!
```
3. Visit `/system` and login with your system admin credentials
4. Create a new organization. Check the locales you want to use for that organization, and select a default locale.
5. Set the correct default host for the organization, otherwise the app will not work properly. Note that you need to include any subdomain you might be using.
6. Fill the rest of the form and submit it.
You're good to go!
### Machine translations
To enable automatic machine translations it should:
1. be defined an "ENABLE_MACHINE_TRANSLATIONS" ENV var set to "true":
```
# Figjam example
ENABLE_MACHINE_TRANSLATIONS: "true"
```
2. from "Configuration/Configuration" in the admin panel, the "Enable machine translations" checkbox must be selected and then click "Save". After that, a new "Machine translation display priority [] Original text first [x] Translated text first" option is displayed. Probably the second option is the more user friendly.
## Testing
Run `bin/rake decidim:generate_external_test_app` to generate a dummy application to test both the application and the modules.
Require missing factories in `spec/factories.rb`
Add `require "rails_helper"` to your specs and execute them from the root directory, i.e.:
```bash
bundle exec rake --backtrace -t
# or
bundle exec rspec decidim-process-extended/spec/serializers/decidim/participatory_processes/participatory_process_serializer_spec.rb`
```
## Open Data
Public information from _Participatory processes_ can be accessed at [https://analisi.transparenciacatalunya.cat/](https://analisi.transparenciacatalunya.cat/dataset/Participa-Gencat/dazj-skq4), which is powered by [Socrata](https://socrata.com/).
The data is periodically updated using the [`soda-ruby gem`](https://github.com/socrata/soda-ruby) to access the [Socrata Open Data API](https://dev.socrata.com/).
The necessary credentials are:
```
SODA_DOMAIN: "soda.demo.socrata.com"
SODA_USERNAME: "user@example.com"
SODA_PASSWORD: "password"
SODA_APP_TOKEN: "app_token"
SODA_DATASET_IDENTIFIER: "dataset_identifier"
```
There are two rake tasks available to interact with this data:
- `rake open_data:participatory_processes:export` to **export** the data to a CSV file
- `rake open_data:participatory_processes:publish_to_socrata` to **update** the remote Socrata dataset
The logic of these rake tasks has been extracted to a `Module` in `lib/open_data.rb`, and `ParticipatoryProcessSocrataSerializer`, located at `decidim-process-extended/app/serializers/decidim/participatory_processes`, is the `Class` responsible for transforming the objects into data for the Socrata dataset.