diff options
Diffstat (limited to 'app/templates')
-rw-r--r-- | app/templates/index.html | 2 | ||||
-rw-r--r-- | app/templates/layout.html | 25 | ||||
-rw-r--r-- | app/templates/module_list.html | 2 | ||||
-rw-r--r-- | app/templates/module_show.html | 10 | ||||
-rw-r--r-- | app/templates/upload.html | 2 |
5 files changed, 14 insertions, 27 deletions
diff --git a/app/templates/index.html b/app/templates/index.html index 14b7fde..9d090c3 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -6,7 +6,7 @@ <ul id="studies"> {% for name,img_path in studies|sort %} <li> - <a href="{{url_for('study_index', study=name)}}"> + <a href="{{url_for('main.study_index', study=name)}}"> <img src="{{url_for('static',filename=img_path)}}" alt="{{name}}" /> {{name.capitalize()}} </a> diff --git a/app/templates/layout.html b/app/templates/layout.html index 4de48c8..06901e9 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -9,16 +9,7 @@ </head> <body> <div id="header"> - <h1><a href="/">Archiv</a><small> @ spline</small></h1> - {% if study %} - <p> - <b>Tip</b>: Du kannst alle Klausuren auch als - {% set path = 'studies/' + study %} - <a href="{{url_for('static', filename=path + '.zip')}}">ZIP</a>- oder - <a href="{{url_for('static', filename=path + '.tar.gz')}}">TAR-GZ</a>-Archiv, sowie via - <a href="{{url_for('static', filename=path + '.git')}}">git</a> herunterladen - </p> - {% endif %} + <h1><a href="/">Klausurenarchiv</a><small> @ spline</small></h1> </div> <div id="content"> @@ -26,15 +17,15 @@ <div id="sub-header"> {% if study %} <p> - {% if not request.base_url.endswith(url_for('upload', study=study, module = module))%} - {% if not request.base_url.endswith(url_for('forbidden')) %} - <a href="{{url_for('upload', study=study, module=module)}}">neue Klausur hochladen</a> + {% if not request.base_url.endswith(url_for('.upload', study=study, module = module))%} + {% if not request.base_url.endswith(url_for('errorhandler')) %} + <a href="{{url_for('main.upload', study=study, module=module)}}">neue Klausur hochladen</a> {% endif %} {% else %} - <a href="{{url_for('study_index', study=study, module=module)}}">zurück</a> + <a href="{{url_for('main.study_index', study=study, module=module)}}">zurück</a> {% endif %} </p> - <h2><a href="{{url_for('study_index', study=study)}}">{{study.capitalize()}}</a></h2> + <h2><a href="{{url_for('main.study_index', study=study)}}">{{study.capitalize()}}</a></h2> {% endif %} <ul class="flashes"> @@ -51,11 +42,7 @@ </div> <footer> - <a href="https://github.com/libgit2/libgit2">libgit2</a> - | <a href="https://gitlab.spline.inf.fu-berlin.de/cholin/klausuren">source</a> - | - <a href="https://github.com/libgit2/pygit2">pygit2</a> </footer> </body> </html> diff --git a/app/templates/module_list.html b/app/templates/module_list.html index 2b36f30..9e1409c 100644 --- a/app/templates/module_list.html +++ b/app/templates/module_list.html @@ -5,7 +5,7 @@ <ul> {% for module in modules %} <li> - <a href="{{url_for('study_index', study = study, module=module)}}">{{module}}</a> + <a href="{{url_for('main.study_index', study = study, module=module)}}">{{module}}</a> </li> {% else %} <li>Keine Klausuren bisher hochgeladen!</li> diff --git a/app/templates/module_show.html b/app/templates/module_show.html index cbaec74..e31da24 100644 --- a/app/templates/module_show.html +++ b/app/templates/module_show.html @@ -1,12 +1,12 @@ -{% macro render_module_list(module) %} +{% macro render_module_list(module, entries) %} <ul id="module-list"> -{% for year,files in module %} +{% for year,files in entries %} <li> {{year}} <ul> - {% for name,oid in files %} + {% for name in files %} <li> - <a href="{{url_for('study_show', study = study, oid=oid, filename=name)}}"> + <a href="{{url_for('.study_show', study = study, module=module, year=year, filename=name)}}"> {{name|truncate(40,True)}} </a> </li> @@ -24,7 +24,7 @@ <div id="module-index"> <h3>{{module}}</h3> - {{ render_module_list(entries)}} + {{ render_module_list(module, entries)}} </div> {% endblock %} diff --git a/app/templates/upload.html b/app/templates/upload.html index 8683be0..67c47ea 100644 --- a/app/templates/upload.html +++ b/app/templates/upload.html @@ -26,7 +26,7 @@ <div id="upload"> <form method="POST" enctype="multipart/form-data" - action="{{url_for('upload', study=study, module=module)}}"> + action="{{url_for('main.upload', study=study, module=module)}}"> {{ form.csrf_token }} {{ render_field(form.exam) }} |