Sometimes it might be convenient to use completely different views for different tenants. For example, a certain tenant might use a footer that has nothing to do with the default one. For these cases, instead of adding `case Tenant.current_schema` conditions to the view, it might be tidier to use a different file. For this purpose, we're using Rails variants [1], which means that a tenant named `mytenant` will use a template ending with `.html+mytenant.erb` if it's available. This works with components too, but has a limitation: when using the `custom/` folder to add ERB files for a tenant, the default tenant ERB file needs to be added to the `custom/` folder as well; if there aren't changes to this file, a symbolic link will do. For example, if we're writing a custom `admin/action_component` view for the tenant `milky-way` but don't need to change this file for the default tenant: 1. Create `app/components/custom/admin/action_component.rb` according to the components customizations documentation [2] 2. Create the custom view for the `milky-way` tenant and save it under `app/components/custom/admin/action_component.html+milky-way.erb` 3. Enter the `app/components/custom/admin/` folder and run `ln -s ../../admin/action_component.html.erb` We're also adding some controller tests. Since Rails doesn't load the middleware during controller tests, we're stubbing the `current_schema` method directly instead of changing the subdomain of the request. [1] https://guides.rubyonrails.org/v6.0/layouts_and_rendering.html#the-variants-option [2] https://docs.consulproject.org/docs/english-documentation/customization/components
CONSUL
Citizen Participation and Open Government Application
This is the opensource code repository of the eParticipation website CONSUL, originally developed for the Madrid City government eParticipation website
Documentation
Check the ongoing documentation at https://docs.consulproject.org to learn more about how to start your own CONSUL fork, install it, customize it and learn to use it from an administrator/maintainer perspective.
CONSUL Project main website
You can access the main website of the project at http://consulproject.org where you can find documentation about the use of the platform, videos, and links to the community space.
Configuration for development and test environments
NOTE: For more detailed instructions check the docs
Prerequisites: install git, Ruby 2.7.6, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5).
git clone https://github.com/consul/consul.git
cd consul
bundle install
cp config/database.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml
bin/rake db:create
bin/rake db:migrate
bin/rake db:dev_seed
RAILS_ENV=test rake db:setup
Run the app locally:
bin/rails s
Run the tests with:
bin/rspec
You can use the default admin user from the seeds file:
user: admin@consul.dev pass: 12345678
But for some actions like voting, you will need a verified user, the seeds file also includes one:
user: verified@consul.dev pass: 12345678
Configuration for production environments
See installer
Current state
Development started on 2015 July 15th. Code was deployed to production on 2015 september 7th to decide.madrid.es. Since then new features are added often. You can take a look at the current features at the project's website and future features at the Roadmap and open issues list.
License
Code published under AFFERO GPL v3 (see LICENSE-AGPLv3.txt)
Contributions
See CONTRIBUTING.md
