Alles kaputt, zeigt transactionhistory an
This commit is contained in:
parent
5acc7b8d29
commit
ee7a93858a
BIN
k4ever/k4ever.db
BIN
k4ever/k4ever.db
Binary file not shown.
|
@ -4,3 +4,6 @@ from django.contrib.auth.models import User
|
|||
class UserProfile(models.Model):
|
||||
user = models.ForeignKey(User, unique=True)
|
||||
balance = models.FloatField()
|
||||
|
||||
def __unicode__(self):
|
||||
return "%s (Kontostand: %s)" % (self.user ,self.balance)
|
|
@ -0,0 +1,27 @@
|
|||
<!-- Please Intert Doctype. Or Don't. I don't care. -->
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/style.css" />
|
||||
<title>Cashboxes are forever...</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="title">
|
||||
Its Alive - and here could be a logo. Wouldn't that be nice?
|
||||
{% if user.is_authenticated %}
|
||||
Logged in as {{ user }}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="navigation">
|
||||
<div class="left">
|
||||
{% if user.is_authenticated %}
|
||||
{% include "main/navigation-login.html" %}
|
||||
{% else %}
|
||||
{% include "main/navigation.html" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
{% block "content" %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,8 @@
|
|||
<b>Main</b><br />
|
||||
<a href="/buy/">Buy</a><br />
|
||||
<a href="/transaction/">Konto</a><br />
|
||||
<a href="/">History</a><br />
|
||||
{% if user.is_staff %}
|
||||
<br /><b>Admin foo</b><br />
|
||||
<a href="/admin/">Admin Interface</a><br /><br />{% endif %}
|
||||
<a href="/user/logout/">Logout</a><br /><br />
|
|
@ -0,0 +1,2 @@
|
|||
<a href="/user/login/">Login</a><br /><br />
|
||||
<a href="/user/register/">Registrieren</a><br /><br />
|
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
No content here.
|
||||
{% endblock %}
|
|
@ -0,0 +1,30 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
{% if form.errors %}
|
||||
<!-- Thaddaeus - du bist einfach mal der krasseste Troll, den ich ueberhaupt kenne!! *grml* -->
|
||||
<!-- <marquee behavior="ALTERNATE"><p>Your username and password didn't match. Please try again.</p></marquee> -->
|
||||
<p><b>Dein Benutzername oder Passwort oder beides ist falsch.</b> <br />
|
||||
Versuch es nochmal, aber achte auf CAPSLOCK und tippe nicht so schnell..</p>
|
||||
<p><i> Falls du dein Passwort vergessen haben solltest (oder es nicht geht..), dann <br />
|
||||
melde dich bei einem Admin deiner Wahl. </i></p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action="/user/login/">
|
||||
{% csrf_token %}
|
||||
<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>
|
||||
|
||||
<input type="submit" value="login" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
FIXME: KKTHXBYE
|
||||
{% endblock %}
|
|
@ -0,0 +1,19 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
<pre>
|
||||
>>> from frunde import tannek
|
||||
>>> tannek.troll(subject="registration_not_avaliable", extended_mode=True)
|
||||
ERROR_WHILE_HANDLING_EXCEPTION
|
||||
Matestand: -65337
|
||||
>>> tannek.insertMate()
|
||||
Matestand: -65336
|
||||
>>> [tannek.insertMate() for i in range(65337)]
|
||||
STACK_SIZE_EXCEEDED
|
||||
>>> [tannek.insertMate() for i in range(tannek.STACK_SIZE)] # FUCK YA!
|
||||
UNKNOWN_COMMAND
|
||||
>>> tannek.fixEverything()
|
||||
rebooting ...
|
||||
</pre>
|
||||
You see? No registration right now! I tried and tried and it didn't work.
|
||||
{% endblock %}
|
|
@ -0,0 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
No content here.
|
||||
{% endblock %}
|
|
@ -0,0 +1,10 @@
|
|||
from django.conf.urls.defaults import *
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
urlpatterns = patterns('',
|
||||
(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'login/'}),
|
||||
(r'^register/$', 'main.views.register'),
|
||||
(r'^login/$', 'django.contrib.auth.views.login'),
|
||||
(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'registration/logout.html'}),
|
||||
)
|
|
@ -1 +1,10 @@
|
|||
# Create your views here.
|
||||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
@login_required
|
||||
def startpage(request):
|
||||
return render_to_response("main/startpage.html", {}, RequestContext(request))
|
||||
|
||||
def register(request):
|
||||
return render_to_response("registration/register.html", RequestContext(request))
|
||||
|
|
|
@ -60,8 +60,10 @@ ADMIN_MEDIA_PREFIX = '/media/admin/'
|
|||
# Make this unique, and don't share it with anybody.
|
||||
SECRET_KEY = 'l(f*a$l)_n_n_5#lh@rvhv(na^!lj1u#bow=c!*90(1w$5%b^j'
|
||||
|
||||
# User Profile
|
||||
# User Profile / Login stuff
|
||||
AUTH_PROFILE_MODULE = 'main.models.UserProfile'
|
||||
LOGIN_URL = '/user/login/'
|
||||
LOGIN_REDIRECT_URL = '/'
|
||||
|
||||
# List of callables that know how to import templates from various sources.
|
||||
TEMPLATE_LOADERS = (
|
||||
|
|
|
@ -7,17 +7,17 @@ class TransactionType(models.Model):
|
|||
needsCheck = models.BooleanField(default=True)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name + (self.needsCheck and " (needs Check)" or "")
|
||||
return unicode(self.name + (self.needsCheck and " (needs Check)" or ""))
|
||||
|
||||
class Transaction(models.Model):
|
||||
user = models.ForeignKey(User, unique=True)
|
||||
user = models.ForeignKey(User)
|
||||
transactionType = models.ForeignKey(TransactionType)
|
||||
dateTime = models.DateTimeField()
|
||||
amount = models.FloatField()
|
||||
checked = models.BooleanField(default=False)
|
||||
|
||||
def __unicode__(self):
|
||||
return "%s for user %s (%s), %schecked" % (self.amount, self.user, self.transactionType, (self.checked and "" or "not "))
|
||||
return u"%s for user %s (%s), %schecked" % (self.amount, self.user, self.transactionType, (self.checked and "" or "not "))
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block "content" %}
|
||||
|
||||
{% for transaction in history %}
|
||||
{{ transaction.amount }}, got that by {{ transaction.type }}
|
||||
{% if transaction.checked %}
|
||||
ist eingegangen
|
||||
{% else %}
|
||||
noch nicht da
|
||||
{% endif %}
|
||||
<br />
|
||||
{% endfor %}
|
||||
{% endblock %}
|
|
@ -0,0 +1,8 @@
|
|||
from django.conf.urls.defaults import *
|
||||
|
||||
|
||||
urlpatterns = patterns('',
|
||||
(r'^$', 'transaction.views.overview'),
|
||||
#(r'^transfer/$', 'transaction.views.transfer'),
|
||||
#(r'^checkTransfers/$', 'transaction.views.checkTransfers'),
|
||||
)
|
|
@ -1 +1,20 @@
|
|||
# Create your views here.
|
||||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from models import Transaction, TransactionType
|
||||
|
||||
@login_required
|
||||
def overview(request):
|
||||
history = Transaction.objects.filter(user=request.user).order_by("dateTime")
|
||||
return render_to_response("transaction/overview.html", {'history': history}, RequestContext(request))
|
||||
|
||||
#@login_required
|
||||
#def transfer(request):
|
||||
# if request.method == 'POST':
|
||||
#
|
||||
# return render_to_response("transaction/transfered.html", RequestContext(request))
|
||||
|
||||
#@kassenwart_required
|
||||
#def checkTransfers(request):
|
||||
# transfers = Transaction.objects.filter(checked=False).sort("dateTime")
|
||||
# return render_to_response("transaction/uncheckedTransfers.html", {'transfers' : tranfers}, RequestContext(request))
|
|
@ -5,13 +5,18 @@ from django.contrib import admin
|
|||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Example:
|
||||
# (r'^k4ever/', include('k4ever.foo.urls')),
|
||||
|
||||
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
|
||||
# to INSTALLED_APPS to enable admin documentation:
|
||||
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
|
||||
# Uncomment the next line to enable the admin:
|
||||
(r'^admin/', include(admin.site.urls)),
|
||||
# Example:
|
||||
# (r'^k4ever/', include('k4ever.foo.urls')),
|
||||
|
||||
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
|
||||
# to INSTALLED_APPS to enable admin documentation:
|
||||
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),
|
||||
# user stuff? go to main
|
||||
(r'^$', 'main.views.startpage'),
|
||||
(r'^user/', include('main.urls')),
|
||||
(r'^transaction/', include('transaction.urls')),
|
||||
#(r'^buy/', include('buyable.urls')),
|
||||
|
||||
# Uncomment the next line to enable the admin:
|
||||
(r'^admin/', include(admin.site.urls)),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue