A ton of registration stuff. Its done.
parent
36fc21af3e
commit
9928b09dc9
|
@ -65,11 +65,6 @@ body {
|
|||
li {
|
||||
line-height: normal;
|
||||
}
|
||||
a, button {
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Utils
|
||||
|
@ -155,7 +150,7 @@ header.main {
|
|||
height: auto;
|
||||
margin: 0;
|
||||
padding: 7px;
|
||||
padding-left: 28px;
|
||||
text-indent: 21px;
|
||||
width: 175px;
|
||||
@include border-radius(3px);
|
||||
@include inset-box-shadow(0, 1px, 0px, #1D4249);
|
||||
|
@ -233,7 +228,7 @@ header.sub {
|
|||
max-width: 490px;
|
||||
line-height: normal;
|
||||
overflow: hidden;
|
||||
padding: 5px 0 7px 0;
|
||||
padding: 2px 0 4px 0;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
|
@ -259,7 +254,7 @@ header.sub {
|
|||
color: #999999;
|
||||
float: right;
|
||||
font: bold 12px $Consolas;
|
||||
padding-top: 7px;
|
||||
padding-top: 4px;
|
||||
text-shadow: 0 1px 0 #FFF;
|
||||
}
|
||||
}
|
||||
|
@ -629,6 +624,7 @@ article.snipt {
|
|||
top: -3px;
|
||||
width: 3px;
|
||||
-webkit-transform: rotate(-45deg);
|
||||
-moz-transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
&.embed {
|
||||
|
@ -887,16 +883,17 @@ body.detail {
|
|||
}
|
||||
}
|
||||
}
|
||||
body.account {
|
||||
form.account-form {
|
||||
body.static {
|
||||
.static-box {
|
||||
background: rgba(#FFF, .65);
|
||||
border: 1px solid #DDDDDD;
|
||||
margin: 20px;
|
||||
padding: 20px;
|
||||
@include border-radius(10px);
|
||||
@include border-radius(4px);
|
||||
|
||||
div.form-actions {
|
||||
margin-bottom: 0;
|
||||
@include multi-border-radius(0, 0, 5px, 5px);
|
||||
@include vertical-gradient(#F5F5F5, #FBFBFB);
|
||||
}
|
||||
div.alert {
|
||||
ul {
|
||||
|
@ -907,5 +904,17 @@ body.account {
|
|||
}
|
||||
}
|
||||
}
|
||||
div.alert-info {
|
||||
a {
|
||||
color: #3A87AD;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
aside.main {
|
||||
padding-top: 20px;
|
||||
}
|
||||
div.alert-alone {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
(function(jQuery){jQuery.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyHandler(handleObj){if(typeof handleObj.data!=="string"){return;}
|
||||
var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text")){return;}
|
||||
var origHandler=handleObj.handler,keys=handleObj.data.toLowerCase().split(" ");handleObj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodeName)||event.target.type==="text"||event.target.type === "password")){return;}
|
||||
var special=event.type!=="keypress"&&jQuery.hotkeys.specialKeys[event.which],character=String.fromCharCode(event.which).toLowerCase(),key,modif="",possible={};if(event.altKey&&special!=="alt"){modif+="alt+";}
|
||||
if(event.ctrlKey&&special!=="ctrl"){modif+="ctrl+";}
|
||||
if(event.metaKey&&!event.ctrlKey&&special!=="meta"){modif+="meta+";}
|
||||
|
|
|
@ -53,16 +53,13 @@
|
|||
e.preventDefault();
|
||||
$search_query.focus();
|
||||
});
|
||||
$document.bind('keydown', 'Shift+/', function(e) {
|
||||
$document.bind('keydown', 'h', function(e) {
|
||||
$el.trigger('showKeyboardShortcuts');
|
||||
});
|
||||
$('input').bind('keydown', 'esc', function(e) {
|
||||
e.preventDefault();
|
||||
this.blur();
|
||||
});
|
||||
$document.bind('keydown', 'Shift+h', function(e) {
|
||||
history.go(-1);
|
||||
});
|
||||
},
|
||||
showKeyboardShortcuts: function() {
|
||||
$('#keyboard-shortcuts').modal('toggle');
|
||||
|
|
|
@ -189,9 +189,6 @@
|
|||
}
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
});
|
||||
$document.bind('keydown', 'h', function() {
|
||||
window.location = '/';
|
||||
});
|
||||
$document.bind('keydown', 'n', function() {
|
||||
var $anc = $('li.next a');
|
||||
if ($anc.length) {
|
||||
|
|
|
@ -193,6 +193,7 @@ VIRTUALENV_PATH = '/Users/Nick/.virtualenvs/snipt/lib/python2.7/site-packages/'
|
|||
LOGIN_REDIRECT_URL = '/'
|
||||
LOGIN_URL = '/login/'
|
||||
LOGOUT_URL = '/logout/'
|
||||
ACCOUNT_ACTIVATION_DAYS = 0
|
||||
|
||||
# HTTPS
|
||||
USE_HTTPS = False
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
from django.contrib.auth import authenticate, login
|
||||
from django.template.defaultfilters import slugify
|
||||
from registration.signals import user_registered
|
||||
|
||||
|
||||
def slugify_uniquely(value, model, slugfield="slug"):
|
||||
suffix = 0
|
||||
|
@ -10,3 +13,14 @@ def slugify_uniquely(value, model, slugfield="slug"):
|
|||
if not model.objects.filter(**{slugfield: potential}).count():
|
||||
return potential
|
||||
suffix += 1
|
||||
|
||||
def activate_user(user, request, **kwargs):
|
||||
user.is_active = True
|
||||
user.save()
|
||||
|
||||
user = authenticate(username=request.POST['username'],
|
||||
password=request.POST['password1'])
|
||||
login(request, user)
|
||||
|
||||
|
||||
user_registered.connect(activate_user)
|
||||
|
|
|
@ -41,9 +41,11 @@ def list_user(request, username, tag_slug=None):
|
|||
if user == request.user:
|
||||
tags = tags.filter(snipt__user=user)
|
||||
snipts = snipts.filter(user=user)
|
||||
public = False
|
||||
else:
|
||||
tags = tags.filter(snipt__user=user, snipt__public=True)
|
||||
snipts = snipts.filter(user=user, public=True)
|
||||
public = True
|
||||
|
||||
tags = tags.annotate(count=Count('taggit_taggeditem_items__id'))
|
||||
tags = tags.order_by('-count', 'name')
|
||||
|
@ -53,6 +55,7 @@ def list_user(request, username, tag_slug=None):
|
|||
snipts = snipts.filter(tags__name__in=[tag_slug])
|
||||
|
||||
return {
|
||||
'public': public,
|
||||
'snipts': snipts,
|
||||
'tags': tags,
|
||||
'tag': tag_slug,
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block page-title %}API - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} api static{% endblock %}
|
||||
{% block sub-header %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="static-box">
|
||||
This is where the API documentation will be.
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -54,10 +54,10 @@
|
|||
</form>
|
||||
<nav class="public">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
|
||||
</li>
|
||||
{% if not request.user.is_authenticated %}
|
||||
<li>
|
||||
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/login/" {% if '/login/' in request.path %} class="active"{% endif %}>Log in</a>
|
||||
</li>
|
||||
|
@ -68,6 +68,12 @@
|
|||
<li>
|
||||
<a href="/" {% if request.user.username in request.path %} class="active"{% endif %}>My snipts</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/logout/">Log out</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -82,7 +88,7 @@
|
|||
{% block breadcrumb %}{% endblock %}
|
||||
</ul>
|
||||
<div class="shortcuts">
|
||||
Type "?" for KB shortcuts
|
||||
Type "h" for KB shortcuts
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
@ -138,7 +144,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>?</td>
|
||||
<td>h</td>
|
||||
<td>Show keyboard shortcuts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -157,14 +163,6 @@
|
|||
<td>G</td>
|
||||
<td>Scroll to bottom of page</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>H</td>
|
||||
<td>Go back</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>h</td>
|
||||
<td>Go to home</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>n</td>
|
||||
<td>Next page</td>
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block page-title %}{% if account %}Activation Complete{% else %}Activation Problem{% endif %} - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if account %}
|
||||
Thanks {{ account }}, activation complete! You may now <a href='{% url auth_login %}'>login</a> using the username and password you set at registration.
|
||||
{% else %}
|
||||
Oops – it seems that your activation key is invalid. Please check the url again.
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,16 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block page-title %}Activation Complete - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} activation-complete{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
<h1>Sign up for Smooth Wallet</h1>
|
||||
<div class="inner">
|
||||
<div class="top group">
|
||||
Thanks, activation complete! You may now <a href='{% url auth_login %}'>login</a> using the username and password you set at registration.
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
|
@ -1,16 +1,11 @@
|
|||
Hi,
|
||||
Hey there,
|
||||
|
||||
You recently signed up for LivePlay using this email address. Just to make sure that this is in fact a valid email, we need you to confirm it.
|
||||
Welcome to Snipt. If you ever have any thoughts or issues with the site whatsoever, please feel free to contact me directly.
|
||||
|
||||
To do so, just click the following link:
|
||||
https://{{site.domain}}/accounts/activate/{{ activation_key }}
|
||||
Thanks!
|
||||
|
||||
That link will expire in {{ expiration_days}} days, so if you don't confirm your email within that time, your account will be marked inactive and you'll need to sign up again.
|
||||
|
||||
If you didn't sign up for LivePlay using this email address, then you can safely ignore this email. As long as you don't click that link above, the account will not be confirmed and you won't have an account opened using your email address.
|
||||
|
||||
But if you continue to receive these emails, don't hesitate to yell at us and we'll straighten it out. To do so just reply to this email and let us know what's going on.
|
||||
|
||||
Thanks again for trying out LivePlay.
|
||||
|
||||
The LivePlay Team
|
||||
Nick Sergeant
|
||||
http://twitter.com/nicksergeant
|
||||
http://twitter.com/snipt
|
||||
nick@snipt.net
|
||||
http://snipt.net
|
||||
|
|
|
@ -1 +1 @@
|
|||
Please confirm your email address...
|
||||
Welcome to Snipt!
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
|
||||
{% block page-title %}Login - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block html-class %}account{% endblock %}
|
||||
{% block body-class %}{{ block.super }} account login {% if request.GET.activationcomplete %}activation-complete{% endif %}{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form class="account-form" method="post" action="{% url django.contrib.auth.views.login %}">
|
||||
<form class="static-box" method="post" action="{% url django.contrib.auth.views.login %}">
|
||||
<div class="alert alert-info">
|
||||
<strong>Notice:</strong> OpenID is no longer supported. You can <a href="{% url auth_password_reset %}">reset your password here</a>.
|
||||
</div>
|
||||
{% if request.GET.activationcomplete %}
|
||||
<div class="alert alert-success">
|
||||
Successfully confirmed email! Log in below.
|
||||
|
@ -24,7 +26,7 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<legend>Login</legend>
|
||||
<legend>Log in</legend>
|
||||
<div class="control-group {% if form.username.errors %}error{% endif %}">
|
||||
<label class="control-label" for="id_username">Username</label>
|
||||
<div class="controls">
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Logged Out - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Logged out - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} signin{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
<div class="inner">
|
||||
<div class="top group">
|
||||
Successfully logged out. <a href="{% url auth_login %}">Log in again?</a>
|
||||
</div>
|
||||
<div class="static-box">
|
||||
<div class="alert alert-info alert-alone">
|
||||
Successfully logged out. <a href="{% url auth_login %}">Log in</a> again?
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
{% extends "app-base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Password Changed - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Password reset - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} account{% endblock %}
|
||||
|
||||
{% block banner %}
|
||||
<h1>
|
||||
<span class="subtitle">Settings</span>
|
||||
<a href="#" class="title">Account Information</a>
|
||||
</h1>
|
||||
{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-content">
|
||||
Password changed successfully.
|
||||
<div class="static-box">
|
||||
<div class="alert alert-info alert-alone">
|
||||
Password successfully changed.
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{% extends "app-base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Account Information - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Reset password - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} account{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block banner %}
|
||||
<h1>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Password Reset Complete - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Password reset - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
<div class="inner">
|
||||
<div class="top group">
|
||||
Your password has been reset! You may now <a href="{{ login_url }}">log in</a>.
|
||||
</div>
|
||||
<div class="static-box">
|
||||
<div class="alert alert-info alert-alone">
|
||||
Password successfully changed. You may now <a href="{{ login_url }}">log in</a>.
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,36 +1,61 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Confirm Password Reset - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Reset password - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} signin new-password{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
<div class="inner">
|
||||
<div class="top group">
|
||||
{% if form.errors %}
|
||||
<div class="errors">
|
||||
{{ form.new_password1.errors }}
|
||||
{{ form.new_password2.errors }}
|
||||
{% if form %}
|
||||
<form class="static-box" method="post" action="">
|
||||
{% if form.errors %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">
|
||||
Please fix the errors below.
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="legend top-legend">
|
||||
Enter your new password below to reset your password:
|
||||
</div>
|
||||
<form method="post" action="">{% csrf_token %}
|
||||
<div class="fields">
|
||||
<div class="field {% if form.new_password1.errors %}error{% endif %}">
|
||||
{{ form.new_password1.label_tag }}
|
||||
{{ form.new_password1 }}
|
||||
</div>
|
||||
<div class="field {% if form.new_password2.errors %}error{% endif %}">
|
||||
{{ form.new_password2.label_tag }}
|
||||
{{ form.new_password2 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<legend>Reset password</legend>
|
||||
<div class="control-group {% if form.new_password1.errors %}error{% endif %}">
|
||||
<label class="control-label" for="id_new_password1">New password</label>
|
||||
<div class="controls">
|
||||
{{ form.new_password1 }}
|
||||
{% if form.errors.new_password1 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.new_password1 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<input class="submit" type="submit" value="Set Password" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="control-group {% if form.new_password2.errors %}error{% endif %}">
|
||||
<label class="control-label" for="id_new_password2">Confirm new password</label>
|
||||
<div class="controls">
|
||||
{{ form.new_password2 }}
|
||||
{% if form.errors.new_password2 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.new_password2 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions group">
|
||||
<button class="btn btn-primary pull-right" type="submit">Set Password</button>
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="static-box">
|
||||
<div class="alert alert-error alert-alone">
|
||||
This password reset URL is no longer valid.
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Password Reset - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Password reset - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
<div class="inner">
|
||||
<div class="top group">
|
||||
We have sent you an email with a link to reset your password. Please check your email and click the link to continue.
|
||||
</div>
|
||||
<div class="static-box">
|
||||
<div class="alert alert-info alert-alone">
|
||||
We've sent an email with a link to reset your password. Follow the link to continue.
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
Reset your Smooth Wallet password here: {{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uid token %}
|
||||
Reset your Snipt password here: {{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uid token %}
|
||||
|
||||
(btw, your username is "{{ user }}")
|
||||
|
|
|
@ -1,54 +1,43 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Reset password - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block html-class %}account{% endblock %}
|
||||
{% block body-class %}{{ block.super }} account forgot-password{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="logo"><a href="/">Smooth Wallet</a></h1>
|
||||
<div class="modal">
|
||||
<form method="post" action="">
|
||||
<div class="modal-header">
|
||||
<h3>Reset Password</h3>
|
||||
</div>
|
||||
<div class="modal-body {% if form.errors %}modal-body-errors{% endif %}">
|
||||
<div class="legend">
|
||||
<p>Forgot your password? Enter your email below and we'll send you instructions for creating a new one.</p>
|
||||
<form class="static-box" method="post" action="">
|
||||
{% if form.errors %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% if form.errors %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert-message block-message error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert-message error">
|
||||
<p>Please fix the errors below.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">
|
||||
Please fix the errors below.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<legend>Reset password</legend>
|
||||
<div class="control-group {% if form.email.errors %}error{% endif %}">
|
||||
<label class="control-label" for="id_email">Email</label>
|
||||
<div class="controls">
|
||||
{{ form.email }}
|
||||
{% if form.errors.email %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.email %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<div class="clearfix {% if form.email.errors %}error{% endif %}">
|
||||
<label for="id_email">Email</label>
|
||||
<div class="input">
|
||||
{{ form.email }}
|
||||
{% if form.errors.email %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.email %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
{% csrf_token %}
|
||||
<a class="btn secondary login" href="/login/">Log in instead?</a>
|
||||
<!--<a class="btn secondary signup" href="/signup/">Need to sign up?</a>-->
|
||||
<input class="btn primary submit" type="submit" value="Reset password" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="form-actions group">
|
||||
<a class="btn" href="/login/">Log in</a>
|
||||
<a class="btn" href="/signup/">Sign up</a>
|
||||
<button class="btn btn-primary pull-right" type="submit">Reset password</button>
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Registration Complete - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Signup complete - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} signup signup-complete{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
All done!
|
||||
</section>
|
||||
<div class="static-box">
|
||||
<div class="alert alert-info alert-alone">
|
||||
Signup complete! You're now logged in. Go <a href="/">home</a>, perhaps?
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,90 +1,81 @@
|
|||
{% extends "base.html" %}
|
||||
{% extends "registration/registration_base.html" %}
|
||||
|
||||
{% block page-title %}Sign up - {{ block.super }}{% endblock %}
|
||||
{% block page-title %}Signup - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block html-class %}account{% endblock %}
|
||||
{% block body-class %}{{ block.super }} account signup{% endblock %}
|
||||
{% block body-class %}{{ block.super }} static{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1 class="logo"><a href="/">Smooth Wallet</a></h1>
|
||||
<div class="modal">
|
||||
<form method="post" action="">
|
||||
<div class="modal-header">
|
||||
<h3>Signup</h3>
|
||||
</div>
|
||||
<div class="modal-body {% if form.errors %}modal-body-errors{% endif %}">
|
||||
{% if form.errors %}
|
||||
<div class="alert-message error">
|
||||
<p>Please fix the errors below.</p>
|
||||
</div>
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert-message block-message error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
<form class="static-box" method="post" action="">
|
||||
{% if form.errors %}
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-error">
|
||||
{{ form.non_field_errors }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-error">
|
||||
Please fix the errors below.
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<legend>Sign up</legend>
|
||||
<div class="control-group {% if form.errors.username %}error{% endif %}">
|
||||
<label class="control-label" for="id_username">Username</label>
|
||||
<div class="controls">
|
||||
{{ form.username }}
|
||||
{% if form.errors.username %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.username %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<fieldset>
|
||||
<div class="clearfix {% if form.errors.username %}error{% endif %}">
|
||||
<label for="id_username">Username</label>
|
||||
<div class="input">
|
||||
{{ form.username }}
|
||||
{% if form.errors.username %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.username %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="help-block">You'll use this to log in.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix {% if form.errors.email %}error{% endif %}">
|
||||
<label for="id_email">Email Address</label>
|
||||
<div class="input">
|
||||
{{ form.email }}
|
||||
{% if form.errors.email %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.email %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="help-block">We hate spam as much as you.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix {% if form.errors.password1 %}error{% endif %}">
|
||||
<label for="id_password1">Password</label>
|
||||
<div class="input">
|
||||
{{ form.password1 }}
|
||||
{% if form.errors.password1 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password1 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix {% if form.errors.password2 %}error{% endif %}">
|
||||
<label for="id_password2">Confirm Password</label>
|
||||
<div class="input">
|
||||
{{ form.password2 }}
|
||||
{% if form.errors.password2 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password2 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn secondary login" href="/login/">Already have an account?</a>
|
||||
{% csrf_token %}
|
||||
<input class="btn primary submit" type="submit" value="Sign up" />
|
||||
<div class="control-group {% if form.errors.email %}error{% endif %}">
|
||||
<label class="control-label" for="id_email">Email address</label>
|
||||
<div class="controls">
|
||||
{{ form.email }}
|
||||
{% if form.errors.email %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.email %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="control-group {% if form.errors.password1 %}error{% endif %}">
|
||||
<label class="control-label"l for="id_password1">Password</label>
|
||||
<div class="controls">
|
||||
{{ form.password1 }}
|
||||
{% if form.errors.password1 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password1 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group {% if form.errors.password2 %}error{% endif %}">
|
||||
<label class="control-label" for="id_password2">Confirm password</label>
|
||||
<div class="controls">
|
||||
{{ form.password2 }}
|
||||
{% if form.errors.password2 %}
|
||||
<span class="help-inline">
|
||||
{% for error in form.errors.password2 %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions group">
|
||||
<a class="btn" href="/login/">Log in</a>
|
||||
<button class="btn btn-primary pull-right" type="submit">Sign up</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
{% csrf_token %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block page-title %}Resend Activation Email - {{ block.super }}{% endblock %}
|
||||
|
||||
{% block body-class %}{{ block.super }} signup resend-confirmation{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<section class="box">
|
||||
<h1>Sign up for Smooth Wallet</h1>
|
||||
<div class="inner">
|
||||
<div class="top group">
|
||||
{% if form.errors or form.non_field_errors or resend_msg %}
|
||||
<div class="errors">
|
||||
{{ form.email.errors }}
|
||||
{{ form.non_field_errors }}
|
||||
{% if resend_msg %}
|
||||
{{ resend_msg }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="legend top-legend">
|
||||
Please note: New user accounts that have not been activated are purged every 7 days. If this is the case, simply <a href="{% url registration_register %}">sign up again</a>.
|
||||
</div>
|
||||
<form method="post" action="/accounts/resend/">
|
||||
<div class="fields">
|
||||
<div class="field">
|
||||
{{ form.email.label_tag }}
|
||||
{{ form.email }}
|
||||
</div>
|
||||
</div>
|
||||
<input class="submit" type="submit" value="Send New Confirmation Email" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
|
@ -1,4 +1,6 @@
|
|||
from django.views.generic.simple import direct_to_template
|
||||
from registration.forms import RegistrationFormUniqueEmail
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.conf.urls.defaults import *
|
||||
from django.contrib import admin
|
||||
from django.conf import settings
|
||||
|
@ -26,12 +28,16 @@ urlpatterns = patterns('',
|
|||
url(r'^404/$', direct_to_template, {'template': '404.html'}),
|
||||
url(r'^500/$', direct_to_template, {'template': '500.html'}),
|
||||
|
||||
url(r'^api/$', direct_to_template, {'template': 'api.html'}),
|
||||
|
||||
url(r'^api/', include(public_api.urls)),
|
||||
url(r'^api/', include(private_api.urls)),
|
||||
|
||||
url(r'^register/$', lambda x: HttpResponseRedirect('/signup/')),
|
||||
url(r'^signup/$',
|
||||
'registration.views.register', {
|
||||
'backend': 'registration.backends.default.DefaultBackend'
|
||||
'backend': 'registration.backends.default.DefaultBackend',
|
||||
'form_class': RegistrationFormUniqueEmail,
|
||||
},
|
||||
name='registration_register'),
|
||||
url(r'', include('registration.backends.default.urls')),
|
||||
|
|
Loading…
Reference in New Issue