snipt/templates/base.html

339 lines
14 KiB
HTML
Raw Normal View History

2012-04-16 15:52:49 -07:00
{% load compress snipt_tags %}
2012-02-15 15:25:13 -08:00
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-05-21 08:21:12 -07:00
{% block meta %}{% endblock %}
2012-02-14 09:39:44 -08:00
<link rel="icon" href="{{ STATIC_URL }}images/favicon.ico">
2011-10-23 21:01:44 -07:00
2012-03-05 13:38:37 -08:00
{% compress css %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css" />
2012-04-08 16:15:11 -07:00
<link rel="stylesheet" type="text/x-scss" href="{{ STATIC_URL }}css/style.scss" />
2012-03-05 13:38:37 -08:00
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/themes.css" />
2012-03-12 17:18:44 -07:00
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/chosen.css" />
2012-03-05 13:38:37 -08:00
{% endcompress %}
{% compress js %}
2012-02-26 15:59:15 -08:00
<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.hotkeys.js"></script>
2012-03-12 17:18:44 -07:00
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.infieldlabel.js"></script>
2011-11-09 08:20:45 -08:00
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.ui.js"></script>
2012-03-12 21:00:26 -07:00
<script type="text/javascript" src="{{ STATIC_URL }}js/plugins/jquery.chosen.js"></script>
2012-02-26 15:59:15 -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>
2012-03-05 13:38:37 -08:00
{% endcompress %}
2012-03-05 13:38:37 -08:00
<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>
2012-04-09 10:57:27 -07:00
{% block inline-js %}
<script type="text/javascript">{% block js %}window.user = '{{ request.user.username }}';
2012-04-22 20:03:50 -07:00
{% if public %}
window.pub = {{ public|lower }};
{% else %}
window.pub = null;
{% endif %}
2012-03-20 20:00:49 -07:00
window.api_key = '{{ request.user.api_key.key }}';{% endblock %} </script>
2012-04-09 10:57:27 -07:00
{% endblock %}
2012-02-18 11:42:30 -08:00
2012-04-13 20:30:23 -07:00
{% if has_snipts and not detail %}
2012-05-14 21:19:35 -07:00
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ request.path }}?rss{% if not public %}&api_key={{ request.user.api_key.key }}{% endif %}" />
2012-04-13 20:30:23 -07:00
{% endif %}
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]>
2012-04-23 18:41:16 -07:00
<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
2011-06-01 21:50:18 -07:00
<![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>
2012-03-19 07:23:14 -07:00
<h1><a href="{% if request.user.is_authenticated %}/{{ request.user.username }}/{% else %}/{% endif %}">Snipt</a></h1>
2012-04-22 18:47:49 -07:00
<form class="search" action="/search/" method="get">
2011-10-10 20:30:56 -07:00
<fieldset>
2012-04-22 20:03:50 -07:00
<div class="fields">
<input type="text" id="search-query" name="q" value="{{ query }}" placeholder="Search snipts" />
2011-10-10 20:30:56 -07:00
</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-05-08 10:37:37 -07:00
<a href="/login/?next={{ request.path }}" {% 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="/{{ request.user.username }}/" {% 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>
2012-05-08 10:37:37 -07:00
<a href="/logout/?next={{ request.path }}">Log out</a>
2012-02-12 21:42:25 -08:00
</li>
2012-05-15 18:09:32 -07:00
{% if request.user.username == 'blog' %}
<li><button class="btn btn-info btn-large" id="add-snipt">Add Post <i class="icon-search icon-plus icon-white"></i></button></li>
{% else %}
<li><button class="btn btn-info btn-large" id="add-snipt">Add Snipt <i class="icon-search icon-plus icon-white"></i></button></li>
{% endif %}
2011-10-10 20:30:56 -07:00
{% endif %}
</ul>
</nav>
2012-04-07 19:38:26 -07:00
{% if request.user.is_authenticated and has_snipts %}
2012-04-13 13:51:18 -07:00
<aside class="nav"></aside>
2012-04-07 18:38:34 -07:00
{% endif %}
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 %}
<section class="main group" id="main">
2011-10-10 20:30:56 -07:00
<div class="inner">
{% block content %}{% endblock %}
2012-02-20 09:10:48 -08:00
<div class="rochester-made">
<a href="http://rochestermade.com/" title="Rochester Made">
<img src="{{ STATIC_URL }}images/rochester-made.png" alt="" />
</a>
</div>
2011-10-10 20:30:56 -07:00
</div>
2012-01-16 15:47:09 -08:00
{% block aside %}
<aside class="main">
<nav class="footer">
<ul>
<li class="api">
2012-05-15 18:13:28 -07:00
<a href="/api/" {% if '/api/' in request.path %}class="active"{% endif %}>API</a>
2012-01-16 15:47:09 -08:00
</li>
2012-05-16 18:44:26 -07:00
<li class="blog">
2012-05-15 18:13:28 -07:00
<a href="/blog/" {% if '/blog/' in request.path %}class="active"{% endif %}>Blog</a>
2012-05-14 21:45:09 -07:00
</li>
2012-05-22 12:12:49 -07:00
<li class="roadmap">
<a href="/todo/" {% if '/todo/' in request.path %}class="active"{% endif %}>Roadmap</a>
</li>
2012-01-16 15:47:09 -08:00
<li class="twitter">
<a href="https://twitter.com/#!/snipt">@snipt</a>
</li>
</ul>
</nav>
2012-05-15 18:09:32 -07:00
{% block tags %}{% endblock %}
2012-01-16 15:47:09 -08:00
</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-04-09 10:57:27 -07:00
<section class="main group hidden" id="main-edit"></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>
2012-05-24 19:20:06 -07:00
<h3><span>Keyboard shortcuts</span></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>
<td>Show / hide keyboard shortcuts</td>
2012-01-25 16:39:38 -08:00
</tr>
<tr>
<td>/</td>
<td>Focus search field</td>
</tr>
<tr>
<td>esc</td>
<td>Unfocus search field / deselect snipt</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>u</td>
<td>Go to snipt's author</td>
</tr>
2012-01-25 16:39:38 -08:00
<tr>
2012-02-17 10:14:57 -08:00
<td>e</td>
2012-01-25 16:39:38 -08:00
<td>Expand / collapse snipt</td>
</tr>
<tr>
<td>v</td>
<td>Embed snipt</td>
</tr>
<tr>
<td>c</td>
<td>Copy snipt</td>
</tr>
2012-02-15 20:06:11 -08:00
<tr>
2012-02-17 10:14:57 -08:00
<td>&lt;ctrl-e&gt;</td>
2012-02-15 20:06:11 -08:00
<td>Edit snipt</td>
</tr>
<tr>
<td>&lt;ctrl-delete&gt; or &lt;ctrl-backspace&gt;</td>
<td>Delete snipt</td>
</tr>
<tr>
<td>&lt;ctrl-n&gt;</td>
<td>Add new snipt</td>
</tr>
<tr>
<td>&lt;ctrl-s&gt;</td>
<td>Save snipt</td>
</tr>
<tr>
<td>&lt;ctrl-c&gt;</td>
<td>Save snipt and close</td>
</tr>
2012-05-15 17:39:36 -07:00
<tr>
<td>n</td>
<td>Next page</td>
</tr>
<tr>
<td>p</td>
<td>Previous page</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>
2012-01-25 16:39:38 -08:00
</tbody>
</table>
2012-01-25 06:49:36 -08:00
</div>
</div>
2012-04-09 10:57:27 -07:00
<div class="hidden" id="templates">
{% include 'snipts/snipt-js-template.html' %}
{% include 'snipts/snipt-edit-js-template.html' %}
</div>
2011-06-01 21:50:18 -07:00
{% if not debug %}
2012-04-16 15:52:49 -07:00
<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>
2012-02-14 13:40:15 -08:00
{% else %}
2012-02-29 15:49:05 -08:00
<script type="text/javascript">
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 %}
2012-04-04 14:35:38 -07:00
{% if request.user.is_authenticated %}
2012-04-16 15:52:49 -07:00
{% if not debug %}
<script id="IntercomSettingsScriptTag">
var intercomSettings = {
app_id: 'sajf131y',
email: '{{ request.user.email }}',
created_at: {{ request.user.date_joined|date:"U" }},
widget: {
activator: '#IntercomDefaultWidget',
label: 'Support Chat'
},
custom_data: {
'snipts count': {% snipts_count_for_user %},
2012-04-23 18:41:16 -07:00
'profile link': 'https://snipt.net/{{ request.user.username }}/'
2012-04-16 15:52:49 -07:00
}
};
</script>
<script>
(function() {
function async_load() {
var s = document.createElement('script');
s.type = 'text/javascript'; s.async = true;
s.src = 'https://api.intercom.io/api/js/library.js';
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
if (window.attachEvent) {
window.attachEvent('onload', async_load);
} else {
window.addEventListener('load', async_load, false);
}
})();
</script>
{% endif %}
2012-04-04 14:35:38 -07:00
{% endif %}
2012-05-03 18:12:08 -07:00
<div class="hidden">
<img src="{{ STATIC_URL }}images/header-fixed-save.gif" alt="" />
<img src="{{ STATIC_URL }}images/chosen-sprite.png" alt="" />
</div>
2011-06-01 21:50:18 -07:00
</body>
</html>