snipt/templates/base.html

359 lines
16 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 compress verbatim %}
<!DOCTYPE html>
<html lang="en" class="{% block html-class %}{% endblock %}">
<head>
<title>{% block page-title %}Snipt{% endblock %}</title>
<meta charset="utf-8" />
<meta name="description" content="Long-term memory for coders. Share and store code snippets." />
<link rel="icon" href="{{ STATIC_URL }}images/favicon.ico">
{% compress css %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css" />
<link rel="stylesheet" type="text/scss" href="{{ STATIC_URL }}css/style.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/themes.css" />
{% endcompress %}
{% compress js %}
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/underscore.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/jquery.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/json2.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/backbone.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/bootstrap.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.infieldlabel.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.hotkeys.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.ui.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/src/application.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/src/modules/site.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/src/modules/snipt.js"></script>
{% endcompress %}
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/ace/ace.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/ace/theme-tomorrow.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/ace/mode-javascript.js"></script>
<script type="text/javascript">{% block js %}window.user = '{{ request.user.username }}';
window.pub = {{ public|lower }};{% endblock %} </script>
<!--[if IE]>
<style type="text/css">
.group {
display: block;
zoom: 1;
}
</style>
<![endif]-->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body class="{% block body-class %}{% endblock %}">
<header class="main">
<div class="inner">
<div class="shadey"></div>
<h1><a href="/">Snipt</a></h1>
<form class="search" action="" method="get">
<fieldset>
<div class="fields infield">
<label for="search-query">Search public snipts</label>
<input type="text" id="search-query" name="q" value="" />
</div>
</fieldset>
</form>
<nav class="public">
<ul>
{% if not request.user.is_authenticated %}
<li>
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
</li>
<li>
<a href="/login/" {% if '/login/' in request.path %} class="active"{% endif %}>Log in</a>
</li>
<li>
<a href="/signup/" {% if '/signup/' in request.path %} class="active"{% endif %}>Sign up</a>
</li>
{% else %}
<li>
<a href="/" {% if request.user.username in request.path %} class="active"{% endif %}>My snipts</a>
</li>
<li>
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
</li>
<li>
<a href="/logout/">Log out</a>
</li>
{% endif %}
</ul>
</nav>
<aside class="nav"></aside>
</div>
</header>
{% block sub-header %}
<header class="sub">
<div class="inner group">
<ul class="bcrumb">
<li class="prompt">/</li>
{% block breadcrumb %}{% endblock %}
</ul>
<div class="shortcuts">
Type "h" for KB shortcuts
</div>
</div>
</header>
{% endblock %}
<section class="main group" id="main">
<div class="inner">
{% block content %}{% endblock %}
<div class="rochester-made">
<a href="http://rochestermade.com/" title="Rochester Made">
<img src="{{ STATIC_URL }}images/rochester-made.png" alt="" />
</a>
</div>
</div>
{% block aside %}
<aside class="main">
<section class="ad coffee">
<script type="text/javascript" src="http://adsbycoffee.appspot.com/partner.js?publisher=ag1zfmFkc2J5Y29mZmVlchALEglQdWJsaXNoZXIY-VUM"></script>
</section>
{% block tags %}{% endblock %}
<nav class="footer">
<ul>
<li class="api">
<a href="/api/">API</a>
</li>
<li class="twitter">
<a href="https://twitter.com/#!/snipt">@snipt</a>
</li>
<li class="twitter">
<a href="https://twitter.com/#!/nicksergeant">@nicksergeant</a>
</li>
</ul>
</nav>
</aside>
{% endblock %}
<div class="left-y ruler"></div>
<div class="right-y ruler"></div>
</section>
{% if snipts or snipt %}
<section class="main group hidden" id="main-edit"></section>
{% endif %}
<div class="modal hide" id="keyboard-shortcuts">
<div class="modal-header">
<a href="#" class="close">×</a>
<h3>Keyboard shortcuts</h3>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td>h</td>
<td>Show keyboard shortcuts</td>
</tr>
<tr>
<td>/</td>
<td>Focus search field</td>
</tr>
<tr>
<td>esc</td>
<td>Unfocus search field / deselect snipt</td>
</tr>
<tr>
<td>g</td>
<td>Scroll to top of page</td>
</tr>
<tr>
<td>G</td>
<td>Scroll to bottom of page</td>
</tr>
<tr>
<td>&lt;ctrl-h&gt;</td>
<td>Back</td>
</tr>
<tr>
<td>&lt;ctrl-l&gt;</td>
<td>Forward</td>
</tr>
<tr>
<td>t</td>
<td>Open new window/tab</td>
</tr>
<tr>
<td>r</td>
<td>Refresh page</td>
</tr>
<tr>
<td>n</td>
<td>Next page</td>
</tr>
<tr>
<td>p</td>
<td>Previous page</td>
</tr>
<tr>
<td>j</td>
<td>Next snipt</td>
</tr>
<tr>
<td>k</td>
<td>Previous snipt</td>
</tr>
<tr>
<td>o / return</td>
<td>Go to snipt</td>
</tr>
<tr>
<td>e</td>
<td>Expand / collapse snipt</td>
</tr>
<tr>
<td>v</td>
<td>Embed snipt</td>
</tr>
<tr>
<td>c</td>
<td>Copy snipt</td>
</tr>
<tr>
<td>&lt;ctrl-e&gt;</td>
<td>Edit snipt</td>
</tr>
</tbody>
</table>
</div>
</div>
{% if snipts or snipt %}
{% verbatim %}
<div class="hidden" id="templates">
<script id="snipt" type="text/html">
<div class="number">#<%= snipt.pk %></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 autumn">
<%= snipt.stylized %>
<% if (snipt.line_count > 8 && !window.detail) { %>
<a href="#" class="expand">
<span class="expand">Expand</span>
<span class="collapse">Collapse</span>
<span class="lines">(<%= snipt.line_count %> lines)</span>
</a>
<% } %>
<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.username === window.user) { %>
<li>
<a class="edit" href="#">Edit</a>
</li>
<% } %>
<li>
<a class="embed" href="#">Embed</a>
</li>
<li>
<a class="copy" href="#"><span class="do">Copy</span></a>
</li>
</ul>
<section class="tags">
<h2><%= snipt.tags.length %> tag<% if ((snipt.tags.length > 1) || (snipt.tags.length === 0)) { print('s'); } %></h2>
<ul>
<% for (var i=0; i < snipt.tags.length; i++) { %>
<li <% if (i > 2 && !window.detail) { %>class="hidden"<% } %>>
<a href="<%= snipt.tags[i].absolute_url %>"><%= snipt.tags[i].name %></a>
</li>
<% } %>
</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" title="<%= snipt.created %>"><%= snipt.created_formatted %></li>
<li class="comments"><a href="<%= snipt.get_absolute_url %>#disqus_thread" data-disqus-identifier="<%= snipt.pk %>"></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>
</script>
<script id="edit" type="text/html">
<div class="inner">
<section class="snipts" id="snipts">
<article id="snipt-<%= snipt.pk %>" class="snipt editing">
<div class="number">#<%= snipt.pk %></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">
<div id="editor"><%= snipt.code %></div>
</section>
<div class="ruler top-x"></div>
<div class="ruler bottom-x"></div>
</div>
</div>
</article>
</section>
</div>
<div class="left-y ruler"></div>
<div class="right-y ruler"></div>
</script>
</div>
{% endverbatim %}
{% endif %}
{% if not debug %}
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '4ed65ee7f5a1f530f1000001');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
{% else %}
<script type="text/javascript">
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')
</script>
{% endif %}
</body>
</html>