diff --git a/server.py b/server.py index 4ff1396b5d9bb2f27d8a4505bf0246b3d5e58223..e88a2c76fff155f04cb8407312ae12f690134e41 100755 --- a/server.py +++ b/server.py @@ -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) diff --git a/static/style.css b/static/style.css index 5b9fa143fdef66ad290717e38b853a917f9410ef..f294f590209b94521d82963e2bb354301ba01617 100644 --- a/static/style.css +++ b/static/style.css @@ -1,2 +1,2 @@ .videopreview li:nth-child(even) { background: #f5f5f5; } -.courses-list li:nth-child(even) { background: #fAfAfA; } +.courses-list li:nth-child(even) { background: #fAfAfA; } diff --git a/templates/base.html b/templates/base.html index 2c7eb73175777a23ec18c9aa0783fc104cc70502..7a3abd5c36ebf59a57d4eef3f66786e202372e17 100644 --- a/templates/base.html +++ b/templates/base.html @@ -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() %} diff --git a/templates/macros.html b/templates/macros.html index 5511ef8333b087c5a443f4c56177b60eb4036eb2..53b19814b31af0c58af777227e63767f735692bb 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -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 %} diff --git a/templates/schedule.html b/templates/schedule.html new file mode 100644 index 0000000000000000000000000000000000000000..e82c9e580e1d3c74ae6d16b9c8d2ced7b7683e39 --- /dev/null +++ b/templates/schedule.html @@ -0,0 +1,16 @@ +{% 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 %} diff --git a/templates/videos.html b/templates/videos.html index 57feef3c14b94ee041ad080371192f96b2fed16c..5be235c5c7c368eec17d0c4d39f53285c1905218 100644 --- a/templates/videos.html +++ b/templates/videos.html @@ -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) }}