Addressbook
- location field.. has to be refactored
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
{% addtoblock "js" strip %} <script src="{{STATIC_URL}}/js/jquery.countdown.min.js"></script> {% endaddtoblock %}
|
||||
{% addtoblock "js" strip %} <script src="{{STATIC_URL}}/js/theme.js"></script> {% endaddtoblock %}
|
||||
{% addtoblock "js" strip %} <script src="{{STATIC_URL}}/js/index-slider.js" type="text/javascript" ></script>{% endaddtoblock %}
|
||||
{% addtoblock "js" strip %} <script src="{{STATIC_URL}}/js/bindWithDelay.js" type="text/javascript" ></script>{% endaddtoblock %}
|
||||
|
||||
{% addtoblock "js" %}
|
||||
|
||||
|
||||
@@ -75,87 +75,89 @@
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/lib/animate.css" media="screen, projection">{% endaddtoblock %}
|
||||
{% addtoblock "css" strip %}<link rel="stylesheet" href="{{STATIC_URL}}/css/coming-soon.css" type="text/css" media="screen" />{% endaddtoblock %}
|
||||
|
||||
{% if event %}
|
||||
|
||||
{% addtoblock "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
|
||||
|
||||
function callback(event) {
|
||||
$this = $(this);
|
||||
$this.find('span#'+event.type).html(event.value);
|
||||
switch(event.type) {
|
||||
case "seconds":
|
||||
case "minutes":
|
||||
case "hours":
|
||||
case "days":
|
||||
case "weeks":
|
||||
case "daysLeft":
|
||||
case "finished":
|
||||
}
|
||||
}
|
||||
|
||||
$('div#clock').countdown(new Date().valueOf() + {{epoch}} , callback);
|
||||
});
|
||||
</script>
|
||||
{% endaddtoblock %}
|
||||
|
||||
|
||||
|
||||
<div id="coming_soon">
|
||||
<div class="head">
|
||||
<div class="container">
|
||||
<div class="span6 text">
|
||||
<h4>Der nächste Termin:</h4>
|
||||
<p>
|
||||
{{event.title}} ist am {{event.date}} um {{event.displaytime | time:"H:i" }} in {{event.location}}
|
||||
|
||||
<br/>
|
||||
{% if participation == "?" %}
|
||||
Du hast dich noch nicht für diesen Termin eingetragen!
|
||||
{% elif participation == "Yes" %}
|
||||
Du hast für diesen Termin zugesagt.
|
||||
{% elif participation == "No" %}
|
||||
Du hast für diesen Termin abgesagt.
|
||||
{%endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="span6 count" id="clock">
|
||||
<div class="box last">
|
||||
<div class="circle">
|
||||
<span id="seconds"></span>
|
||||
</div>
|
||||
<p>Sekunden</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="circle">
|
||||
<span id="minutes"></span>
|
||||
</div>
|
||||
<p>Minuten</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="circle">
|
||||
<span id="hours"></span>
|
||||
</div>
|
||||
<p>Stunden</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="circle">
|
||||
<span id="days"></span>
|
||||
</div>
|
||||
<p>Tage</p>
|
||||
</div>
|
||||
<!-- <div class="box">
|
||||
<div class="circle">
|
||||
<span id="weeks"></span>
|
||||
</div>
|
||||
<p>Weeks</p>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% addtoblock "js" %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
|
||||
|
||||
|
||||
function callback(event) {
|
||||
$this = $(this);
|
||||
$this.find('span#'+event.type).html(event.value);
|
||||
switch(event.type) {
|
||||
case "seconds":
|
||||
case "minutes":
|
||||
case "hours":
|
||||
case "days":
|
||||
case "weeks":
|
||||
case "daysLeft":
|
||||
case "finished":
|
||||
}
|
||||
}
|
||||
|
||||
$('div#clock').countdown(new Date().valueOf() + {{epoch}} , callback);
|
||||
});
|
||||
</script>
|
||||
{% endaddtoblock %}
|
||||
|
||||
|
||||
|
||||
<div id="coming_soon">
|
||||
<div class="head">
|
||||
<div class="container">
|
||||
<div class="span6 text">
|
||||
<h4>Der nächste Termin:</h4>
|
||||
<p>
|
||||
{{event.title}} ist am {{event.date}} um {{event.displaytime | time:"H:i" }} in {{event.location}}
|
||||
|
||||
<br/>
|
||||
{% if participation == "?" %}
|
||||
Du hast dich noch nicht für diesen Termin eingetragen!
|
||||
{% elif participation == "Yes" %}
|
||||
Du hast für diesen Termin zugesagt.
|
||||
{% elif participation == "No" %}
|
||||
Du hast für diesen Termin abgesagt.
|
||||
{%endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="span6 count" id="clock">
|
||||
<div class="box last">
|
||||
<div class="circle">
|
||||
<span id="seconds"></span>
|
||||
</div>
|
||||
<p>Sekunden</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="circle">
|
||||
<span id="minutes"></span>
|
||||
</div>
|
||||
<p>Minuten</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="circle">
|
||||
<span id="hours"></span>
|
||||
</div>
|
||||
<p>Stunden</p>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="circle">
|
||||
<span id="days"></span>
|
||||
</div>
|
||||
<p>Tage</p>
|
||||
</div>
|
||||
<!-- <div class="box">
|
||||
<div class="circle">
|
||||
<span id="weeks"></span>
|
||||
</div>
|
||||
<p>Weeks</p>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
@@ -7,26 +7,35 @@ from django.core.urlresolvers import reverse
|
||||
from django.http import HttpResponse
|
||||
|
||||
from django.utils import simplejson
|
||||
from django.contrib.auth.decorators import login_required
|
||||
|
||||
|
||||
from eventplanner.models import Event, EventParticipation
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
@login_required
|
||||
def home_view(request):
|
||||
events = Event.objects.filter( date__gte = datetime.now() ).order_by('date')[:1]
|
||||
context = dict()
|
||||
|
||||
|
||||
part = EventParticipation.objects.filter( musician__user = request.user ).filter( event = events[0] )
|
||||
|
||||
eventTime = datetime( events[0].date.year, events[0].date.month, events[0].date.day,
|
||||
events[0].displaytime.hour, events[0].displaytime.minute )
|
||||
|
||||
context['hasParticipationSetForAllEvents'] = EventParticipation.hasUserSetParticipationForAllEvents( request.user)
|
||||
context['event'] = events[0]
|
||||
context['epoch'] = int( (eventTime - datetime.now() ).total_seconds() * 1000 )
|
||||
context['participation'] = part[0].status
|
||||
|
||||
events = Event.objects.filter( date__gte = datetime.now() ).order_by('date')[:1]
|
||||
if ( len(events) > 0 ):
|
||||
print "len(events): " + str( len(events ))
|
||||
nextEvent = events[0]
|
||||
part = EventParticipation.objects.filter( musician__user = request.user ).filter( event = nextEvent )
|
||||
|
||||
eventTime = datetime( events[0].date.year, events[0].date.month, events[0].date.day,
|
||||
events[0].displaytime.hour, events[0].displaytime.minute )
|
||||
|
||||
context['hasParticipationSetForAllEvents'] = EventParticipation.hasUserSetParticipationForAllEvents( request.user)
|
||||
context['event'] = events[0]
|
||||
|
||||
context['epoch'] = int( (eventTime - datetime.now() ).total_seconds() * 1000 )
|
||||
context['participation'] = part[0].status
|
||||
else:
|
||||
context['hasParticipationSetForAllEvents'] = True
|
||||
|
||||
|
||||
return render( request, 'website/mainpage.html', context )
|
||||
|
||||
|
||||
@@ -48,7 +57,8 @@ def login_view(request):
|
||||
if not request.POST.get('remember', None):
|
||||
request.session.set_expiry( 0 )
|
||||
login(request, user)
|
||||
result['redirect'] = reverse( home_view )
|
||||
#result['redirect'] = reverse( home_view )
|
||||
result['redirect'] = "/"
|
||||
else:
|
||||
result['err'] = "Dein Account wurde deaktiviert."
|
||||
# Return a 'disabled account' error message
|
||||
|
||||
Reference in New Issue
Block a user