snipt/snipts/templates/snipts/detail.html

87 lines
3.7 KiB
HTML

{% extends "base.html" %}
{% block page-title %}/ {% if snipt.title %}{{ snipt.title }}{% else %}Untitled{% endif %} / {{ user.username }} - {{ block.super }}{% endblock %}
{% block html-class %}detail{% endblock %}
{% block body-class %}{% if request.path == '/api/' or request.path == '/blogging/' %}snipt-page{% else %}detail{% endif %}{% endblock %}
{% block js %}
{{ block.super }}
window.detail = true;
{% endblock %}
{% block breadcrumb %}
<li><a href="/{{ user.username }}/">{{ user.username }}</a></li>
<li><span class="prompt">/</span> <a href="{{ snipt.get_absolute_url }}">{{ snipt.title }}</a></li>
{% endblock %}
{% block aside-inner %}
{% if request.path == '/api/' %}
{% if request.user.is_authenticated %}
<aside class="api-info api-creds">
<div class="api-inner">
<h5>Your API credentials:</h5>
<ul>
<li>Username: <strong>{{ request.user.username }}</strong></li>
<li>User ID: <strong>{{ request.user.id }}</strong></li>
<li>API Key: <br /><input type="text" value="{{ request.user.api_key.key }}" /></li>
</ul>
</div>
</aside>
{% endif %}
<aside class="api-info immediate-help">
<div class="api-inner">
<h5>Need immediate help?</h5>
<p>Ping &ldquo;nicksergeant&rdquo; in <strong>#snipt</strong> on irc.freenode.net.</p>
</div>
</aside>
{% endif %}
{% endblock %}
{% block content %}
<section class="snipts" id="snipts">
{% if not request.user.profile.is_pro %}
{% include 'ad-detail.html' %}
{% endif %}
{% with 'true' as detail %}
{% include "snipts/snipt-list.html" %}
{% endwith %}
<div id="disqus_thread">
{% if snipt.public %}
<script type="text/javascript">
var disqus_shortname = 'snipt-net';
{% if debug %}
var disqus_developer = 1;
{% endif %}
var disqus_url = '{{ snipt.get_full_absolute_url }}';
var disqus_title = '{{ snipt.title }}';
var disqus_identifier = {{ snipt.id }};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
{% else %}
<p class="alert alert-info">
<strong>Disqus comments have been disabled on private snipts.</strong><br /><br />
See <a href="https://github.com/nicksergeant/snipt/issues/53">https://github.com/nicksergeant/snipt/issues/53</a> if you would like more information on this decision.
</p>
{% endif %}
</div>
{% if not request.user.profile.is_pro %}
<div class="google-ads" style="margin-top: 30px;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- New Snipt Leaderboard Bottom -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6776929316186576"
data-ad-slot="5960460864"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
{% endif %}
</section>
{% endblock %}