Event resturcturing

- new short_description field instead of title
- autosave text

- autocompletion on login
This commit is contained in:
Martin Bauer
2013-09-28 18:57:19 +02:00
parent 6c3a7ca408
commit d71c35bcd7
32 changed files with 639 additions and 118 deletions

View File

@@ -158,10 +158,10 @@
<div id="route_info_box" class="span5 box_wrapp">
<div class="box_cont">
<div class="head">
<h6>Fahrt zum Konzert:</h6>
<h6>Nächstes Konzert:</h6>
</div>
Nächstes Konzert ist in {{nextConcert.location}} <br/> am {{nextConcert.date}} um {{nextConcert.time | time:"H:i" }} <br/>
{% if nextConcert.meeting_time %} Treffpunkt ist um {{ nextConcert.meeting_time | time:"H:i" }} <br/> {% endif %}
Nächstes Konzert ist in <br> <em>{{nextConcert.location}}</em> <br> am {{nextConcert.date | date:"SHORT_DATE_FORMAT" }} um {{nextConcert.time | time:"H:i" }} Uhr <br/>
{% if nextConcert.meeting_time %} Treffpunkt ist um {{ nextConcert.meeting_time | time:"H:i" }} Uhr <br/> {% endif %}
<table>
<tr> <td> Fahrzeit:</td> <td> <span id="route_duration"></span> </td> </tr>

View File

@@ -38,9 +38,9 @@
<div class="span6 text">
<h4>Der nächste Termin:</h4>
<p>
{{countdown.event.title}} ist am {{countdown.event.date}}
{{countdown.event.title}} ist am {{countdown.event.date | date:"SHORT_DATE_FORMAT" }}
um {{countdown.event.displaytime | time:"H:i" }}
in {{countdown.event.location}}
in <em>{{countdown.event.location}} </em>
<br/>
{% if countdown.participation == "?" %}

View File

@@ -30,6 +30,11 @@
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/jquery.noty.css" type="text/css" media="screen" /> {% endaddtoblock %}
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/noty_theme_default.css" type="text/css" media="screen" /> {% endaddtoblock %}
<!-- For Autocompete -->
{% addtoblock "js" strip %} <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> {% endaddtoblock %}
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/jquery-ui-1.8.21.custom.css" type="text/css" media="screen" /> {% endaddtoblock %}
<!-- Notifications -->
{% addtoblock "js" %}
@@ -54,7 +59,12 @@
});
e.preventDefault();
});
} );
$.get( "/login/usernames", function( data ) {
$("#username").autocomplete( { source: data } );
});
});
</script>
{% endaddtoblock %}
@@ -71,7 +81,7 @@
<div class="span12 footer" action="index.html" method="post">
<form id="loginform">
{% csrf_token %}
<input name="username" type="text" placeholder="Benutzername">
<input name="username" type="text" placeholder="Benutzername" id="username">
<input name="password" type="password" placeholder="Passwort">
<input name="next" type="hidden" value="{{next}}" >
<input type="submit" placeholder="OK" value="einloggen">

View File

@@ -1,16 +0,0 @@
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)

View File

@@ -13,6 +13,7 @@ from eventplanner.models import Event, EventParticipation
from musicians.models import Musician
from datetime import datetime
from django.contrib.auth.models import User
@login_required
@@ -72,11 +73,17 @@ def logout_view(request):
return redirect( login_view )
def userlistForAutocompletion(request):
result = [ u.username for u in User.objects.all() ]
return HttpResponse( simplejson.dumps(result), mimetype='application/json' )
def login_view( request ):
if request.method == 'POST': # If the form has been submitted...
username = request.POST['username']
raiseFirstLetter = lambda s: s[:1].upper() + s[1:] if s else ''
username = raiseFirstLetter( request.POST['username'] )
password = request.POST['password']
user = authenticate(username=username, password=password)
user = authenticate( username=username, password=password )
result = dict()
result['err'] = ""
if user is not None: