Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

87 lines (78 sloc) 2.908 kb
<!DOCTYPE html>
<title>Snippets for {{username}}</title>
<link rel="stylesheet" type="text/css" href="javascript/snippets.css">
{% include "header.html" %}
<h2>Snippets for {{username}}</h2>
{% for snippet in snippets %}
<div class="snippet">
{% if editable %}
<form action="/update_snippet" method="get">
<h3>Snippets for the week starting {{snippet.week|readable_date}}
&nbsp; <input type="submit" value="Save" class="save-button">
&nbsp; <button class="undo-button">undo</button>
{% if snippet.text == null_snippet_text and snippet.week == one_week_ago %}
<font color="red" size="-1">Due today!</font>
{% endif %}
{% if snippet.text == null_snippet_text and snippet.week == eight_days_ago %}
<font color="red" size="-1">OVERDUE!</font>
{% endif %}
<input type="hidden" name="week" value="{{snippet.week|iso_date}}">
<input type="hidden" name="u" value="{{username}}">
{% if snippet.text == null_snippet_text and user.category == null_category %}
<font color="red" size="-1">
WARNING: Snippet will go in the "{{null_category}}" category.
<a href="/settings?msg=Set+'Category'+below,+then+click+'Save.'&redirect_to=snippet_entry"
>Set your snippet category!</a>
{% endif %}
<input type="checkbox" name="private" value="True"
{% if snippet.private %}checked{% endif %}>
Make snippet private (only viewable by people in the domain <i>{{domain}}</i>)
<input type="checkbox" name="is_markdown" value="True"
{% if snippet.is_markdown %}checked{% endif %}>
Snippet is written in <a href="">markdown syntax</a>
<textarea name="snippet" rows="6" cols="80">{{snippet.text}}</textarea>
<div class="markdown_preview" style="display:none">
<div class="markdown_snippet"></div>
{% else %}
<h3>Snippets for the week starting {{snippet.week|readable_date}}</h3>
{% if snippet.is_markdown %}
<div class="markdown_snippet
{% if snippet.private %}private_snippet{% endif %}"
{% else %}
<div class="text_snippet
{% if snippet.private %}private_snippet{% endif %}"
{% endif %}
{% endif %}
{% endfor %}
<script src="javascript/jquery-1.8.2.js"></script>
<script src="javascript/snippets.js"></script>
<script src="javascript/marked/marked.min.js"></script>
marked.setOptions({sanitize: true});
$(".markdown_snippet").each(function(i, v) {
v.innerHTML = marked(v.innerHTML);
Jump to Line
Something went wrong with that request. Please try again.