TurboGears2 pluggable application for comments to entities with facebook sharing
Project description
About tgcomments
-------------------------
tgcomments is a Pluggable Comments application for TurboGears2.
Comments can be added to any webpage by using the ``comments_for`` partial.
TGComments supports Facebook for avatar if the user logged using tgapp-fbauth
or if the User model provides a similar interface. Otherwise will fallback to
Gravatar.
Installing
-------------------------------
tgcomments can be installed both from pypi or from bitbucket::
pip install tgapp-tgcomments
should just work for most of the users
Plugging tgcomments
----------------------------
In your application *config/app_cfg.py* import **plug**::
from tgext.pluggable import plug
Then at the *end of the file* call plug with tgcomments::
plug(base_config, 'tgcomments')
To expose comments support for an entity, just call
the ``comments_for(entity)`` partial for
that entity inside your templates as explained in the
**Exposed Partials** section.
Exposed Partials
----------------------
tgcomments exposes a bunch of partials which can be used
to render pieces of the blogging system anywhere in your
application:
- ``tgcomments.partials:comments_for(entity)``
Given any SQLAlchemy or Ming entity (instance) which is available inside your application ``model`` module
it will display a list of comments for that entity with a box to add a new comment.
Provided Options
--------------------
tgcomments supports a bunch of options that can be passed to the plug call
to change its behavior:
- *notify_facebook* (default:True) automatically notify on facebook comments that
the user wrote if he has logged using Facebook
- *allow_anonymous* (default:True) allow anonymous users to comment
- *pretty_date* a function that will be used to properly format dates (example: "5 minutes ago")
- *get_user_avatar* a function that will be used to get the avatar (by default searches
for the ``avatar`` property, then fallbacks for fb information, then fallbacks gravatar)
Exposed Templates
--------------------
The templates used by registration and that can be replaced with
*tgext.pluggable.replace_template* are:
- ``tgcomments.templates.comments_partial``
Changelog
---------
- ``0.2.0`` - introduced compatibility with ming
-------------------------
tgcomments is a Pluggable Comments application for TurboGears2.
Comments can be added to any webpage by using the ``comments_for`` partial.
TGComments supports Facebook for avatar if the user logged using tgapp-fbauth
or if the User model provides a similar interface. Otherwise will fallback to
Gravatar.
Installing
-------------------------------
tgcomments can be installed both from pypi or from bitbucket::
pip install tgapp-tgcomments
should just work for most of the users
Plugging tgcomments
----------------------------
In your application *config/app_cfg.py* import **plug**::
from tgext.pluggable import plug
Then at the *end of the file* call plug with tgcomments::
plug(base_config, 'tgcomments')
To expose comments support for an entity, just call
the ``comments_for(entity)`` partial for
that entity inside your templates as explained in the
**Exposed Partials** section.
Exposed Partials
----------------------
tgcomments exposes a bunch of partials which can be used
to render pieces of the blogging system anywhere in your
application:
- ``tgcomments.partials:comments_for(entity)``
Given any SQLAlchemy or Ming entity (instance) which is available inside your application ``model`` module
it will display a list of comments for that entity with a box to add a new comment.
Provided Options
--------------------
tgcomments supports a bunch of options that can be passed to the plug call
to change its behavior:
- *notify_facebook* (default:True) automatically notify on facebook comments that
the user wrote if he has logged using Facebook
- *allow_anonymous* (default:True) allow anonymous users to comment
- *pretty_date* a function that will be used to properly format dates (example: "5 minutes ago")
- *get_user_avatar* a function that will be used to get the avatar (by default searches
for the ``avatar`` property, then fallbacks for fb information, then fallbacks gravatar)
Exposed Templates
--------------------
The templates used by registration and that can be replaced with
*tgext.pluggable.replace_template* are:
- ``tgcomments.templates.comments_partial``
Changelog
---------
- ``0.2.0`` - introduced compatibility with ming
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file tgapp-tgcomments-0.2.0.tar.gz
.
File metadata
- Download URL: tgapp-tgcomments-0.2.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1c33d1d539a52539363015dfc5a215da0e37cd76044fb32f90a2ac6064f82d3 |
|
MD5 | 7aa84216a1807b4f9f22268ee7c803e9 |
|
BLAKE2b-256 | cdde207c3237b09ec14667a02320bd9a919311517201ded74d381f0c4bd2ee59 |