PopulateTools / decidim-module-extra_user_fields

Add dynamic custom fields to users
https://decidim.org
GNU Affero General Public License v3.0
3 stars 13 forks source link
decidim ruby rubygem rubyonrails

Decidim::ExtraUserFields

This module allows administrators to define a set of extra fields for users. The fields are configurable in the admin panel of the organization. When enabled, they are shown in the user profile and in the registration form.

Supported extra fields for users:

This module also enables an Export action in the participants admin panel, which allows to download a list of participants in CSV, JSON or Excel.

Installation

Pick the version of the gem that matches your Decidim version.

For Decidim 0.27:

gem "decidim-extra_user_fields", git: "https://github.com/PopulateTools/decidim-module-extra_user_fields.git", branch: "release/0.27-stable"

For Decidim 0.26:

gem "decidim-extra_user_fields", git: "https://github.com/PopulateTools/decidim-module-extra_user_fields.git", branch: "release/0.26-stable"

For Decidim 0.25:

gem "decidim-extra_user_fields", git: "https://github.com/PopulateTools/decidim-module-extra_user_fields.git", branch: "release/0.25-stable"

For Decidim 0.24:

gem "decidim-extra_user_fields", git: "https://github.com/PopulateTools/decidim-module-extra_user_fields.git", branch: "release/0.24-stable"

And then execute:

bundle install
# For versions >= 0.27
bundle exec rake railties:install:migrations
bundle exec rake db:migrate

Usage

Admin setup

After installing the gem and migrating the database, you can enable the extra fields in the admin panel of the organization. Go to Settings > Manage extra user fields. There you can enable the fields you want to use. By default all fields are required and don't include any format validation.

Admin panel

Most of the fields are plain text inputs, but other have a special format:

User signup and profile

Once the fields are enabled, they will be shown in the user signup form and in the user profile.

User signup

User profile

Admin users export

An extra feature of this plugin is to enable an Export action in the participants admin panel. This action allows to download a list of participants in CSV, JSON or Excel. The fields included in the export are the Decidim User attributes plus the extra fields enabled in the admin panel.

User export

Contributing

This module follows the regular git workflow:

We'll merge the PR ASAP and release a new version of the gem.

Adding a new field to the module

You can find the development guidelines for adding a new field in this module in the docs/create_new_field.md file.

Contribute to Decidim

See Decidim.

Roadmap

Some of the features we would like to add to this module:

License

This engine is distributed under the GNU AFFERO GENERAL PUBLIC LICENSE.