public program: no header menu
This commit is contained in:
parent
726f20df71
commit
be789c90a6
10
planning/templates/planning/public-program.html
Normal file
10
planning/templates/planning/public-program.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{% extends '_base.html' %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<h1>{{ site.name }} – {% trans "Program" %}</h1>
|
||||||
|
|
||||||
|
{{ program }}
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -19,6 +19,7 @@ Event = namedtuple('Event', ['talk', 'row', 'rowcount'])
|
||||||
class Program:
|
class Program:
|
||||||
def __init__(self, site, pending=False, empty_rooms=False, talk_filter=None):
|
def __init__(self, site, pending=False, empty_rooms=False, talk_filter=None):
|
||||||
self.site = site
|
self.site = site
|
||||||
|
self.conference = Conference.objects.get(site=self.site)
|
||||||
self.talks = Talk.objects.\
|
self.talks = Talk.objects.\
|
||||||
filter(site=site, room__isnull=False, start_date__isnull=False).\
|
filter(site=site, room__isnull=False, start_date__isnull=False).\
|
||||||
filter(Q(duration__gt=0) | Q(event__duration__gt=0))
|
filter(Q(duration__gt=0) | Q(event__duration__gt=0))
|
||||||
|
@ -175,7 +176,6 @@ class Program:
|
||||||
if not len(self.days):
|
if not len(self.days):
|
||||||
return result % {'conference': '', 'days': ''}
|
return result % {'conference': '', 'days': ''}
|
||||||
|
|
||||||
conference = Conference.objects.get(site=self.site)
|
|
||||||
conference_xml = """<conference>
|
conference_xml = """<conference>
|
||||||
<title>%(title)s</title>
|
<title>%(title)s</title>
|
||||||
<subtitle></subtitle>
|
<subtitle></subtitle>
|
||||||
|
@ -189,8 +189,8 @@ class Program:
|
||||||
</conference>
|
</conference>
|
||||||
""" % {
|
""" % {
|
||||||
'title': self.site.name,
|
'title': self.site.name,
|
||||||
'venue': ', '.join(map(lambda x: x.strip(), conference.venue.split('\n'))),
|
'venue': ', '.join(map(lambda x: x.strip(), self.conference.venue.split('\n'))),
|
||||||
'city': conference.city,
|
'city': self.conference.city,
|
||||||
'start_date': sorted(self.days.keys())[0].strftime('%Y-%m-%d'),
|
'start_date': sorted(self.days.keys())[0].strftime('%Y-%m-%d'),
|
||||||
'end_date': sorted(self.days.keys(), reverse=True)[0].strftime('%Y-%m-%d'),
|
'end_date': sorted(self.days.keys(), reverse=True)[0].strftime('%Y-%m-%d'),
|
||||||
'days_count': len(self.days),
|
'days_count': len(self.days),
|
||||||
|
|
|
@ -41,17 +41,17 @@ class RoomDetail(StaffRequiredMixin, RoomMixin, DetailView):
|
||||||
@staff_required
|
@staff_required
|
||||||
def program_pending(request):
|
def program_pending(request):
|
||||||
output = request.GET.get('format', 'html')
|
output = request.GET.get('format', 'html')
|
||||||
return program(request, pending=True, output=output)
|
return program(request, pending=True, output=output, html_template='pending-program.html')
|
||||||
|
|
||||||
def program_public(request):
|
def program_public(request):
|
||||||
output = request.GET.get('format', 'html')
|
output = request.GET.get('format', 'html')
|
||||||
return program(request, pending=False, output=output)
|
return program(request, pending=False, output=output)
|
||||||
|
|
||||||
|
|
||||||
def program(request, pending, output):
|
def program(request, pending=False, output='html', html_template='public-program.html'):
|
||||||
program = Program(site=get_current_site(request), pending=pending)
|
program = Program(site=get_current_site(request), pending=pending)
|
||||||
if output == 'html':
|
if output == 'html':
|
||||||
return render(request, 'planning/program.html', {'program': program})
|
return render(request, 'planning/' + html_template, {'program': program})
|
||||||
elif output == 'xml':
|
elif output == 'xml':
|
||||||
return HttpResponse(program.as_xml(), content_type="application/xml")
|
return HttpResponse(program.as_xml(), content_type="application/xml")
|
||||||
else:
|
else:
|
||||||
|
|
57
ponyconf/templates/_base.html
Normal file
57
ponyconf/templates/_base.html
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
{% load staticfiles bootstrap3 %}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta name="description" content="">
|
||||||
|
<meta name="author" content="">
|
||||||
|
<link rel="shortcut icon" type="image/png" href="{% static 'img/favicon.ico' %}"/>
|
||||||
|
{% comment %}<link rel="icon" href="{% static 'favicon.ico' %}">{% endcomment %}
|
||||||
|
|
||||||
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
|
||||||
|
<title>{% block title %}{{ site.name }}{% endblock %}</title>
|
||||||
|
|
||||||
|
{% bootstrap_css %}
|
||||||
|
<link href="{% static 'css/ponyconf.css' %}" rel="stylesheet">
|
||||||
|
{% block css %}{% endblock %}
|
||||||
|
|
||||||
|
{% block js %}{% endblock %}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
{% block pageheader %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
{% bootstrap_messages %}
|
||||||
|
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
|
||||||
|
</div> <!-- /col -->
|
||||||
|
|
||||||
|
</div> <!-- /row -->
|
||||||
|
|
||||||
|
{% block pagefooter %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
</div> <!-- /container -->
|
||||||
|
|
||||||
|
<script src="{% bootstrap_jquery_url %}"></script>
|
||||||
|
{% bootstrap_javascript %}
|
||||||
|
<script src="{% static 'js/ponyconf.js' %}"></script>
|
||||||
|
{% block js_end %}{% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,32 +1,7 @@
|
||||||
{% load staticfiles bootstrap3 accounts_tags i18n %}
|
{% extends '_base.html' %}
|
||||||
<!DOCTYPE html>
|
{% load accounts_tags i18n %}
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="description" content="">
|
|
||||||
<meta name="author" content="">
|
|
||||||
<link rel="shortcut icon" type="image/png" href="{% static 'img/favicon.ico' %}"/>
|
|
||||||
{% comment %}<link rel="icon" href="{% static 'favicon.ico' %}">{% endcomment %}
|
|
||||||
|
|
||||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
||||||
<!--[if lt IE 9]>
|
|
||||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
|
|
||||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
<title>{% block title %}{{ site.name }}{% endblock %}</title>
|
|
||||||
|
|
||||||
{% bootstrap_css %}
|
|
||||||
<link href="{% static 'css/ponyconf.css' %}" rel="stylesheet">
|
|
||||||
{% block css %}{% endblock %}
|
|
||||||
|
|
||||||
{% block js %}{% endblock %}
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
{% block pageheader %}
|
||||||
<!-- Static navbar -->
|
<!-- Static navbar -->
|
||||||
<div class="navbar navbar-default navbar-static-top" role="navigation">
|
<div class="navbar navbar-default navbar-static-top" role="navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -117,32 +92,11 @@
|
||||||
</div><!--/.nav-collapse -->
|
</div><!--/.nav-collapse -->
|
||||||
</div><!--/.container-fluid -->
|
</div><!--/.container-fluid -->
|
||||||
</div>
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
<div class="container">
|
{% block pagefooter %}
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-md-12">
|
|
||||||
|
|
||||||
{% bootstrap_messages %}
|
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
|
||||||
|
|
||||||
</div> <!-- /col -->
|
|
||||||
|
|
||||||
</div> <!-- /row -->
|
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<p class="text-muted">{% trans "Powered by" %} <a href="https://github.com/toulibre/ponyconf">PonyConf</a></p>
|
<p class="text-muted">{% trans "Powered by" %} <a href="https://github.com/toulibre/ponyconf">PonyConf</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
|
{% endblock %}
|
||||||
</div> <!-- /container -->
|
|
||||||
|
|
||||||
<script src="{% bootstrap_jquery_url %}"></script>
|
|
||||||
{% bootstrap_javascript %}
|
|
||||||
<script src="{% static 'js/ponyconf.js' %}"></script>
|
|
||||||
{% block js_end %}{% endblock %}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user