snipt/snipts/templates/snipts/detail.html

85 lines
3.5 KiB
HTML

{% extends "base.html" %}
{% block add-snipt %}
<li class="add-snipt">
<button class="btn btn-info btn-large" id="add-snipt">
Add {% if request.user.username == 'blog' %}Post{% else %}Snipt{% endif %}
<i class="icon-search icon-plus icon-white"></i>
</button>
</li>
{% endblock %}
{% 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.is_authenticated %}
{% include 'ad-leaderboard-pro.html' %}
{% elif not request.user.profile.teams_beta_seen %}
{% include 'ad-leaderboard-pro.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>
</section>
{% endblock %}