Skip to content

HTTPS clone URL

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>
<html>
<head>
<title>Snippets for {{username}}</title>
<link rel="stylesheet" type="text/css" href="javascript/snippets.css">
</head>
<body>
{% 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 %}
</h3>
<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.
</font>
<a href="/settings?msg=Set+'Category'+below,+then+click+'Save.'&redirect_to=snippet_entry"
>Set your snippet category!</a>
<br>
{% endif %}
<label>
<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>)
</label>
<br>
<label>
<input type="checkbox" name="is_markdown" value="True"
{% if snippet.is_markdown %}checked{% endif %}>
Snippet is written in <a href="http://daringfireball.net/projects/markdown/syntax">markdown syntax</a>
</label>
<br>
<textarea name="snippet" rows="6" cols="80">{{snippet.text}}</textarea>
<div class="markdown_preview" style="display:none">
<i>Preview:</i>
<blockquote>
<div class="markdown_snippet"></div>
</blockquote>
</div>
</form>
{% 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 %}"
>{{snippet.text|safe}}</div>
{% else %}
<div class="text_snippet
{% if snippet.private %}private_snippet{% endif %}"
>{{snippet.text|urlize}}</div>
{% endif %}
{% endif %}
</div>
{% endfor %}
<script src="javascript/jquery-1.8.2.js"></script>
<script src="javascript/snippets.js"></script>
<script src="javascript/marked/marked.min.js"></script>
<script>
marked.setOptions({sanitize: true});
$(".markdown_snippet").each(function(i, v) {
v.innerHTML = marked(v.innerHTML);
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.