Installation:
. /usr/lib/ckan/default/bin/activate
pip install -e git+https://github.com/6aika/ckanext-rating.git#egg=ckanext-rating
Add rating to ckan.plugins
sudo service apache2 reload
Initialize database:
paster –plugin=ckanext-rating rating init –config=production.ini
For showcase integration:
Install ckanext-showcase: https://github.com/ckan/ckanext-showcase
Configuration:
rating.enabled_for_unauthenticated_users = true # Enable/disable for unauthenticated users
ckanext.rating.enabled_dataset_types = [‘dataset’] # List of dataset types for rating (optional, defaults to [‘dataset’])
Template snippets:
Add stars to any view:
{% snippet “rating/snippets/stars.html”, package= %}
Display rating count:
{{h.package_rating(None, {‘package_id’ : .id} ).ratings_count}}
Development:
git clone https://github.com/6aika/ckanext-rating.git
cd ckanext-rating
python setup.py develop
pip install -r dev-requirements.txt
Features:
- Clickable star ratings in dataset/showcase navigation
- Star display in showcase listings
- IP-based rating for unauthenticated users
- User ID-based rating for authenticated users
- Customizable via snippets