1
0
Fork 0
mirror of https://github.com/Findus23/se-simulator.git synced 2024-09-19 15:53:45 +02:00

add robots.txt and fix pagination with filter

This commit is contained in:
Lukas Winkler 2018-03-28 16:58:05 +02:00
parent a6df3fe24f
commit 9a624297a8
3 changed files with 10 additions and 8 deletions

View file

@ -9,7 +9,7 @@
<a href="{{ url_for("index") }}">Clear filter</a>
{% endif %}
{{ pagination(pagearray, num_pages, page, True) }}
{{ pagination(pagearray, num_pages, page, site.url if not site.fallback else None, True) }}
{% for question in questions %}
{% set vote=voted[("question", question.id)] %}
<div class="content question"
@ -34,5 +34,5 @@
</div>
</div>
{% endfor %}
{{ pagination(pagearray, num_pages, page, False) }}
{{ pagination(pagearray, num_pages, page, site.url if not site.fallback else None, False) }}
{% endblock %}

View file

@ -1,13 +1,13 @@
{% macro printpage(i,active) %}
{% macro printpage(i,active, site) %}
{# <a href="/projekte/{{ i }}/" class="{{ "active" if i == active else "other" }}">{{ i }}</a>#}
<a href="{{url_for("index",page=i)}}" class="{{ "active" if i == active|string() else "other" }}">{{ i }}</a>
<a href="{{url_for("index", page=i, site=site)}}" class="{{ "active" if i == active|string() else "other" }}">{{ i }}</a>
{% endmacro %}
{% macro pagination(pagearray, num_pages, page,top) %}
{% macro pagination(pagearray, num_pages, page, site, top) %}
<!-- License of svg icons - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) -->
<div class="pagination {{ "top" if top else "bottom" }}">
{% if page > 1 %}
<a rel="prev" href="{{ url_for("index",page=page-1) }}">
<a rel="prev" href="{{ url_for("index", page=page-1, site=site) }}">
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
<path d="M1203 544q0 13-10 23l-393 393 393 393q10 10 10 23t-10 23l-50 50q-10 10-23 10t-23-10l-466-466q-10-10-10-23t10-23l466-466q10-10 23-10t23 10l50 50q10 10 10 23z"></path>
</svg>
@ -23,11 +23,11 @@
{% if i == "d" %}
<a class="disabled other">&hellip;</a>
{% else %}
{{ printpage(i, page) }}
{{ printpage(i, page, site) }}
{% endif %}
{% endfor %}
{% if page < num_pages %}
<a rel="next" href="{{ url_for("index",page=page+1) }}">
<a rel="next" href="{{ url_for("index",page=page+1, site=site) }}">
<svg viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg">
<path d="M1171 960q0 13-10 23l-466 466q-10 10-23 10t-23-10l-50-50q-10-10-10-23t10-23l393-393-393-393q-10-10-10-23t10-23l50-50q10-10 23-10t23 10l466 466q10 10 10 23z"></path>
</svg>

2
web/robots.txt Normal file
View file

@ -0,0 +1,2 @@
User-agent: *
Disallow: /