Giter Club home page Giter Club logo

ckanext-rating's Introduction

CKAN Rating extension

This is a simple rating extension for CKAN datasets (packages) and showcases. The extension adds a list of clickable stars to the side navigation in the dataset and showcacse templates similar to ckanext-qa. In showcase the stars are also displayed in the showcase listing, but are not clickable.

The stars can also be added to any desired view by adding the following code to the desired template:

{% snippet "rating/snippets/stars.html", package=<YOUR_PACKAGE> %}

The amount of ratings submitted can also be displayed with:

{{h.package_rating(None, {'package_id' : <YOUR_PACKAGE>.id} ).ratings_count}}

Rating is identified with client IP if the user is not authenticated. User ID is saved with the rating when authenticated.

Requirements

This extension works with CKAN version 2.5 or later.

Installation

To install ckanext-rating:

  1. Activate your CKAN virtual environment, for example:

    . /usr/lib/ckan/default/bin/activate
  2. Install the ckanext-rating Python package into your virtual environment::

    pip install -e git+https://github.com/6aika/ckanext-rating.git#egg=ckanext-rating

  3. Add rating to the ckan.plugins setting in your CKAN config file (by default the config file is located at /etc/ckan/default/production.ini).
  4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu:

    sudo service apache2 reload
  5. Initialize database tables used by Rating:

    ON CKAN >= 2.9:
    
    ckan --config=production.ini rating init
    
    ON CKAN < 2.8:
    
    paster --plugin=ckanext-rating rating init --config=production.ini
  6. If you want to use this extension for ckanext-showcase, install it into your environment by following the instructions at https://github.com/ckan/ckanext-showcase

Config Settings

Rating is enabled or disabled for unauthenticated users:

rating.enabled_for_unauthenticated_users = true or false

Optional:

# List of dataset types for which the rating will be shown (defaults to ['dataset'])
ckanext.rating.enabled_dataset_types

Development Installation

To install ckanext-rating for development, activate your CKAN virtualenv and do:

git clone https://github.com/6aika/ckanext-rating.git
cd ckanext-rating
python setup.py develop
pip install -r dev-requirements.txt

ckanext-rating's People

Contributors

zharktas avatar lambadam avatar hilariousgil avatar

Stargazers

Georvic Tur avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.