diff --git a/kfet/consumers.py b/kfet/consumers.py index dcd69bdf..2525b28f 100644 --- a/kfet/consumers.py +++ b/kfet/consumers.py @@ -24,3 +24,21 @@ class KPsul(JsonWebsocketConsumer): def disconnect(self, message, **kwargs): pass + +class Home(JsonWebsocketConsumer): + + # Set to True if you want them, else leave out + strict_ordering = False + slight_ordering = False + + def connection_groups(self, **kwargs): + return ['kfet.home'] + + def connect(self, message, **kwargs): + pass + + def receive(self, content, **kwargs): + pass + + def disconnect(self, message, **kwargs): + pass diff --git a/kfet/routing.py b/kfet/routing.py index 5ea343cb..440fb3ce 100644 --- a/kfet/routing.py +++ b/kfet/routing.py @@ -9,4 +9,5 @@ from kfet import consumers channel_routing = [ route_class(consumers.KPsul, path=r"^/ws/k-fet/k-psul/$"), + route_class(consumers.Home, path=r"^/ws/k-fet/home/$"), ] diff --git a/kfet/static/kfet/css/index.css b/kfet/static/kfet/css/index.css index 2d18e2de..fb30da5f 100644 --- a/kfet/static/kfet/css/index.css +++ b/kfet/static/kfet/css/index.css @@ -149,6 +149,12 @@ textarea { line-height:30px; } +.content-left .line-medium { + font-size:20px; + font-weight:bold; + text-align:center; +} + .content-left .line.line-big { font-family:Oswald; font-size:60px; @@ -156,6 +162,13 @@ textarea { text-align:center; } +.content-left .line.line-large { + font-family:Oswald; + font-size:40px; + font-weight:bold; + text-align:center; +} + .content-left .line.line-bigsub { font-size:25px; font-weight:bold; @@ -166,6 +179,13 @@ textarea { font-size:45px; text-align:center; } +/* +.content-left-top .line.to-colorize { + padding-left: 30px; + padding-right: 30px; + margin-left: -30px; + margin-right: -30px; +}*/ .content-right { margin:0 15px; diff --git a/kfet/templates/kfet/home.html b/kfet/templates/kfet/home.html index 31feece2..1d488847 100644 --- a/kfet/templates/kfet/home.html +++ b/kfet/templates/kfet/home.html @@ -5,20 +5,32 @@ {% block title %}Accueil{% endblock %} {% block content-header-title %}Accueil{% endblock %} -{% block content %} +{% block extra_head %} + + +{% endblock %} + + +{% block content %}
-
Trucs
-
à dire
+
La K-Fêt est Peut-être
+
???????
+
+ Dernière activité il y a + +
+
@@ -67,124 +79,107 @@
-{% endblock %} - -{% block extra_head %} - - + {% endblock %} + diff --git a/kfet/views.py b/kfet/views.py index ac885675..15059ec2 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -44,10 +44,15 @@ class Home(TemplateView): def get_context_data(self, **kwargs): context = super(TemplateView, self).get_context_data(**kwargs) + # Carte articles = Article.objects.all().filter(is_sold=True, hidden=False) context['pressions'] = articles.filter(category__name='Pression') context['articles'] = (articles.exclude(category__name='Pression') .order_by('category')) + # La K-Fêt est ouverte ? + last_opgroup = OperationGroup.objects.all().order_by('-at').first() + context['last_op'] = last_opgroup.at.isoformat() + # context['dark'] = return context @method_decorator(login_required) @@ -1108,6 +1113,12 @@ def kpsul_perform_operations(request): 'stock': article['stock'] }) consumers.KPsul.group_send('kfet.kpsul', websocket_data) + + # Websocket last operation + websocket_last_op = {} + websocket_last_op['last_op'] = operationgroup.at.isoformat() + consumers.Home.group_send('kfet.home', websocket_last_op) + return JsonResponse(data) @teamkfet_required