1
1
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yadc/yadc/templates/_includes.html

67 lines
2.0 KiB
HTML

<!-- https://flask-sqlalchemy.palletsprojects.com/en/2.x/api/#flask_sqlalchemy.Pagination.iter_pages -->
{% macro render_pagination(endpoint) %}
<div class="pagin">
{% if pagination.has_prev %}
<a href="{{ utils.query_replace({}, url_for(endpoint, page=pagination.prev_num)) }}"><span class="fa fa-chevron-left"></span></a>
{% endif %}
{% for page in pagination.iter_pages(left_edge=1, left_current=1, right_current=2, right_edge=1) %}
{% if page %}
{% if page != pagination.page %}
<a href="{{ utils.query_replace({}, url_for(endpoint, page=page)) }}">{{ page }}</a>
{% else %}
<a><strong>{{ page }}</strong></a>
{% endif %}
{% else %}
<span class=ellipsis></span>
{% endif %}
{% endfor %}
{% if pagination.has_next %}
<a href="{{ utils.query_replace({}, url_for(endpoint, page=pagination.next_num)) }}"><span class="fa fa-chevron-right"></span></a>
{% endif %}
</div>
{% endmacro %}
<!-- {% macro rating(rating) %}
<article class="rating">
<h3>Rating</h3>
<input type="checkbox" name="" id="">
</article>
{% endmacro %} -->
{% macro render_comments() %}
<div class="comment_container">
{% for comment in comments %}
<article>
<div class="head">
<h4>{{ comment.user.username }}</h4>
{% if comment.can_edit %}
<span class="controls">edit</span>
{% endif %}
</div>
{% if not comment.deleted %}
<p>{{ comment.content }}</p>
{% else %}
<p class="deleted">{{ comment.delete_reason }}</p>
{% endif %}
</article>
{% endfor %}
{% if not comments %}
<p>No comments so far.</p>
{% endif %}
</div>
{% endmacro %}
{% macro render_post_edit() %}
<article class="edit">
<h3>Edit</h3>
<a href="">edit?</a>
</article>
{% endmacro %}
{% macro render_sidenav(sidenav_links) %}
<article class="sidenav">
{% for class, (name, link) in sidenav_links.items() %}
<a href="{{ link }}">{{ name }}</a>
{% endfor %}
</article>
{% endmacro %}