Skip to content

Commit

Permalink
Update docs per 1.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman committed Jan 14, 2013
1 parent a256399 commit 590ad72
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
12 changes: 11 additions & 1 deletion docs/installation.rst
Expand Up @@ -29,6 +29,14 @@ Installation
Dependencies Dependencies
------------ ------------


bootstrap-ajax_
^^^^^^^^^^^^^^^

This is used to enable the markup based ajax. You can certain wire up your
own AJAX handling if you prefer to use something else. However, including
this script will just have things work out of the box.


pinax-theme-bootstrap_ pinax-theme-bootstrap_
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^


Expand All @@ -44,5 +52,7 @@ django-user-accounts_
Used for linking people to invitations when they confirm email addresses and Used for linking people to invitations when they confirm email addresses and
sending and processing of signup codes via email. sending and processing of signup codes via email.


.. _django-uni-form: https://github.com/pydanny/django-uni-form
.. _bootstrap-ajax: http://github.com/eldarion/bootstrap-ajax
.. _pinax-theme-bootstrap: http://github.com/pinax/pinax-theme-bootstrap
.. _django-user-accounts: http://github.com/pinax/django-user-accounts .. _django-user-accounts: http://github.com/pinax/django-user-accounts
6 changes: 6 additions & 0 deletions docs/templates.rst
Expand Up @@ -19,3 +19,9 @@ _invited.html


A simple unordered list of people you have invited that is linked to their A simple unordered list of people you have invited that is linked to their
profile when they join the site. profile when they join the site.


_invites_remaining.html
-----------------------

A fragment to display how many invites a particular user has.
29 changes: 6 additions & 23 deletions docs/usage.rst
Expand Up @@ -28,26 +28,9 @@ showed the user if they were logged in or note you could have::


{% load kaleo_tags %} {% load kaleo_tags %}
<span class="invitations_remaining"> {% invites_remaining user %}
({% remaining_invites user %})
</span>

You'll then need to include bootstrap-ajax::


And then a bit of jQuery (this assumes use of the jquery.form plugin):: <script src="{% static "js/bootstrap-ajax.js" %}"></script>

$(function () {
$('.invites form').ajaxForm(function(data) {
if (data.status == "OK") {
$('#invitation-form-messages').html("<p>Invitation sent to " + data.email + "</p>");
$('.empty-invites').remove();
$('.invite-list').append("<li>" + data.email + "</li>");
$('.invites form input[type=text]').val("");
$('.invitations_remaining').html("(" + data.invitations_remaining + ")");
if (data.invitations_remaining == 0) {
$('.invitation_form form').hide();
}
} else {
$('#invitation-form-messages').html(data.errors);
}
});
});

0 comments on commit 590ad72

Please sign in to comment.