Permalink
Browse files

1.1

  • Loading branch information...
1 parent 5763a29 commit 3c78a2e0ccc49a2fb579f332a0782e325ea8e091 @paltman paltman committed Jan 21, 2013
Showing with 104 additions and 1 deletion.
  1. +6 −0 docs/changelog.rst
  2. +1 −0 docs/index.rst
  3. +96 −0 docs/views.rst
  4. +1 −1 kaleo/__init__.py
View
@@ -4,6 +4,12 @@
CHANGELOG
=========
+1.1
+===
+
+* added a set of views to handle managing invites via ajax
+
+
1.0
===
View
@@ -23,4 +23,5 @@ Contents
templates
signals
management
+ views
changelog
View
@@ -0,0 +1,96 @@
+.. _views:
+
+Views
+=====
+
+There are four different views designed to handle POSTs via AJAX with
+a single variable, ``amount``. These are designed to be able to help
+administrators manage invites from a front-end dashboard. The responses
+sent from these views conform to what ``bootstrap-ajax`` expects and
+works with.
+
+They all require the user has the permission ``kaleo.manage_invites``
+which is up to the site developer to determine how to and who to grant
+this to or evaluate in a custom auth backend. The largest use case
+should already be covered in that any user with staff or superuser
+privileges should supercede the need for this explicit permission.
+
+
+topoff_all
+----------
+
+:url: kaleo_topoff_all
+
+Tops off all users with at least ``amount`` invites.
+
+Returns::
+
+ {
+ "inner-fragments": {
+ ".invite-total": amount
+ }
+ }
+
+
+topoff_user
+-----------
+
+:url: kaleo_topoff_user user.pk
+
+Tops off ``{{ user.pk }}`` with at least ``amount`` invites.
+
+Returns::
+
+ {
+ "html": amount
+ }
+
+
+addto_all
+---------
+
+:url: kaleo_addto_all
+
+Adds ``number`` invites to all users
+
+Returns::
+
+ {
+ "inner-fragments": {
+ ".amount-added": amount
+ }
+ }
+
+
+addto_user
+----------
+
+:url: kaleo_addto_user user.pk
+
+Adds ``number`` invites to ``{{ user.pk }}``
+
+Returns::
+
+ {
+ "inner-fragments": {
+ ".html": amount
+ }
+ }
+
+
+invite_stat
+-----------
+
+:url: kaleo_invite_stat user.pk
+
+Returns a rendered ``kaleo/_invite_stat.html`` fragment to be supplied by the
+site developer to render an ``InvitationStat`` object for the ``user.pk`` provided
+to the template with the context variable ``stat``.
+
+The intended purpose for this is to used as a ``data-refresh-url`` for ``bootstrap-ajax``.
+
+Returns::
+
+ {
+ "html": <rendered kaleo/_invite_stat.html> # provided by site developer
+ }
View
@@ -1 +1 @@
-__version__ = "1.0"
+__version__ = "1.1"

0 comments on commit 3c78a2e

Please sign in to comment.