Working on reg

master
Nick Sergeant 2012-02-12 21:13:13 -05:00
parent 3eeecd357e
commit 36fc21af3e
8 changed files with 102 additions and 75 deletions

2
snipt/fabfile.py vendored
View File

@ -10,7 +10,9 @@ def staticfiles():
local('sed -i -e \'s/\/media\//https:\/\/snipt.s3.amazonaws.com\//g\' %s/media/css/style.css' % BASE_PATH)
local('rm %s/media/css/style.css-e' % BASE_PATH)
css = [
'%s/media/css/bootstrap.css' % BASE_PATH,
'%s/media/css/style.css' % BASE_PATH,
'%s/media/css/themes.css' % BASE_PATH,
]
local('cat %s > %s/media/cache/snipt.css' % (' '.join(css), BASE_PATH))

View File

@ -1,5 +1,3 @@
@import 'bootstrap.scss';
// Fonts
$Helvetica: 'Helvetica Neue', Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
$Consolas: Consolas, Menlo, "Courier New", monospace;
@ -67,6 +65,11 @@ body {
li {
line-height: normal;
}
a, button {
&:focus {
outline: none;
}
}
}
// Utils
@ -118,6 +121,10 @@ header.main {
margin: 16px 0 0 16px;
text-indent: -1000em;
width: 87px;
&:focus {
outline: none;
}
}
}
form.search {
@ -881,7 +888,24 @@ body.detail {
}
}
body.account {
}
form.account-form {
background: rgba(#FFF, .65);
margin: 20px;
padding: 20px;
@include border-radius(10px);
@import 'themes.scss';
div.form-actions {
margin-bottom: 0;
@include multi-border-radius(0, 0, 5px, 5px);
}
div.alert {
ul {
margin: 0;
li {
list-style-type: none;
}
}
}
}
}

View File

@ -25,6 +25,7 @@ def list_public(request, tag_slug=None):
snipts = snipts.filter(tags__name__in=[tag_slug])
return {
'public': True,
'snipts': snipts,
'tags': tags,
'tag': tag_slug,

View File

@ -6,7 +6,9 @@
<meta charset="utf-8" />
<meta name="description" content="Long-term memory for coders. Share and store code snippets." />
{% if debug %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/themes.css" />
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/a_underscore.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/b_jquery.js"></script>
@ -53,14 +55,14 @@
<nav class="public">
<ul>
<li>
<a href="/public/" {% if '/public/' in request.path or not request.user.is_authenticated %} class="active"{% endif %}>Public snipts</a>
<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="/login/">Log in</a>
<a href="/login/" {% if '/login/' in request.path %} class="active"{% endif %}>Log in</a>
</li>
<li>
<a href="/signup/">Sign up</a>
<a href="/signup/" {% if '/signup/' in request.path %} class="active"{% endif %}>Sign up</a>
</li>
{% else %}
<li>
@ -72,17 +74,19 @@
<aside class="nav"></aside>
</div>
</header>
<header class="sub">
<div class="inner group">
<ul class="bcrumb">
<li class="prompt">/</li>
{% block breadcrumb %}{% endblock %}
</ul>
<div class="shortcuts">
Type "?" for KB shortcuts
{% block sub-header %}
<header class="sub">
<div class="inner group">
<ul class="bcrumb">
<li class="prompt">/</li>
{% block breadcrumb %}{% endblock %}
</ul>
<div class="shortcuts">
Type "?" for KB shortcuts
</div>
</div>
</div>
</header>
</header>
{% endblock %}
<section class="main group">
<div class="inner">
{% block content %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "base.html" %}
{% extends "registration/registration_base.html" %}
{% block page-title %}Login - {{ block.super }}{% endblock %}
@ -6,65 +6,58 @@
{% block body-class %}{{ block.super }} account login {% if request.GET.activationcomplete %}activation-complete{% endif %}{% endblock %}
{% block content %}
<form method="post" action="{% url django.contrib.auth.views.login %}">
<div class="modal-header">
<h3>Login</h3>
</div>
<div class="modal-body {% if form.errors %}modal-body-errors{% endif %}">
{% if request.GET.activationcomplete %}
<div class="alert-message success">
Successfully confirmed email! Log in below.
<form class="account-form" method="post" action="{% url django.contrib.auth.views.login %}">
{% if request.GET.activationcomplete %}
<div class="alert alert-success">
Successfully confirmed email! Log in below.
</div>
{% endif %}
{% 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 %}
{% if form.errors %}
{% if form.non_field_errors %}
<div class="alert-message block-message error">
{{ form.non_field_errors }}
<div class="alert-actions">
<a class="btn small" href="/password/reset/">Forgot your password?</a>
</div>
</div>
{% else %}
<div class="alert-message error">
<p>Please fix the errors below.</p>
</div>
{% endif %}
{% endif %}
<fieldset>
<div class="clearfix {% if form.username.errors %}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 %}
</div>
{% endif %}
<fieldset>
<legend>Login</legend>
<div class="control-group {% if form.username.errors %}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 %}
</div>
<div class="clearfix {% if form.password.errors %}error{% endif %}">
<label for="id_password">Password</label>
<div class="input">
{{ form.password }}
{% if form.errors.password %}
<span class="help-inline">
{% for error in form.errors.password %}
{{ error }}
{% endfor %}
</span>
{% endif %}
</div>
</div>
<div class="control-group {% if form.password.errors %}error{% endif %}">
<label class="control-label" for="id_password">Password</label>
<div class="controls">
{{ form.password }}
{% if form.errors.password %}
<span class="help-inline">
{% for error in form.errors.password %}
{{ error }}
{% endfor %}
</span>
{% endif %}
</div>
</fieldset>
</div>
<div class="modal-footer">
<a class="btn secondary forgot" href="{% url auth_password_reset %}">Forgot your password?</a>
<!--<a class="btn secondary signup" href="/signup/">Need to sign up?</a>-->
<input type="hidden" name="next" value="{{ next }}" />
{% csrf_token %}
<input class="btn primary submit" type="submit" value="Log in" />
</div>
</div>
<div class="form-actions group">
<a class="btn" href="{% url auth_password_reset %}">Reset password</a>
<a class="btn" href="/signup/">Sign up</a>
<button class="btn btn-primary pull-right" type="submit">Log in</button>
</div>
</fieldset>
<input type="hidden" name="next" value="{{ next }}" />
{% csrf_token %}
</form>
{% endblock %}

View File

@ -0,0 +1,3 @@
{% extends "base.html" %}
{% block sub-header %}{% endblock %}