snipt/snipt/templates/base.html

245 lines
9.7 KiB
HTML
Raw Normal View History

2011-06-01 21:50:18 -07:00
<!DOCTYPE html>
<html lang="en" class="{% block html-class %}{% endblock %}">
<head>
2011-10-23 19:44:37 -07:00
2011-06-01 21:50:18 -07:00
<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." />
2012-02-14 09:39:44 -08:00
<link rel="icon" href="{{ STATIC_URL }}images/favicon.ico">
2011-10-23 20:03:43 -07:00
{% if debug %}
2012-02-12 18:13:13 -08:00
<link rel="stylesheet" href="{{ STATIC_URL }}css/bootstrap.css" />
2012-02-10 19:38:59 -08:00
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" />
2012-02-12 18:13:13 -08:00
<link rel="stylesheet" href="{{ STATIC_URL }}css/themes.css" />
2011-10-23 21:01:44 -07:00
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/a_underscore.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/b_jquery.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/c_json2.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/d_backbone.js"></script>
2012-01-25 06:49:36 -08:00
<script type="text/javascript" src="{{ STATIC_URL }}js/libs/e_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>
2011-11-09 08:20:45 -08:00
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.ui.js"></script>
2011-11-06 08:12:05 -08:00
<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>
2011-10-23 20:03:43 -07:00
{% else %}
2011-10-23 21:01:44 -07:00
<link rel="stylesheet" href="{{ STATIC_URL }}cache/snipt.css" />
<script type="text/javascript" src="{{ STATIC_URL }}cache/snipt.js"></script>
2012-01-25 16:39:38 -08:00
{% endif %}{% block js %}{% endblock %}
2011-06-01 21:50:18 -07:00
<!--[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 %}">
2011-10-12 11:49:51 -07:00
<header class="main">
2011-10-06 13:58:46 -07:00
<div class="inner">
2011-10-10 20:30:56 -07:00
<div class="shadey"></div>
2011-10-06 13:58:46 -07:00
<h1><a href="/">Snipt</a></h1>
2012-02-14 08:39:45 -08:00
<form class="search" action="" method="get">
2011-10-10 20:30:56 -07:00
<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 %}
2012-02-12 21:42:25 -08:00
<li>
<a href="/public/" {% if '/public/' in request.path or public %} class="active"{% endif %}>Public snipts</a>
</li>
2011-10-10 20:30:56 -07:00
<li>
2012-02-12 18:13:13 -08:00
<a href="/login/" {% if '/login/' in request.path %} class="active"{% endif %}>Log in</a>
2011-10-10 20:30:56 -07:00
</li>
<li>
2012-02-12 18:13:13 -08:00
<a href="/signup/" {% if '/signup/' in request.path %} class="active"{% endif %}>Sign up</a>
2011-10-10 20:30:56 -07:00
</li>
2011-10-12 13:34:01 -07:00
{% else %}
<li>
<a href="/" {% if request.user.username in request.path %} class="active"{% endif %}>My snipts</a>
2011-10-12 13:34:01 -07:00
</li>
2012-02-12 21:42:25 -08:00
<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>
2011-10-10 20:30:56 -07:00
{% endif %}
</ul>
</nav>
<aside class="nav"></aside>
2011-10-06 13:58:46 -07:00
</div>
</header>
2012-02-12 18:13:13 -08:00
{% block sub-header %}
<header class="sub">
<div class="inner group">
<ul class="bcrumb">
<li class="prompt">/</li>
{% block breadcrumb %}{% endblock %}
</ul>
<div class="shortcuts">
2012-02-12 21:42:25 -08:00
Type "h" for KB shortcuts
2012-02-12 18:13:13 -08:00
</div>
2012-01-25 06:49:36 -08:00
</div>
2012-02-12 18:13:13 -08:00
</header>
{% endblock %}
2011-10-10 20:30:56 -07:00
<section class="main group">
<div class="inner">
{% block content %}{% endblock %}
</div>
2012-01-16 15:47:09 -08:00
{% block aside %}
<aside class="main">
2012-01-16 21:30:32 -08:00
<section class="ad">
<div class="asset">
<a href="http://www.adsbycoffee.org/">
2012-01-16 21:33:08 -08:00
<img src="https://snipt.s3.amazonaws.com/images/ad.png" alt="" />
2012-01-16 21:30:32 -08:00
Ads by Coffee is a non-profit advertising agency exclusively for charity organizations.
</a>
</div>
<div class="meta">
<a href="http://www.adsbycoffee.org/">Ads by Coffee</a>
</div>
</section>
2012-01-16 15:47:09 -08:00
{% 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 %}
2011-10-13 10:30:44 -07:00
<div class="left-y ruler"></div>
<div class="right-y ruler"></div>
2011-10-06 13:58:46 -07:00
</section>
2012-01-25 06:49:36 -08:00
<div class="modal hide" id="keyboard-shortcuts">
<div class="modal-header">
2012-01-25 16:39:38 -08:00
<a href="#" class="close">×</a>
<h3>Keyboard shortcuts</h3>
2012-01-25 06:49:36 -08:00
</div>
<div class="modal-body">
2012-01-25 16:39:38 -08:00
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
2012-02-12 21:42:25 -08:00
<td>h</td>
2012-01-25 16:39:38 -08:00
<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>
2012-02-14 21:49:55 -08:00
<tr>
<td>&lt;ctrl-h&gt;</td>
<td>Back</td>
</tr>
<tr>
<td>&lt;ctrl-l&gt;</td>
<td>Forward</td>
</tr>
<tr>
<td>H</td>
<td>Go home</td>
</tr>
<tr>
<td>t</td>
<td>Open new window/tab</td>
</tr>
<tr>
<td>r</td>
<td>Refresh page</td>
</tr>
2012-01-25 16:39:38 -08:00
<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>
</tbody>
</table>
2012-01-25 06:49:36 -08:00
</div>
</div>
2011-06-01 21:50:18 -07:00
{% if not debug %}
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-514462-44']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
//]]>
</script>
2012-02-14 13:40:15 -08:00
{% else %}
<script type="text/javascript">
//<![CDATA[
document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')
//]]>
</script>
2011-06-01 21:50:18 -07:00
{% endif %}
</body>
</html>