snipt/snipt/snipts/templates/snipts/snipt-list.html

66 lines
2.4 KiB
HTML

{% load humanize %}
<article class="snipt">
<div class="number">#{{ snipt.id }}</div>
<div class="group">
<div class="container">
<header>
<h2>{{ snipt.lexer_name }}</h2>
<h1><a href="{{ snipt.get_absolute_url }}">{{ snipt.title }}</a></h1>
</header>
<section class="code {% if request.GET.style %}{{ request.GET.style }}{% else %}autumn{% endif %}">
{{ snipt.get_stylized|safe }}
{% if snipt.get_line_count > 9 %}
<a href="#" class="expand">
<span class="expand">Expand</span>
<span class="collapse">Collapse</span>
<span class="lines">({{ snipt.get_line_count }} lines)</span>
</a>
{% endif %}
</section>
<div class="ruler top-x"></div>
<div class="ruler bottom-x"></div>
</div>
<aside>
<ul class="options">
{% if snipt.user == request.user %}
<li>
<a class="edit" href="#">Edit</a>
</li>
{% endif %}
<li>
<a class="embed" href="#">Embed</a>
</li>
<li>
<a class="copy" href="#">Copy</a>
</li>
</ul>
<section class="tags">
<h2>Tags</h2>
<ul>
{% for tag in snipt.tags.all %}
<li>
<a href="">{{ tag }}</a>
</li>
{% endfor %}
</ul>
</section>
</aside>
</div>
<footer>
<ul class="attrs">
<li class="author"><a href="{{ snipt.user.get_absolute_url }}">{{ snipt.user.username }}</a></li>
<li class="created">{{ snipt.created|naturalday }}</li>
<li class="comments">
<a href="{{ snipt.get_absolute_url }}#comments">
{% if snipt.comment_set.all|length > 0 %}
{{ snipt.comment_set.all|length }} Comment{{ snipt.comment_set.all|pluralize }}
{% else %}
No comments
{% endif %}
</a>
</li>
</ul>
</footer>
</article>