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

80 lines
3.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{% load humanize %}
<article class="snipt {% if not snipt.public %}private-snipt{% endif %} {% if snipt.line_count > 8 and not detail %}expandable{% endif %} {% if snipt.user == request.user %}editable{% endif %}">
<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.stylized|safe }}
{% if snipt.line_count > 8 and not detail %}
<a href="#" class="expand">
<span class="expand">Expand</span>
<span class="collapse">Collapse</span>
<span class="lines">({{ snipt.line_count }} lines)</span>
</a>
{% endif %}
<div class="raw">{{ snipt.code }}</div>
</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="#"><span class="do">Copy</span><span class="done">Copied!</span></a>
</li>
</ul>
<section class="tags">
<h2>{{ snipt.tags.all|length }} tag{{ snipt.tags.all|pluralize }}</h2>
<ul>
{% for tag in snipt.sorted_tags %}
<li {% if forloop.counter > 3 and not detail %}class="hidden"{% endif %}>
{% if public %}
<a href="/public/tag/{{ tag.slug }}/">{{ tag }}</a>
{% else %}
<a href="/{{ snipt.user.username }}/tag/{{ tag.slug }}/">{{ tag }}</a>
{% endif %}
</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_full_absolute_url }}#disqus_thread" data-disqus-identifier="{{ snipt.id }}"></a></li>
</ul>
</footer>
<div class="modal hide copy-modal">
<div class="modal-header">
<a href="#" class="close">×</a>
<h3>Copy snipt <span>&ldquo;{{ snipt.title }}&rdquo;</span></h3>
<h4>(Text is selected. <span></span>+c to copy.)</h4>
</div>
<div class="modal-body"></div>
</div>
<div class="modal hide embed-modal">
<div class="modal-header">
<a href="#" class="close">×</a>
<h3>Embed snipt <span>&ldquo;{{ snipt.title }}&rdquo;</span></h3>
</div>
<div class="modal-body">
<textarea><script type="text/javascript">{{ snipt.get_embed_url }}</script></textarea>
</div>
</div>
</article>