2016-11-01 09:59:35 -07:00
{% load snipt_tags static %}
2012-02-15 15:25:13 -08:00
2016-11-02 13:50:50 -07:00
{% signup_enabled as 'signup_is_enabled' %}
2011-06-01 21:50:18 -07:00
<!DOCTYPE html>
2013-05-08 21:38:24 -07:00
< html lang = "en" class = "{% block html-class %}{% endblock %}" ng-app = "Snipt" >
2011-06-01 21:50:18 -07:00
< head >
2011-10-23 19:44:37 -07:00
2019-01-21 15:21:25 -08:00
< title > {% block page-title %}Siftie Snippets{% endblock %} - Code snippet app for teams and individuals.< / title >
2013-02-13 20:42:54 -08:00
2014-04-22 06:30:03 -07:00
< meta charset = "utf-8" / >
< meta name = "google-site-verification" content = "BantFMmY6nSP8wFvb_SDKwYZo08HglaCpNMXQqTyOuk" / >
2013-02-13 20:42:54 -08:00
2014-04-22 06:30:03 -07:00
{% block page-description %}
2016-06-20 11:22:04 -07:00
< meta name = "description" content = "Code snippet app for teams and individuals." / >
2014-04-22 06:30:03 -07:00
{% endblock %}
2012-05-21 08:21:12 -07:00
2014-04-22 06:30:03 -07:00
{% if 'page' in request.GET %}
< meta name = "robots" content = "noindex, follow" / >
{% endif %}
2012-05-21 08:21:12 -07:00
2014-04-22 06:30:03 -07:00
{% if debug %}
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/bootstrap.min.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/style.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/themes.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/chosen.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/ambiance.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/blackboard.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/cobalt.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/eclipse.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/elegant.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/erlang-dark.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/lesser-dark.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/monokai.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/neat.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/night.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/rubyblue.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/solarized.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/twilight.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/vibrant-ink.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/codemirror-themes/xq-dark.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/highlightjs-themes/tomorrow.css" / >
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/blog-themes/default/style.css" / >
{% else %}
2016-11-03 07:32:53 -07:00
< link rel = "stylesheet" type = "text/css" href = "{{ STATIC_URL }}css/snipt.css?129" / >
2014-04-22 06:30:03 -07:00
{% endif %}
2012-02-18 11:42:30 -08:00
2014-04-22 06:30:03 -07:00
{% if has_snipts and not detail %}
< link rel = "alternate" type = "application/rss+xml" title = "RSS" href = "{{ request.path }}?rss{% if not public %}&api_key={{ request.user.api_key.key }}{% endif %}" / >
{% endif %}
2012-04-13 20:30:23 -07:00
2014-04-22 06:30:03 -07:00
{% block css %}{% endblock %}
2013-01-19 21:17:43 -08:00
2014-04-22 06:30:03 -07:00
<!-- [if IE]>
< style type = "text/css" >
.group {
display: block;
zoom: 1;
}
< / style >
<![endif]-->
2011-06-01 21:50:18 -07:00
2014-04-22 06:30:03 -07:00
<!-- [if lt IE 9]>
< script src = "https://html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
2011-06-01 21:50:18 -07:00
< / head >
2016-03-21 11:48:44 -07:00
< body class = "{% block body-class %}{% endblock %} is-pro" ng-controller = "AppController" >
2014-04-22 06:30:03 -07:00
{% block header %}
< header class = "main" >
< div class = "inner" >
< div class = "shadey" > < / div >
< h1 class = "main-logo" > < a href = "{% if request.user.is_authenticated %}/{{ request.user.username }}/{% else %}/{% endif %}" > snip< span > t< / span > < / a > < / h1 >
2015-10-24 17:55:58 -07:00
< form class = "search" action = "/search/" method = "get" >
2014-04-22 06:30:03 -07:00
< fieldset >
< div class = "fields" >
< input ng-model = "search.query" type = "text" class = "search-query" name = "q"
ng-init="search.query='{{ query|escapejs }}'"
2019-01-21 17:10:10 -08:00
placeholder="Search snippets" id="id_q"
2014-04-22 06:30:03 -07:00
value="{{ query }}" />
< / div >
< / fieldset >
< / form >
< nav class = "public" >
< ul >
{% if not request.user.is_authenticated %}
< li >
2019-01-21 17:10:10 -08:00
< a href = "/public/" { % if ' / public / ' in request . path or public % } class = "active" { % endif % } > Public snippets< / a >
2014-04-22 06:30:03 -07:00
< / li >
< li >
< a href = "/login/?next={{ request.path }}" { % if ' / login / ' in request . path % } class = "active" { % endif % } > Log in< / a >
< / li >
2016-11-02 13:50:50 -07:00
{% if signup_is_enabled %}
< li >
< a href = "/signup/" { % if ' / signup / ' in request . path % } class = "active" { % endif % } > Sign up< / a >
< / li >
{% endif %}
2014-04-22 06:30:03 -07:00
{% else %}
< li >
2019-01-21 17:10:10 -08:00
< a href = "/{{ request.user.username }}/" { % if request . user . username in request . path % } class = "active" { % endif % } > My snippets< / a >
2014-04-22 06:30:03 -07:00
< / li >
< li >
2019-01-21 17:10:10 -08:00
< a href = "/public/" { % if ' / public / ' in request . path or public % } class = "active" { % endif % } > Public snippets< / a >
2014-04-22 06:30:03 -07:00
< / li >
2014-05-04 19:47:15 -07:00
{% block add-snipt %}{% endblock %}
2014-04-22 06:30:03 -07:00
{% endif %}
2015-10-03 09:27:54 -07:00
{% if not request.user.is_authenticated %}
< li >
< a href = "/for-teams/" class = "{% if '/for-teams/' in request.path %}active{% endif %}" > Teams< / a >
< / li >
{% else %}
< li class = "teams-nav" >
< a href = "#" class = "teams-nav {% if '/for-teams/' in request.path %}active{% endif %}" > Teams< / a >
2015-10-18 21:41:24 -07:00
< ul >
2015-10-18 21:53:37 -07:00
{% if request.user.profile.has_teams %}
{% for team in request.user.profile.teams|dictsort:'name' %}
< li >
< a href = "/{{ team.user.username }}/" >
< i class = "icon-user icon-white" > < / i >
{{ team.name }}
< / a >
< / li >
{% endfor %}
{% endif %}
< li >
< a href = "/for-teams/" >
< i class = "icon-plus icon-white" > < / i >
Create new team
< / a >
< / li >
2015-10-18 21:41:24 -07:00
< / ul >
2015-10-03 09:27:54 -07:00
< / li >
{% endif %}
2014-04-22 06:30:03 -07:00
< / ul >
< / nav >
{% if request.user.is_authenticated %}
< aside class = "nav" >
< a href = "#" class = "mini-profile" >
< span class = "avatar" style = "background-image: url('https://secure.gravatar.com/avatar/{{ request.user.email|md5 }}?s=35');" > < / span >
< span class = "info" >
< span class = "username" > {{ request.user.username }}< / span >
< i class = "icon-cog icon-white" > < / i >
< span class = "type" >
2015-10-18 18:07:01 -07:00
{% if request.user.profile.has_pro %}
2014-04-22 06:30:03 -07:00
< span class = "is-pro" > Pro< / span >
{% else %}
2019-01-21 17:10:10 -08:00
Snippets user
2012-05-31 19:32:32 -07:00
{% endif %}
2014-04-22 06:30:03 -07:00
< / span >
< / span >
< / a >
< ul >
< li >
< a href = "/{{ request.user.username }}/" >
< i class = "icon-user icon-white" > < / i >
Profile
< / a >
< / li >
< li >
< a href = "/account/stats/" >
< i class = "icon-star icon-white" > < / i >
Stats
< / a >
< / li >
< li >
< a href = "/account/" >
< i class = "icon-cog icon-white" > < / i >
Account
< / a >
< / li >
{% if request.user.is_superuser %}
< li >
< a href = "/admin/" >
< i class = "icon-cog icon-white" > < / i >
Admin
< / a >
< / li >
{% endif %}
< li >
< a href = "/logout/?next={{ request.path }}" >
< i class = "icon-off icon-white" > < / i >
Log out
< / a >
< / li >
< / ul >
< / aside >
{% endif %}
< / div >
< / header >
{% endblock %}
{% block sub-header %}
< header class = "sub" >
< div class = "inner group" >
2014-04-30 09:35:20 -07:00
< ul class = "bcrumb group" >
2014-04-22 06:30:03 -07:00
< li class = "prompt" > /< / li >
{% block breadcrumb %}{% endblock %}
< / ul >
< div class = "shortcuts" >
Ctrl+h for KB shortcuts
< / div >
< / div >
< / header >
{% endblock %}
{% block main %}
< section class = "main group" id = "main" >
{% block aside %}
< aside class = "main" >
{% block aside-top %}{% endblock %}
{% block aside-inner %}{% endblock %}
< nav class = "footer" >
< ul >
< li class = "api" >
2016-11-03 08:11:11 -07:00
< a href = "https://github.com/nicksergeant/snipt/wiki/API-Docs" > < span > API Docs< / span > < / a >
2014-04-22 06:30:03 -07:00
< / li >
< li class = "blog" >
2016-11-03 08:11:11 -07:00
< a href = "https://github.com/nicksergeant/snipt/wiki/Blogging-Docs" > < span > Blogging Docs< / span > < / a >
2014-04-22 06:30:03 -07:00
< / li >
< li class = "roadmap" >
2016-11-02 13:37:03 -07:00
< a href = "https://github.com/nicksergeant/snipt/" > < span > GitHub Source< / span > < / a >
2014-04-22 06:30:03 -07:00
< / li >
< / ul >
< / nav >
< / aside >
2012-05-31 22:21:28 -07:00
{% endblock %}
2014-04-22 06:30:03 -07:00
< div class = "inner" >
{% block content %}{% endblock %}
< / div >
< div class = "left-y ruler" > < / div >
< div class = "right-y ruler" > < / div >
< / section >
{% endblock %}
{% block main-edit %}
< section class = "main group hidden" id = "main-edit" > < / section >
{% endblock %}
{% block keyboard-shortcuts %}
< div class = "modal hide" id = "keyboard-shortcuts" >
< div class = "modal-header" >
< a href = "#" class = "close" > × < / a >
< h3 > < span > Keyboard shortcuts< / span > < / 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 > < ctrl-h> < / td >
< td > Show / hide 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 > 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 >
< 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 > < ctrl-e> < / td >
< td > Edit snipt< / td >
< / tr >
< tr >
< td > < ctrl-delete> or < ctrl-backspace> < / td >
< td > Delete snipt< / td >
< / tr >
< tr >
< td > < ctrl-n> or < alt+n> < / td >
< td > Add new snipt< / td >
< / tr >
< tr >
< td > < ctrl-s> < / td >
< td > Save snipt< / td >
< / tr >
< tr >
< td > < ctrl-c> < / td >
< td > Save snipt and close< / td >
< / tr >
< tr >
< td > n< / td >
< td > Next page< / td >
< / tr >
< tr >
< td > p< / td >
< td > Previous page< / td >
< / tr >
< / tbody >
< / table >
< / div >
< / div >
{% endblock %}
2012-07-08 20:44:47 -07:00
2014-04-22 06:30:03 -07:00
{% block extra-scripts %}{% endblock %}
2013-02-10 20:15:53 -08:00
2014-04-22 06:30:03 -07:00
{% block inline-js %}
< script type = "text/javascript" >
{% block js %}
window.user = '{{ request.user.username }}';
window.user_id = {% firstof request.user.id 'null' %};
window.user_ip = '{{ request.META.REMOTE_ADDR }}';
window.user_profile_id = {% firstof request.user.profile.id 'null' %};
window.user_email = '{{ request.user.email }}';
2015-10-18 19:57:11 -07:00
window.teams = [
{% for team in request.user.profile.teams %}
'{{ team.slug }}',
{% endfor %}
]
2015-10-18 21:53:37 -07:00
window.intended_user = '{{ request.user.username }}';
2013-02-10 20:15:53 -08:00
2014-04-22 06:30:03 -07:00
{% if public %}
window.pub = {{ public|lower }};
{% else %}
window.pub = null;
{% endif %}
2013-02-10 20:15:53 -08:00
2014-04-22 06:30:03 -07:00
window.api_key = '{{ request.user.api_key.key }}';
2012-07-08 20:44:47 -07:00
{% endblock %}
2014-04-22 06:30:03 -07:00
window.default_editor = '{{ request.user.profile.get_default_editor_display|lower }}';
window.editor_theme = '{{ request.user.profile.editor_theme }}';
< / script >
{% endblock %}
2013-10-21 12:22:47 -07:00
2014-04-22 06:30:03 -07:00
{% if debug %}
2014-04-30 09:35:20 -07:00
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/jquery.min.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/jquery-ui.min.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/angular.min.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/angular-route.min.js" > < / script >
2014-04-22 06:30:03 -07:00
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/underscore.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.min.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.infieldlabel.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/plugins/jquery.chosen.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/codemirror.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/libs/highlight.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/src/application.js" > < / script >
2015-10-17 06:49:55 -07:00
< script type = "text/javascript" src = "{{ STATIC_URL }}js/src/team.js" > < / script >
2014-04-22 06:30:03 -07:00
< 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 >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/src/account.js" > < / script >
< script type = "text/javascript" src = "{{ STATIC_URL }}js/src/snipts.js" > < / script >
{% else %}
2016-11-02 06:30:33 -07:00
< script type = "text/javascript" src = "{{ STATIC_URL }}js/snipt-all.min.js?79" > < / script >
2014-04-22 06:30:03 -07:00
{% endif %}
{% if has_snipts and detail %}
< script > ! function ( d , s , id ) { var js , fjs = d . getElementsByTagName ( s ) [ 0 ] ; if ( ! d . getElementById ( id ) ) { js = d . createElement ( s ) ; js . id = id ; js . src = "//platform.twitter.com/widgets.js" ; fjs . parentNode . insertBefore ( js , fjs ) ; } } ( document , "script" , "twitter-wjs" ) ; < / script >
{% endif %}
{% block snipt-templates %}
< div class = "hidden" id = "templates" >
{% include 'snipts/snipt-js-template.html' %}
{% include 'snipts/snipt-edit-js-template.html' %}
< / div >
{% endblock %}
2014-12-31 19:49:50 -08:00
2015-07-17 10:47:20 -07:00
< script type = "text/javascript" > { % block analytics % } { % endblock % } < / script >
2015-07-17 10:46:02 -07:00
2014-04-22 06:30:03 -07:00
{% block preload %}
< div class = "hidden" >
< img src = "{{ STATIC_URL }}img/header-fixed-save.gif" alt = "" / >
< img src = "{{ STATIC_URL }}img/chosen-sprite.png" alt = "" / >
< img src = "{{ STATIC_URL }}img/aside-nav-open-bottom-bg.gif" alt = "" / >
< img src = "{{ STATIC_URL }}img/aside-nav-open-top-bg.gif" alt = "" / >
< / div >
{% endblock %}
2014-02-05 12:48:23 -08:00
2011-06-01 21:50:18 -07:00
< / body >
< / html >