c3navclient? hide the headers!

This commit is contained in:
Laura Klünder 2018-11-26 00:51:17 +01:00
parent 92ce3144bf
commit 5055b6a367
6 changed files with 36 additions and 18 deletions

View file

@ -1,5 +1,8 @@
import json
import os
from django.core.serializers.json import DjangoJSONEncoder
from c3nav.site.finders import logo_paths
logos_result = {
@ -10,3 +13,15 @@ logos_result = {
def logos(request):
return logos_result
def mobileclient(request):
return {
'mobileclient': 'c3navclient' in request.META['HTTP_USER_AGENT'],
}
def user_data_json(request):
return {
'user_data_json': lambda: json.dumps(dict(request.user_data), cls=DjangoJSONEncoder),
}

View file

@ -32,6 +32,7 @@ body {
display: flex;
flex-direction: column;
position: absolute;
align-items: stretch;
top: 0;
left: 0;
bottom: 0;

View file

@ -18,8 +18,8 @@
<link href="{% static 'site/css/c3nav.scss' %}" rel="stylesheet" type="text/x-scss">
{% endcompress %}
</head>
<body>
{% if not embed %}
<body{% if mobileclient %} data-user-data="{{ user_data_json }}"{% endif %}>
{% if not embed and not mobileclient %}
<header>
<h1><a href="{% block header_title_url %}/{% endblock %}">
{% if header_logo %}<img src="{% static header_logo %}">{% else %}c3nav {% endif %}{% spaceless %}