...
 
Commits (2)
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-11-01 01:04+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: templates/AKPlan/current_next_aks.html:9
msgid "Plan"
msgstr "Plan"
#: templates/AKPlan/current_next_aks.html:16
msgid "Timeline"
msgstr "Timeline"
#: templates/AKPlan/current_next_aks.html:20
#: templates/AKPlan/current_next_aks_beamer.html:15
msgid "Current AKs"
msgstr "Aktuelle AKs"
#: templates/AKPlan/current_next_aks.html:29
msgid "No current AKs"
msgstr "Keine aktuellen AKs"
#: templates/AKPlan/current_next_aks.html:33
#: templates/AKPlan/current_next_aks_beamer.html:28
msgid "Next AKs"
msgstr "Nächste AKs"
{% extends 'base.html' %}
{% load i18n %}
{% load fontawesome %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item"><a href="{% url 'dashboard:dashboard' %}">{{ event.slug }}</a></li>
<li class="breadcrumb-item active">{% trans "Plan" %}</li>
{% endblock %}
{% block content %}
<div class="container" style="margin-top: 3vh;">
<div class="float-right">
<a href="{% url 'plan:ak_plan_timeline' event_slug=event.slug %}" class="btn btn-success">
{% fontawesome_icon 'calendar' %} {% trans "Timeline" %}
</a>
</div>
<h2><a name="currentAKs">{% trans "Current AKs" %}:</a></h2>
<table class="table table-striped">
{% for akslot in akslots_now %}
<tr>
<td><b><a href="{% url 'submit:ak_detail' event_slug=event.slug pk=akslot.ak.pk %}">{{ akslot.ak.name }}</a></b></td>
<td>{{ akslot.start | time:"H:i" }} - {{ akslot.end | time:"H:i" }}</td>
<td>{{ akslot.room }}</td>
</tr>
{% empty %}
{% trans "No current AKs" %}
{% endfor %}
</table>
<h2><a name="nextAKs">{% trans "Next AKs" %}:</a></h2>
<table class="table table-striped">
{% for akslot in akslots_next %}
<tr>
<td><b><a href="{% url 'submit:ak_detail' event_slug=event.slug pk=akslot.ak.pk %}">{{ akslot.ak.name }}</a></b></td>
<td>{{ akslot.start | time:"H:i" }} - {{ akslot.end | time:"H:i" }}</td>
<td>{{ akslot.room }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}
{% load bootstrap4 %}
{% load i18n %}
<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="60">
{% bootstrap_css %}
{% bootstrap_javascript jquery='full' %}
</head>
<body>
<div class="container" style="margin-top: 3vh;">
<div class="row">
<div class="col-6">
<h2>{% trans "Current AKs" %}:</h2>
<table class="table table-striped">
{% for akslot in akslots_now %}
<tr>
<td><b>{{ akslot.ak.name }}</b></td>
<td>{{ akslot.start | time:"H:i" }} - {{ akslot.end | time:"H:i" }}</td>
<td>{{ akslot.room }}</td>
</tr>
{% endfor %}
</table>
</div>
<div class="col-6">
<h2>{% trans "Next AKs" %}:</h2>
<table class="table table-striped">
{% for akslot in akslots_next %}
<tr>
<td><b>{{ akslot.ak.name }}</b></td>
<td>{{ akslot.start | time:"H:i" }} - {{ akslot.end | time:"H:i" }}</td>
<td>{{ akslot.room }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
</body>
......@@ -9,7 +9,10 @@ urlpatterns = [
path(
'<slug:event_slug>/plan/',
include([
path('', views.plan_beamer, name='ak_plan'),
path('', views.CurrentNextAKsView.as_view(), name='ak_plan'),
path('timeline/', views.plan_beamer, name='ak_plan_timeline'),
path('current_next/', views.CurrentNextAKsView.as_view(), name='ak_plan_current_next'),
path('current_next/beamer/', views.CurrentNextAKsBeamerView.as_view(), name='ak_plan_current_next_beamer'),
path('api/', include(api_router.urls)),
])
......
import datetime
import pytz
from django.shortcuts import render
from django.utils import timezone
from django.views.decorators.clickjacking import xframe_options_exempt
from django.views.generic import TemplateView
from django.views.generic import TemplateView, ListView
from AKModel.models import Event, Room, AKSlot
from AKModel.views import EventSlugMixin
......@@ -13,6 +14,49 @@ class PlanView(EventSlugMixin, TemplateView):
template_name = 'AKPlan/plan.html'
class NextAKsView(EventSlugMixin, ListView):
model = AKSlot
context_object_name = "akslots"
def get_queryset(self):
current_timestamp = datetime.datetime.now() - datetime.timedelta(minutes=30)
return super().get_queryset().filter(start__gt=current_timestamp)
class CurrentNextAKsView(EventSlugMixin, ListView):
model = AKSlot
context_object_name = "akslots"
template_name = "AKPlan/current_next_aks.html"
ordering = ['start']
def get_context_data(self, *, object_list=None, **kwargs):
context = super().get_context_data(object_list=object_list, **kwargs)
current_timestamp = datetime.datetime.now(pytz.utc) - datetime.timedelta(hours=1)
context["akslots_now"] = []
context["akslots_next"] = []
for akslot in context["akslots"]:
if akslot.start is None:
continue
if akslot.start <= current_timestamp <= akslot.end:
context["akslots_now"].append(akslot)
elif akslot.start > current_timestamp:
context["akslots_next"].append(akslot)
if len(context["akslots_next"]) == 10:
break
return context
class CurrentNextAKsBeamerView(CurrentNextAKsView):
template_name = "AKPlan/current_next_aks_beamer.html"
def clamp(n, smallest, largest):
return max(smallest, min(n, largest))
......
......@@ -8,8 +8,7 @@
{% block title %}{% trans "AKs" %}: {{ ak.event.name }} - {% trans "AK" %}: {{ ak.name }}{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ ak.event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a href="{% url 'submit:submission_overview' event_slug=ak.event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item active">{{ ak.name }}</li>
{% endblock %}
......
......@@ -8,8 +8,7 @@
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "Edit AK" %}: {{ ak.name }}{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a
href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}">{{ ak.short_name }}</a></li>
......
......@@ -17,8 +17,7 @@
{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item active">{% trans "AKs" %}</li>
{% endblock %}
......
......@@ -7,8 +7,7 @@
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Owner" %}{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a
href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item active">{% trans "AK Owner" %}</li>
......
......@@ -7,8 +7,7 @@
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Duration(s)" %}{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a
href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}">{{ ak.short_name }}</a></li>
......
......@@ -7,8 +7,7 @@
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Duration(s)" %}{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a
href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}">{{ ak.short_name }}</a></li>
......
......@@ -3,6 +3,11 @@
{% load fontawesome %}
{% load i18n %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item"><a href="{% url 'dashboard:dashboard' %}">{{ event.slug }}</a></li>
{% endblock %}
{% block footer_custom %}
{% if event.contact_email %}
<h4><a href="mailto://{{ event.contact_email }}">{% fontawesome_icon "envelope" %} {% trans "Write to organizers of this event for questions and comments" %}</a></h4>
......
......@@ -15,8 +15,7 @@
{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super }}
<li class="breadcrumb-item active">{% trans "AK Submission" %}</li>
{% endblock %}
......
......@@ -13,8 +13,7 @@
{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a
href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item"><a href="{% url 'submit:akowner_edit' event_slug=event.slug slug=owner.slug %}">{{ owner.slug }}</a></li>
......
......@@ -5,8 +5,7 @@
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "New AK Wish" %}{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">AKPlanning</li>
<li class="breadcrumb-item">{{ event.slug }}</li>
{{ block.super}}
<li class="breadcrumb-item"><a href="{% url 'submit:submission_overview' event_slug=event.slug %}">{% trans "AK Submission" %}</a></li>
<li class="breadcrumb-item active">{% trans "New AK Wish" %}</li>
{% endblock %}
......