Commit 3259f87d authored by Julian Rother's avatar Julian Rother
Browse files

Merge branch 'master' of git.fsmpi.rwth-aachen.de:julianundandyfrickelnkram/videoagwebsite

parents 5f1f10d0 056eb1d5
......@@ -137,9 +137,9 @@ def mod_required(func):
return decorator
app.jinja_env.globals['navbar'] = []
def register_navbar(name, icon=None):
def register_navbar(name, icon=None, visible=True):
def wrapper(func):
app.jinja_env.globals['navbar'].append((func.__name__, name, icon))
app.jinja_env.globals['navbar'].append((func.__name__, name, icon, visible))
return func
return wrapper
......@@ -295,5 +295,11 @@ def auth(): # For use with nginx auth_request
else:
return "Not allowed", 403
@app.route('/schedule')
@register_navbar('Drehplan', 'calendar', visible=False)
def schedule():
return render_template('schedule.html')
if __name__ == '__main__':
app.run(threaded=True)
.videopreview li:nth-child(even) { background: #f5f5f5; }
.courses-list li:nth-child(even) { background: #fAfAfA; }
.courses-list li:nth-child(even) { background: #fAfAfA; }
......@@ -46,10 +46,12 @@
<div class="row">
<div class="col-xs-12 col-sm-8">
<ul class="nav nav-pills">
{% for endpoint, caption, gly in navbar %}
{% for endpoint, caption, gly, visible in navbar %}
{% if visible or ismod() %}
<li{% if endpoint == request.endpoint %} class="active"{% endif %}>
<a href="{{ url_for(endpoint)|e }}">{% if gly != '' %}<span class="glyphicon glyphicon-{{ gly }}"></span> {% endif %}{{ caption }}</a>
</li>
{% endif %}
{% endfor %}
<li class="navbar-right">
{% if not ismod() %}
......
......@@ -66,7 +66,7 @@
{% endmacro %}
{% macro course_list_item(course,show_semester=False) %}
<li class="list-group-item {% if not course.visible %}list-group-item-danger{% endif %}">
<li class="list-group-item {% if (not course.visible) or (not course.listed) %}list-group-item-danger{% endif %}">
<div class="row">
<a href=/course?courseid={{course.handle}}>
{% if show_semester %}
......
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% set active_page = "schedule" %}
{% block content %}
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Drehplan</h1>
</div>
<div>
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -18,7 +18,7 @@
<div class="panel-heading">
<h1 class="panel-title">{{g.grouper}}</h1>
</div>
<ul class="courses-list list-group">
<ul class="{% if not ismod() %}courses-list {% endif %}list-group">
{% for i in g.list %}
{% if groupedby == 'semester' %}
{{ course_list_item(i) }}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment