diff --git a/.gitignore b/.gitignore index 6e5e982..eec873e 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ coverage.xml docs/_build/ .DS_Store +db.sqlite3 diff --git a/demo/db.sqlite3 b/demo/db.sqlite3 deleted file mode 100644 index 9f5f009..0000000 Binary files a/demo/db.sqlite3 and /dev/null differ diff --git a/demo/demo/urls.py b/demo/demo/urls.py index 15ac67f..42b4a88 100644 --- a/demo/demo/urls.py +++ b/demo/demo/urls.py @@ -4,11 +4,29 @@ from django.views.generic import TemplateView urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name="home.html"), name='home'), - url(r'^signup/$', TemplateView.as_view(template_name="signup.html"), name='signup'), - url(r'^email-verification/$', TemplateView.as_view(template_name="email_verification.html"), name='email-verification'), - url(r'^login/$', TemplateView.as_view(template_name="login.html"), name='login'), - url(r'^password-reset/$', TemplateView.as_view(template_name="password_reset.html"), name='password-reset'), + url(r'^signup/$', TemplateView.as_view(template_name="signup.html"), + name='signup'), + url(r'^email-verification/$', + TemplateView.as_view(template_name="email_verification.html"), + name='email-verification'), + url(r'^login/$', TemplateView.as_view(template_name="login.html"), + name='login'), + url(r'^password-reset/$', + TemplateView.as_view(template_name="password_reset.html"), + name='password-reset'), + url(r'^password-reset/confirm/$', + TemplateView.as_view(template_name="password_reset_confirm.html"), + name='password-reset-confirm'), + url(r'^user-details/$', + TemplateView.as_view(template_name="user_details.html"), + name='user-details'), + url(r'^password-change/$', + TemplateView.as_view(template_name="password_change.html"), + name='password-change'), + + + # this url is used to generate email content url(r'^password-reset/confirm/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', TemplateView.as_view(template_name="password_reset_confirm.html"), name='password_reset_confirm'), diff --git a/demo/templates/base.html b/demo/templates/base.html index 8d19353..8a0b0ed 100644 --- a/demo/templates/base.html +++ b/demo/templates/base.html @@ -31,16 +31,16 @@ API endpoints @@ -82,9 +82,9 @@ } $().ready(function(){ - $('form button[type=submit]').click(function(){ - var form = $('form'); - $.post(form.attr('action'), $('form').serialize()) + $('form.ajax-post button[type=submit]').click(function(){ + var form = $('form.ajax-post'); + $.post(form.attr('action'), form.serialize()) .fail(function(data){error_response(data);}) .done(function(data){susccess_response(data);}); return false; diff --git a/demo/templates/email_verification.html b/demo/templates/email_verification.html index eb49b3e..342e4a7 100644 --- a/demo/templates/email_verification.html +++ b/demo/templates/email_verification.html @@ -3,7 +3,6 @@ {% block content %}

E-mail verification


-

Paste here a key which was sent in verification email

{% include "fragments/email_verification_form.html" %}
{% endblock %} diff --git a/demo/templates/fragments/email_verification_form.html b/demo/templates/fragments/email_verification_form.html index 862ef27..aa9a5f6 100644 --- a/demo/templates/fragments/email_verification_form.html +++ b/demo/templates/fragments/email_verification_form.html @@ -1,9 +1,10 @@ -
+
+

Put here a key which was sent in verification email

diff --git a/demo/templates/fragments/login_form.html b/demo/templates/fragments/login_form.html index 23eaf29..ee02b53 100644 --- a/demo/templates/fragments/login_form.html +++ b/demo/templates/fragments/login_form.html @@ -1,5 +1,5 @@ - +
diff --git a/demo/templates/fragments/password_change_form.html b/demo/templates/fragments/password_change_form.html new file mode 100644 index 0000000..9e64ea4 --- /dev/null +++ b/demo/templates/fragments/password_change_form.html @@ -0,0 +1,25 @@ + + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+ diff --git a/demo/templates/fragments/password_reset_confirm_form.html b/demo/templates/fragments/password_reset_confirm_form.html index 61a1d78..973b05d 100644 --- a/demo/templates/fragments/password_reset_confirm_form.html +++ b/demo/templates/fragments/password_reset_confirm_form.html @@ -1,30 +1,32 @@ -
+
- +
- + +

Uid value sent in email

- +
- + +

Token value sent in email

- +
- +
- +
- +
diff --git a/demo/templates/fragments/password_reset_form.html b/demo/templates/fragments/password_reset_form.html index acae37e..6840193 100644 --- a/demo/templates/fragments/password_reset_form.html +++ b/demo/templates/fragments/password_reset_form.html @@ -1,5 +1,5 @@ - +
diff --git a/demo/templates/fragments/signup_form.html b/demo/templates/fragments/signup_form.html index 335ee64..9a7e43e 100644 --- a/demo/templates/fragments/signup_form.html +++ b/demo/templates/fragments/signup_form.html @@ -1,5 +1,5 @@ - +
diff --git a/demo/templates/fragments/user_details_form.html b/demo/templates/fragments/user_details_form.html new file mode 100644 index 0000000..405403b --- /dev/null +++ b/demo/templates/fragments/user_details_form.html @@ -0,0 +1,39 @@ + + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+ diff --git a/demo/templates/password_change.html b/demo/templates/password_change.html new file mode 100644 index 0000000..383dfc9 --- /dev/null +++ b/demo/templates/password_change.html @@ -0,0 +1,39 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+ +
+ +

Token received after login

+
+
+
+ +
+

Update User Details


+ {% include "fragments/password_change_form.html" %} +
+{% endblock %} + +{% block script %} + +{% endblock %} diff --git a/demo/templates/password_reset_confirm.html b/demo/templates/password_reset_confirm.html index 09c6000..162cc35 100644 --- a/demo/templates/password_reset_confirm.html +++ b/demo/templates/password_reset_confirm.html @@ -6,3 +6,21 @@ {% include "fragments/password_reset_confirm_form.html" %}
{% endblock %} + + + +{% block script %} + +{% endblock %} diff --git a/demo/templates/signup.html b/demo/templates/signup.html index 4c5a909..0854683 100644 --- a/demo/templates/signup.html +++ b/demo/templates/signup.html @@ -6,18 +6,3 @@ {% include "fragments/signup_form.html" %}
{% endblock %} - -{% comment %} -{% block script %} - -{% endblock %} -{% endcomment %} diff --git a/demo/templates/user_details.html b/demo/templates/user_details.html new file mode 100644 index 0000000..42d19c5 --- /dev/null +++ b/demo/templates/user_details.html @@ -0,0 +1,58 @@ +{% extends "base.html" %} + +{% block content %} + +
+

Retrieve User Details


+
+ +
+ +

Token received after login

+
+ +
+
+ +
+

Update User Details


+ {% include "fragments/user_details_form.html" %} +
+{% endblock %} + +{% block script %} + +{% endblock %}