Permalink
Browse files

just getting things working before merge with 1.3 new proj

  • Loading branch information...
1 parent 570fd1a commit 80d544d9c7203700758780a95bc5386d121cc7fb @jfmatth committed Jan 26, 2012
Showing with 63 additions and 39 deletions.
  1. +4 −0 aim/views.py
  2. +1 −1 templates/about.html
  3. +2 −11 templates/bootstrap.html
  4. +51 −22 templates/registration/login.html
  5. +5 −5 urls.py
View
@@ -1,5 +1,8 @@
from django.http import HttpResponse, HttpResponseRedirect
+
+from django.contrib.auth.decorators import login_required
+
from django.views.generic.list_detail import object_list, object_detail
from django.views.generic.simple import direct_to_template
from django.contrib.auth import authenticate, login
@@ -9,6 +12,7 @@
from aim.models import *
from aim.forms import *
+@login_required
def index(request):
if request.user.is_authenticated():
qs = Portfolio.objects.filter(owner=request.user)
View
@@ -29,7 +29,7 @@
<div class="fill">
<div class="container">
- <a class="brand">RetireOnAIM</a>
+ <a class="bra</a>
<ul class="nav">
<li><a href="/">Home</a></li>
View
@@ -3,20 +3,13 @@
<head>
<meta charset="utf-8">
- <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
-
- <!-- Le styles -->
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<style type="text/css">
body {
padding-top: 60px;
}
</style>
- <!-- Le fav and touch icons -->
</head>
<body>
@@ -37,9 +30,8 @@
{% if user.is_authenticated %}
<form action="/accounts/logout/" class="pull-right">
{% csrf_token %}
- Hello {{ user.username}}
<input type="hidden" name="next" value="/" />
- <button class="btn" type="submit">Logout</button>
+ <button class="btn" type="submit">Logout {{user.username}}</button>
</form>
{% else %}
<p class="pull-right">
@@ -64,7 +56,6 @@
<h1>Make your stock portfolio shine</h1>
<p>
<p>Welcome to RetireOnAIM, the program that helps increase the value of your investments</p>
- <p><a class="btn primary large">Learn more &raquo;</a></p>
</div>
<div class="row">
@@ -82,7 +73,7 @@
</div>
<div class="span-one-third">
- <h2>How much does it costk?</h2>
+ <h2>How much does it cost?</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div>
@@ -1,28 +1,57 @@
-{% extends "base.html" %}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+
+ <link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ </style>
-{% block login-section %}
-{% endblock %}
+ </head>
-{% block content %}
+ <body>
+
+ <div class="topbar">
+ <div class="fill">
+ <div class="container">
+ <a class="brand" href="/">RetireOnAIM</a>
+ </div>
+ </div>
+ </div>
-{% if form.errors %}
-<p>Your username and password didn't match. Please try again.</p>
-{% endif %}
+ <div class="container">
+ <div class="span16">
+ <h1>Login</h1>
+ <form class="form-stacked" method="post" action="{% url django.contrib.auth.views.login %}">
+ <fieldset>
+ <div class="clearfix">
+ {{ form.username.label_tag }}
+ <div class="input">
+ {{ form.username }}
+ </div>
+ {{ form.password.label_tag }}
+ <div class="input">
+ {{ form.password }}
+ </div>
+ </div>
+ </fieldset>
-<form method="post" action="{% url django.contrib.auth.views.login %}">
-<table>
-<tr>
- <td>{{ form.username.label_tag }}</td>
- <td>{{ form.username }}</td>
-</tr>
-<tr>
- <td>{{ form.password.label_tag }}</td>
- <td>{{ form.password }}</td>
-</tr>
-</table>
+ <div class="actions">
+ <button type="submit" class="btn primary">Login</button>
+ <input type="hidden" name="next" value="{{ next }}" />
+ {% csrf_token %}
+ </div>
+
+ </form>
+ <footer>
+ <p>&copy; Company 2011</p>
+ </footer>
+ </div>
-<input type="submit" value="login" />
-<input type="hidden" name="next" value="{{ next }}" />
-</form>
+ </div>
-{% endblock %}
+ </body>
+</html>
View
10 urls.py
@@ -3,8 +3,8 @@
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
-#from django.contrib import admin
-#admin.autodiscover()
+from django.contrib import admin
+admin.autodiscover()
urlpatterns = patterns('',
@@ -14,8 +14,8 @@
(r'about/$', TemplateView.as_view(template_name="about.html")),
(r'contact/$', TemplateView.as_view(template_name="comingsoon.html")),
- # Example:
-# (r'^aim/', include('aim.urls') ),
+
+ (r'^aim/', include('aim.urls') ),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
@@ -25,5 +25,5 @@
(r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
# Uncomment the next line to enable the admin:
-# (r'^admin/(.*)', admin.site.root),
+ (r'^admin/(.*)', admin.site.root),
)

0 comments on commit 80d544d

Please sign in to comment.