DjangoCMS Help Rating
A project for simple evaluation of DjangoCMS website content.
Install
pip install djangocms-help-rating
Add into settings.py:
INSTALLED_APPS = [
...
"help_rating",
]
Add into site urls.py:
urlpatterns = [
...
path('help-rating/', include(('help_rating.urls', "help_rating"))),
]
If you define a namespace other than help_rating in the urls.py, you must redefine it in settings with the value HELP_RATING_PATH_NAMESPACE.
Default of HELP_RATING_PATH_NAMESPACE is "help_rating".
Customize appearance and functionality
You set the appearance with the HELP_RATING_RATINGS parameter in settings. For example:
from help_rating.constants import ScoreItem, ScoreType
HELP_RATING_RATINGS = [
ScoreItem(ScoreType.NOT_AT_ALL.value, "no", "img/thumb-down.svg", _("No")),
ScoreItem(ScoreType.YES.value, "yes", "img/thumb-up.svg", _("Yes")),
]
The standard question can be redefined with the HELP_RATING_MSG_QUESTION parameter in settings:
HELP_RATING_MSG_QUESTION = "Did this help you?"
The standard response can be redefined with the HELP_RATING_MSG_THANK_YOU parameter in settings:
HELP_RATING_MSG_THANK_YOU = "Thank you for the feedback!"
The Javascript function that is called when the form is successfully submitted is set by the HELP_RATING_SCRIPT_SUCCESS parameter in settings. For example:
HELP_RATING_SCRIPT_SUCCESS = "help_rating_success"
The function accepts one parameter, which is a <div class="answer"> element. For example:
window.help_rating_success = (node) => {
const frame = node.closest('.help-rating-frame')
...
}
A function with the same parameter can be defined in the HELP_RATING_SCRIPT_FAILURE parameter even in case the form submission fails.
License
BSD License
Metadata
Release files for djangocms-help-rating 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| djangocms_help_rating-1.2.0.tar.gz | 14.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| djangocms_help_rating-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.2 kB
Release files / djangocms_help_rating-1.2.0.tar.gz
| Download URL | djangocms_help_rating-1.2.0.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e692068c2464e19b0f7bfb698a1d684d9c329d3dcfc84585c62ff17de9aa9bfe
|
|
BLAKE2b-256 checksum How to use checksums |
a0733ee86c1b10dd993fb77bba32348e444d5a45eb677ab8ea498f62286874e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|
Release files / djangocms_help_rating-1.2.0-py3-none-any.whl
| Download URL | djangocms_help_rating-1.2.0-py3-none-any.whl |
|---|---|
| Size | 20.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f95d1d21aff1ae1d3a688afe09a27a7a4425f2c7db9d9824d60253b7a172830
|
|
BLAKE2b-256 checksum How to use checksums |
229e5cf09a7b4533db62e11618eac61adcdb8c2bab144864b7ef3678bc8d04b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.3
|