Spaces to tabs in HTML and CSS

pull/2/head
Noah 2015-08-11 17:39:16 -07:00
parent 0c71bc456b
commit 4b6be02e5a
47 changed files with 1314 additions and 1314 deletions

View File

@ -8,15 +8,15 @@
<form action="{{ url_for('account.login') }}" method="POST"> <form action="{{ url_for('account.login') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<legend>Log In</legend> <legend>Log In</legend>
<strong>Username:</strong><br> <strong>Username:</strong><br>
<input type="text" class="form-control" size="20" name="username" id="username"><p> <input type="text" class="form-control" size="20" name="username" id="username"><p>
<strong>Passphrase:</strong><br> <strong>Passphrase:</strong><br>
<input type="password" class="form-control" size="20" name="password"><p> <input type="password" class="form-control" size="20" name="password"><p>
<button type="submit" class="btn btn-primary">Log In</button> <button type="submit" class="btn btn-primary">Log In</button>
</fieldset> </fieldset>
</form> </form>

View File

@ -15,27 +15,27 @@ to create the initial Administrator user account.<p>
<form id="setup_form" action="{{ url_for('account.setup') }}" method="POST"> <form id="setup_form" action="{{ url_for('account.setup') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<legend>Admin User</legend> <legend>Admin User</legend>
Your site needs at least one admin user to log in and manage the site. Your site needs at least one admin user to log in and manage the site.
You can use any username/password combination you want, but "admin" is You can use any username/password combination you want, but "admin" is
a typical username.<p> a typical username.<p>
<strong>Username:</strong><br> <strong>Username:</strong><br>
<input type="text" class="form-control" size="40" name="username" id="username" placeholder="admin"><p> <input type="text" class="form-control" size="40" name="username" id="username" placeholder="admin"><p>
<strong>Real name:</strong><br> <strong>Real name:</strong><br>
<input type="text" class="form-control" size="40" name="name" placeholder="John Doe"><p> <input type="text" class="form-control" size="40" name="name" placeholder="John Doe"><p>
<strong>Passphrase:</strong><br> <strong>Passphrase:</strong><br>
This can be as long as you want. Pick something This can be as long as you want. Pick something
<a href="http://xkcd.com/936/" target="_blank">secure!</a><br> <a href="http://xkcd.com/936/" target="_blank">secure!</a><br>
<input type="password" class="form-control" size="40" id="pw1" name="password1" placeholder="correct horse battery staple"><p> <input type="password" class="form-control" size="40" id="pw1" name="password1" placeholder="correct horse battery staple"><p>
<strong>Confirm Passphrase:</strong><br> <strong>Confirm Passphrase:</strong><br>
<input type="password" class="form-control" size="40" id="pw2" name="password2" placeholder="correct horse battery staple"><p> <input type="password" class="form-control" size="40" id="pw2" name="password2" placeholder="correct horse battery staple"><p>
<button type="submit" class="btn btn-primary">Next</button> <button type="submit" class="btn btn-primary">Next</button>
</fieldset> </fieldset>
</form> </form>

View File

@ -4,9 +4,9 @@
{% block scripts %} {% block scripts %}
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$("#delete_button").click(function() { $("#delete_button").click(function() {
return window.confirm("Are you sure?"); return window.confirm("Are you sure?");
}); });
}); });
</script> </script>
{% endblock %} {% endblock %}
@ -18,26 +18,26 @@ $(document).ready(function() {
<form action="{{ url_for('admin.edit_user', uid=info['uid']) }}" method="POST"> <form action="{{ url_for('admin.edit_user', uid=info['uid']) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<legend>User Details</legend> <legend>User Details</legend>
<strong>Username:</strong><br> <strong>Username:</strong><br>
<input type="text" class="form-control" size="20" name="username" value="{{ info['username'] }}"><p> <input type="text" class="form-control" size="20" name="username" value="{{ info['username'] }}"><p>
<strong>Real name:</strong><br> <strong>Real name:</strong><br>
<input type="text" class="form-control" size="20" name="name" value="{{ info['name'] }}"><p> <input type="text" class="form-control" size="20" name="name" value="{{ info['name'] }}"><p>
<strong>Reset Password:</strong><br> <strong>Reset Password:</strong><br>
<input type="password" class="form-control" size="20" name="password1"><br> <input type="password" class="form-control" size="20" name="password1"><br>
<input type="password" class="form-control" size="20" name="password2"><p> <input type="password" class="form-control" size="20" name="password2"><p>
<strong>Role:</strong><br> <strong>Role:</strong><br>
<select name="role" class="form-control"> <select name="role" class="form-control">
<option value="user"{% if info["role"] == "user" %} selected{% endif %}>User</option> <option value="user"{% if info["role"] == "user" %} selected{% endif %}>User</option>
<option value="admin"{% if info["role"] == "admin" %} selected{% endif %}>Admin</option> <option value="admin"{% if info["role"] == "admin" %} selected{% endif %}>Admin</option>
</select><p> </select><p>
<button type="submit" class="btn btn-primary" name="action" value="save">Save Changes</button> <button type="submit" class="btn btn-primary" name="action" value="save">Save Changes</button>
<button type="submit" class="btn btn-warning" name="action" id="delete_button" value="delete">Delete User</button> <button type="submit" class="btn btn-warning" name="action" id="delete_button" value="delete">Delete User</button>
</fieldset> </fieldset>
</form> </form>

View File

@ -6,14 +6,14 @@
<h1>Admin Center</h1> <h1>Admin Center</h1>
<ul> <ul>
<li><a href="{{ url_for('admin.users') }}">View and Manage Users</a></li> <li><a href="{{ url_for('admin.users') }}">View and Manage Users</a></li>
</ul> </ul>
<h1>Maintenance Tasks</h1> <h1>Maintenance Tasks</h1>
<ul> <ul>
<li><a href="{{ url_for('admin.rebuild_blog_index') }}">Rebuild Blog Index</a></li> <li><a href="{{ url_for('admin.rebuild_blog_index') }}">Rebuild Blog Index</a></li>
<li><a href="{{ url_for('admin.rebuild_visitor_counts') }}">Rebuild Visitor Counts</a></li> <li><a href="{{ url_for('admin.rebuild_visitor_counts') }}">Rebuild Visitor Counts</a></li>
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -10,59 +10,59 @@
<form action="{{ url_for('admin.create_user') }}" method="POST"> <form action="{{ url_for('admin.create_user') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<legend>Create New User</legend> <legend>Create New User</legend>
<strong>Username:</strong><br> <strong>Username:</strong><br>
<input type="text" class="form-control" size="40" name="username" placeholder="soandso"><p> <input type="text" class="form-control" size="40" name="username" placeholder="soandso"><p>
<strong>Real name:</strong><br> <strong>Real name:</strong><br>
<input type="text" class="form-control" size="40" name="name" placeholder="John Smith"><p> <input type="text" class="form-control" size="40" name="name" placeholder="John Smith"><p>
<strong>Passphrase:</strong><br> <strong>Passphrase:</strong><br>
<input type="password" class="form-control" size="40" name="password1" placeholder="correct horse battery staple"><p> <input type="password" class="form-control" size="40" name="password1" placeholder="correct horse battery staple"><p>
<strong>Confirm:</strong><br> <strong>Confirm:</strong><br>
<input type="password" class="form-control" size="40" name="password2" placeholder="correct horse battery staple"><p> <input type="password" class="form-control" size="40" name="password2" placeholder="correct horse battery staple"><p>
<strong>Role:</strong><br> <strong>Role:</strong><br>
<select name="role" class="form-control"> <select name="role" class="form-control">
<option value="user" selected>User</option> <option value="user" selected>User</option>
<option value="admin">Admin</option> <option value="admin">Admin</option>
</select> </select>
<button type="submit" class="btn btn-primary">Create</button> <button type="submit" class="btn btn-primary">Create</button>
</fieldset> </fieldset>
<h2>User List</h2> <h2>User List</h2>
<table class="table table-wide"> <table class="table table-wide">
<thead> <thead>
<tr> <tr>
<th width="100">User ID</th> <th width="100">User ID</th>
<th width="300">Username</th> <th width="300">Username</th>
<th>Real name</th> <th>Real name</th>
<th width="100">Role</th> <th width="100">Role</th>
<th width="100">Log in</th> <th width="100">Log in</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for user in users %} {% for user in users %}
<tr> <tr>
<td>{{ user["uid"] }}</td> <td>{{ user["uid"] }}</td>
<td><a href="{{ url_for('admin.edit_user', uid=user['uid']) }}">{{ user["username"] }}</a></td> <td><a href="{{ url_for('admin.edit_user', uid=user['uid']) }}">{{ user["username"] }}</a></td>
<td>{{ user["name"] }}</td> <td>{{ user["name"] }}</td>
<td>{{ user["role"] }}</td> <td>{{ user["role"] }}</td>
<td> <td>
{% if user["role"] != "admin" %} {% if user["role"] != "admin" %}
<a href="{{ url_for('admin.impersonate', uid=user['uid']) }}">Log in as</a> <a href="{{ url_for('admin.impersonate', uid=user['uid']) }}">Log in as</a>
{% else %} {% else %}
n/a n/a
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% endblock %} {% endblock %}

View File

@ -3,16 +3,16 @@
{% block content %} {% block content %}
{% for date in archive %} {% for date in archive %}
<h1>{{ date["month_friendly"] }}</h1> <h1>{{ date["month_friendly"] }}</h1>
<ul> <ul>
{% for post in date["posts"] %} {% for post in date["posts"] %}
<li> <li>
<a href="{{ url_for('blog.entry', fid=post['fid']) }}">{{ post["subject"] }}</a> <a href="{{ url_for('blog.entry', fid=post['fid']) }}">{{ post["subject"] }}</a>
&mdash; <em>{{ post['pretty_time'] }} by {{ post['profile']['name'] }}</em> &mdash; <em>{{ post['pretty_time'] }} by {{ post['profile']['name'] }}</em>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}

View File

@ -1,19 +1,19 @@
{% for tag in tags %} {% for tag in tags %}
{% if not tag["small"] %} {% if not tag["small"] %}
&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a> &#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small><br> <small>({{ tag['count'] }})</small><br>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if has_small %} {% if has_small %}
<div id="blog_show_more" style="display: none"> <div id="blog_show_more" style="display: none">
{% for tag in tags %} {% for tag in tags %}
{% if tag["small"] %} {% if tag["small"] %}
&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a> &#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small><br> <small>({{ tag['count'] }})</small><br>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
<div id="blog_show_less" style="display: block"> <div id="blog_show_less" style="display: block">
&#0164; <a href="#" onClick="$('#blog_show_less').hide(); $('#blog_show_more').show(1000); return false">Show more...</a> &#0164; <a href="#" onClick="$('#blog_show_less').hide(); $('#blog_show_more').show(1000); return false">Show more...</a>
</div> </div>
{% endif %} {% endif %}

View File

@ -5,13 +5,13 @@
<h1>Delete Entry</h1> <h1>Delete Entry</h1>
<form name="editor" action="{{ url_for('blog.delete', id=post_id) }}" method="POST"> <form name="editor" action="{{ url_for('blog.delete', id=post_id) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="confirm" value="true"> <input type="hidden" name="confirm" value="true">
Are you sure you want to delete the blog post, Are you sure you want to delete the blog post,
"{{ subject }}"?<p> "{{ subject }}"?<p>
<button type="submit" class="btn btn-warning">Confirm Deletion</button> <button type="submit" class="btn btn-warning">Confirm Deletion</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -3,92 +3,92 @@
{% macro blog_entry(post, from=None) %} {% macro blog_entry(post, from=None) %}
{% if from == "index" %} {% if from == "index" %}
<a href="{{ url_for('blog.entry', fid=post['fid']) }}" class="blog-title-index"> <a href="{{ url_for('blog.entry', fid=post['fid']) }}" class="blog-title-index">
{{ post["subject"] }} {{ post["subject"] }}
</a><p> </a><p>
{% else %} {% else %}
{% include "blog/sibling-links.html" %} {% include "blog/sibling-links.html" %}
<p> <p>
{% endif %} {% endif %}
<div class="blog-author"> <div class="blog-author">
{% if post["avatar"] %} {% if post["avatar"] %}
<img src="/static/avatars/{{ post['avatar'] }}" alt="{{ post['profile']['name'] }}" width="96" height="96"> <img src="/static/avatars/{{ post['avatar'] }}" alt="{{ post['profile']['name'] }}" width="96" height="96">
{% elif post["photo"] %} {% elif post["photo"] %}
<img src="{{ post['photo_url'] }}/{{ post['photo'] }}" alt="{{ post['profile']['name'] }}" width="96" height="96"> <img src="{{ post['photo_url'] }}/{{ post['photo'] }}" alt="{{ post['profile']['name'] }}" width="96" height="96">
{% else %} {% else %}
<img src="/static/avatars/default.png" alt="{{ post['profile']['name'] }}" width="96" height="96"> <img src="/static/avatars/default.png" alt="{{ post['profile']['name'] }}" width="96" height="96">
{% endif %} {% endif %}
<div>{{ post["profile"]["username"] }}</div> <div>{{ post["profile"]["username"] }}</div>
</div> </div>
<div class="blog-timestamp"> <div class="blog-timestamp">
Posted by {{ post["profile"]["name"] }} Posted by {{ post["profile"]["name"] }}
on <span title="{{ post['time'] }}">{{ post["pretty_time"] }}</span> on <span title="{{ post['time'] }}">{{ post["pretty_time"] }}</span>
</div> </div>
{{ post["rendered_body"] | safe }} {{ post["rendered_body"] | safe }}
{% if post["snipped"] %} {% if post["snipped"] %}
<p> <p>
<a href="{{ url_for('blog.entry', fid=post['fid']) }}">Read more...</a> <a href="{{ url_for('blog.entry', fid=post['fid']) }}">Read more...</a>
{% endif %} {% endif %}
<p> <p>
<div class="clear"> <div class="clear">
<strong>Categories:</strong> <strong>Categories:</strong>
{% if post["categories"]|length == 0 or (post["categories"]|length == 1 and post["categories"][0] == "") %} {% if post["categories"]|length == 0 or (post["categories"]|length == 1 and post["categories"][0] == "") %}
<a href="{{ url_for('blog.category', category=settings().blog.default_category) }}"> <a href="{{ url_for('blog.category', category=settings().blog.default_category) }}">
{{ settings().blog.default_category }} {{ settings().blog.default_category }}
</a> </a>
{% else %} {% else %}
<ul class="blog-categories"> <ul class="blog-categories">
{% for tag in post["categories"] %} {% for tag in post["categories"] %}
<li><a href="{{ url_for('blog.category', category=tag) }}">{{ tag }}</a></li> <li><a href="{{ url_for('blog.category', category=tag) }}">{{ tag }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
<p> <p>
[ [
{% if from == "index" %} {% if from == "index" %}
{% if post["comments"] %}{# Allowed comments #} {% if post["comments"] %}{# Allowed comments #}
<a href="{{ url_for('blog.entry', fid=post['fid']) }}#comments">{{ post["comment_count"] }} comment{% if post["comment_count"] != 1 %}s{% endif %}</a> <a href="{{ url_for('blog.entry', fid=post['fid']) }}#comments">{{ post["comment_count"] }} comment{% if post["comment_count"] != 1 %}s{% endif %}</a>
| |
<a href="{{ url_for('blog.entry', fid=post['fid']) }}#addcomment">Add comment</a> <a href="{{ url_for('blog.entry', fid=post['fid']) }}#addcomment">Add comment</a>
| |
{% endif %} {% endif %}
<a href="{{ url_for('blog.entry', fid=post['fid']) }}">Permalink</a> <a href="{{ url_for('blog.entry', fid=post['fid']) }}">Permalink</a>
{% else %} {% else %}
<a href="{{ url_for('blog.index') }}">Blog</a> <a href="{{ url_for('blog.index') }}">Blog</a>
{% endif %} {% endif %}
{% if session["login"] %} {% if session["login"] %}
| |
<a href="{{ url_for('blog.update', id=post['post_id']) }}">Edit</a> <a href="{{ url_for('blog.update', id=post['post_id']) }}">Edit</a>
| |
<a href="{{ url_for('blog.delete', id=post['post_id']) }}">Delete</a> <a href="{{ url_for('blog.delete', id=post['post_id']) }}">Delete</a>
{% endif %} {% endif %}
] ]
</div> </div>
<p> <p>
{# Show the Google ad after the first post. #} {# Show the Google ad after the first post. #}
{% if from == "index" and post["position_index"] == 1 %} {% if from == "index" and post["position_index"] == 1 %}
{{ leaderboard() }} {{ leaderboard() }}
{% endif %} {% endif %}
{% if from != "index" %} {% if from != "index" %}
{% include "blog/sibling-links.html" %} {% include "blog/sibling-links.html" %}
<p> <p>
{{ include_page("comment.partial_index", {{ include_page("comment.partial_index",
thread="blog-"+post["post_id"]|string, thread="blog-"+post["post_id"]|string,
subject=post["subject"], subject=post["subject"],
addable=post["comments"], addable=post["comments"],
) | safe }} ) | safe }}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}

View File

@ -3,9 +3,9 @@
{% block content %} {% block content %}
{% if url_category %} {% if url_category %}
<h1>Category: {{ url_category }}</h1> <h1>Category: {{ url_category }}</h1>
{% else %} {% else %}
<h1>My Blog</h1> <h1>My Blog</h1>
{% endif %} {% endif %}
{{ include_page("blog.partial_index") | safe }} {{ include_page("blog.partial_index") | safe }}

View File

@ -3,11 +3,11 @@
{% include "blog/nav-links.inc.html" %} {% include "blog/nav-links.inc.html" %}
{% if count == 0 %} {% if count == 0 %}
There are no blog posts yet. There are no blog posts yet.
{% else %} {% else %}
{% for post in posts %} {% for post in posts %}
{{ blog_entry(post, from="index") }} {{ blog_entry(post, from="index") }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% include "blog/nav-links.inc.html" %} {% include "blog/nav-links.inc.html" %}

View File

@ -1,27 +1,27 @@
{# Older/Newer links #} {# Older/Newer links #}
{% if can_older or can_newer %} {% if can_older or can_newer %}
<div class="right"> <div class="right">
[ [
<a href="{{ url_for('blog.rss') }}">RSS Feed</a> | <a href="{{ url_for('blog.rss') }}">RSS Feed</a> |
{% if can_earlier %} {% if can_earlier %}
{% if category %} {% if category %}
<a href="{{ url_for('blog.category', category=category) }}?skip={{ earlier }}">&lt; Newer</a> <a href="{{ url_for('blog.category', category=category) }}?skip={{ earlier }}">&lt; Newer</a>
{% else %} {% else %}
<a href="{{ url_for('blog.index') }}?skip={{ earlier }}">&lt; Newer</a> <a href="{{ url_for('blog.index') }}?skip={{ earlier }}">&lt; Newer</a>
{% endif %} {% endif %}
{% if can_older %} | {% endif %} {% if can_older %} | {% endif %}
{% endif %} {% endif %}
{% if can_older %} {% if can_older %}
{% if category %} {% if category %}
<a href="{{ url_for('blog.category', category=category) }}?skip={{ older }}">Older &gt;</a> <a href="{{ url_for('blog.category', category=category) }}?skip={{ older }}">Older &gt;</a>
{% else %} {% else %}
<a href="{{ url_for('blog.index') }}?skip={{ older }}">Older &gt;</a> <a href="{{ url_for('blog.index') }}?skip={{ older }}">Older &gt;</a>
{% endif %} {% endif %}
{% endif %} {% endif %}
] ]
</div> </div>
{% endif %} {% endif %}

View File

@ -1,18 +1,18 @@
{# Older/Newer links #} {# Older/Newer links #}
{% if post["siblings"][0] or post["siblings"][1] %} {% if post["siblings"][0] or post["siblings"][1] %}
<div class="right"> <div class="right">
[ [
{% if post["siblings"][0] %} {% if post["siblings"][0] %}
<a href="{{ url_for('blog.entry', fid=post["siblings"][0]['fid']) }}">&lt; {{ post["siblings"][0]['subject'] }}</a> <a href="{{ url_for('blog.entry', fid=post["siblings"][0]['fid']) }}">&lt; {{ post["siblings"][0]['subject'] }}</a>
{% if post["siblings"][1] %} | {% endif %} {% if post["siblings"][1] %} | {% endif %}
{% endif %} {% endif %}
{% if post["siblings"][1] %} {% if post["siblings"][1] %}
<a href="{{ url_for('blog.entry', fid=post["siblings"][1]['fid']) }}">{{ post["siblings"][1]['subject'] }} &gt;</a> <a href="{{ url_for('blog.entry', fid=post["siblings"][1]['fid']) }}">{{ post["siblings"][1]['subject'] }} &gt;</a>
{% endif %} {% endif %}
] ]
</div> </div>
{% endif %} {% endif %}

View File

@ -3,159 +3,159 @@
{% block content %} {% block content %}
{% if preview %} {% if preview %}
<h1>Preview: {{ subject }}</h1> <h1>Preview: {{ subject }}</h1>
{{ rendered_body|safe }} {{ rendered_body|safe }}
<hr> <hr>
{% endif %} {% endif %}
<h1>Update Blog</h1> <h1>Update Blog</h1>
<form name="editor" action="{{ url_for('blog.update') }}" method="POST"> <form name="editor" action="{{ url_for('blog.update') }}" method="POST">
<input type="hidden" name="id" value="{{ post_id }}"> <input type="hidden" name="id" value="{{ post_id }}">
<input type="hidden" name="author" value="{{ author }}"> <input type="hidden" name="author" value="{{ author }}">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<strong>Subject:</strong><br> <strong>Subject:</strong><br>
<input type="text" class="form-control" size="80" name="subject" value="{{ subject }}"><p> <input type="text" class="form-control" size="80" name="subject" value="{{ subject }}"><p>
<strong>Friendly ID:</strong><br> <strong>Friendly ID:</strong><br>
You can leave this blank if this is a new post. It defaults to be based You can leave this blank if this is a new post. It defaults to be based
on the subject.<br> on the subject.<br>
<input type="text" class="form-control" size="80" name="fid" value="{{ fid }}"><p> <input type="text" class="form-control" size="80" name="fid" value="{{ fid }}"><p>
<strong>Body:</strong><br> <strong>Body:</strong><br>
<label> <label>
<input type="radio" name="format" value="markdown"{% if format == "markdown" %} checked{% endif %}> Markdown <input type="radio" name="format" value="markdown"{% if format == "markdown" %} checked{% endif %}> Markdown
</label> </label>
<label> <label>
<input type="radio" name="format" value="html"{% if format == "html" %} checked{% endif %}> HTML <input type="radio" name="format" value="html"{% if format == "html" %} checked{% endif %}> HTML
</label><br> </label><br>
<textarea class="form-control input-lg" cols="80" rows="12" name="body">{{ body }}</textarea><br> <textarea class="form-control input-lg" cols="80" rows="12" name="body">{{ body }}</textarea><br>
<a href="/markdown" target="_blank">Markdown cheatsheet</a> / <a href="/markdown" target="_blank">Markdown cheatsheet</a> /
<a href="{{ url_for('emoticons.index') }}" target="_blank">Emoticon reference</a> (opens in new window)<br> <a href="{{ url_for('emoticons.index') }}" target="_blank">Emoticon reference</a> (opens in new window)<br>
Optional: separate your summary from the rest of the post by typing <code>&lt;snip&gt;</code> Optional: separate your summary from the rest of the post by typing <code>&lt;snip&gt;</code>
where you want the division to appear.<p> where you want the division to appear.<p>
<strong>Avatar:</strong><br> <strong>Avatar:</strong><br>
<span id="avatar-preview"></span> <span id="avatar-preview"></span>
<select name="avatar" id="avatar" class="form-control"> <select name="avatar" id="avatar" class="form-control">
<option value=""{% if avatar == "" %} selected{% endif %}>Use my profile picture</option> <option value=""{% if avatar == "" %} selected{% endif %}>Use my profile picture</option>
{% for pic in avatars %} {% for pic in avatars %}
<option value="{{ pic }}"{% if avatar == pic %} selected{% endif %}>{{ pic }}</option> <option value="{{ pic }}"{% if avatar == pic %} selected{% endif %}>{{ pic }}</option>
{% endfor %} {% endfor %}
</select><p> </select><p>
<strong>Categories:</strong><br> <strong>Categories:</strong><br>
<small>Comma-separated list, e.g. General, HTML, Perl, Web Design</small><br> <small>Comma-separated list, e.g. General, HTML, Perl, Web Design</small><br>
<input type="text" class="form-control" size="40" name="categories" value="{{ categories }}"><p> <input type="text" class="form-control" size="40" name="categories" value="{{ categories }}"><p>
<strong>Privacy:</strong><br> <strong>Privacy:</strong><br>
<select name="privacy" class="form-control"> <select name="privacy" class="form-control">
<option value="public"{% if privacy == "public" %} selected{% endif %}> <option value="public"{% if privacy == "public" %} selected{% endif %}>
Public: everybody can see this blog entry Public: everybody can see this blog entry
</option> </option>
<option value="private"{% if privacy == "private" %} selected{% endif %}> <option value="private"{% if privacy == "private" %} selected{% endif %}>
Private: only site admins can see this blog entry Private: only site admins can see this blog entry
</option> </option>
</select><p> </select><p>
<strong>Options:</strong><br> <strong>Options:</strong><br>
<label> <label>
<input type="checkbox" name="emoticons" value="true"{% if emoticons %} checked{% endif %}> <input type="checkbox" name="emoticons" value="true"{% if emoticons %} checked{% endif %}>
Enable graphical emoticons Enable graphical emoticons
</label><br> </label><br>
<label> <label>
<input type="checkbox" name="comments" value="true"{% if comments %} checked{% endif %}> <input type="checkbox" name="comments" value="true"{% if comments %} checked{% endif %}>
Enable comments on this entry Enable comments on this entry
</label><p> </label><p>
<strong>Time Stamp:</strong><br> <strong>Time Stamp:</strong><br>
<input type="text" class="form-control input-sm inline" size="2" name="month" id="month" value="{{ month }}"> / <input type="text" class="form-control input-sm inline" size="2" name="month" id="month" value="{{ month }}"> /
<input type="text" class="form-control input-sm inline" size="2" name="day" id="day" value="{{ day }}"> / <input type="text" class="form-control input-sm inline" size="2" name="day" id="day" value="{{ day }}"> /
<input type="text" class="form-control input-sm inline" size="4" name="year" id="year" value="{{ year }}"> @ <input type="text" class="form-control input-sm inline" size="4" name="year" id="year" value="{{ year }}"> @
<input type="text" class="form-control input-sm inline" size="2" name="hour" id="hour" value="{{ hour }}"> : <input type="text" class="form-control input-sm inline" size="2" name="hour" id="hour" value="{{ hour }}"> :
<input type="text" class="form-control input-sm inline" size="2" name="min" id="min" value="{{ min }}"> : <input type="text" class="form-control input-sm inline" size="2" name="min" id="min" value="{{ min }}"> :
<input type="text" class="form-control input-sm inline" size="2" name="sec" id="sec" value="{{ sec }}"><br> <input type="text" class="form-control input-sm inline" size="2" name="sec" id="sec" value="{{ sec }}"><br>
mm / dd / yyyy @ hh:mm:ss<br> mm / dd / yyyy @ hh:mm:ss<br>
<label> <label>
<input type="checkbox" id="autoup" value="yes"{% if post_id == "" %} checked{% endif %}> <input type="checkbox" id="autoup" value="yes"{% if post_id == "" %} checked{% endif %}>
Automatically update Automatically update
</label><p> </label><p>
<button type="submit" class="btn btn-default" name="action" value="preview">Preview</button> <button type="submit" class="btn btn-default" name="action" value="preview">Preview</button>
<button type="submit" class="btn btn-primary" name="action" value="publish">Publish Entry</button> <button type="submit" class="btn btn-primary" name="action" value="publish">Publish Entry</button>
</form> </form>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script> <script>
var userPic = "{% if userpic %}{{ app['photo_url'] }}/{{ userpic }}{% else %}/static/avatars/default.png{% endif %}"; var userPic = "{% if userpic %}{{ app['photo_url'] }}/{{ userpic }}{% else %}/static/avatars/default.png{% endif %}";
$(document).ready(function() { $(document).ready(function() {
// Preview their selected avatar. // Preview their selected avatar.
updateAvatar(); updateAvatar();
$("#avatar").on("change", updateAvatar); $("#avatar").on("change", updateAvatar);
// Start ticking the timestamp updater. // Start ticking the timestamp updater.
setInterval(timestamps, 500) setInterval(timestamps, 500)
}); });
function updateAvatar() { function updateAvatar() {
var chosen = $("#avatar").val(); var chosen = $("#avatar").val();
var picture = ""; // which pic to show var picture = ""; // which pic to show
if (chosen === "") { if (chosen === "") {
picture = userPic; picture = userPic;
} }
else { else {
picture = "/static/avatars/" + chosen; picture = "/static/avatars/" + chosen;
} }
// Show the pic // Show the pic
if (picture.length) { if (picture.length) {
$("#avatar-preview").html("<img src=\"" + picture + "\" alt=\"Preview\"><br>"); $("#avatar-preview").html("<img src=\"" + picture + "\" alt=\"Preview\"><br>");
} }
else { else {
$("#avatar-preview").html(""); $("#avatar-preview").html("");
} }
} }
function timestamps() { function timestamps() {
function padout(num) { function padout(num) {
if (num < 10) { if (num < 10) {
return '0' + num; return '0' + num;
} }
return num; return num;
} }
if ($("#autoup").is(":checked")) { if ($("#autoup").is(":checked")) {
var d = new Date(); var d = new Date();
var mon = d.getMonth(); // 0..11 var mon = d.getMonth(); // 0..11
var day = d.getDate(); // 1..31 var day = d.getDate(); // 1..31
var year = d.getFullYear(); // 2014 var year = d.getFullYear(); // 2014
var hour = d.getHours(); // 0..23 var hour = d.getHours(); // 0..23
var min = d.getMinutes(); // 0..59 var min = d.getMinutes(); // 0..59
var sec = d.getSeconds(); // 0..59 var sec = d.getSeconds(); // 0..59
// Adjust the dates. // Adjust the dates.
mon++; mon++;
mon = padout(mon); mon = padout(mon);
day = padout(day); day = padout(day);
hour = padout(hour); hour = padout(hour);
min = padout(min); min = padout(min);
sec = padout(sec); sec = padout(sec);
// Update the fields. // Update the fields.
$("#month").val(mon); $("#month").val(mon);
$("#day").val(day); $("#day").val(day);
$("#year").val(year); $("#year").val(year);
$("#hour").val(hour); $("#hour").val(hour);
$("#min").val(min); $("#min").val(min);
$("#sec").val(sec); $("#sec").val(sec);
} }
} }
</script> </script>
{% endblock %} {% endblock %}

View File

@ -7,23 +7,23 @@
Current preview of the comment:<p> Current preview of the comment:<p>
<div class="comment"> <div class="comment">
{{ comment["formatted_message"]|safe }} {{ comment["formatted_message"]|safe }}
</div> </div>
<h2>Edit Comment</h2> <h2>Edit Comment</h2>
<form name="editor" action="{{ url_for('comment.edit', thread=thread, cid=cid) }}" method="POST"> <form name="editor" action="{{ url_for('comment.edit', thread=thread, cid=cid) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="url" value="{{ url }}"> <input type="hidden" name="url" value="{{ url }}">
<strong>Message:</strong><br> <strong>Message:</strong><br>
<textarea class="form-control" cols="40" rows="8" name="message">{{ comment["message"] }}</textarea><br> <textarea class="form-control" cols="40" rows="8" name="message">{{ comment["message"] }}</textarea><br>
<small>Comments can be formatted with <a href="/markdown" target="_blank">Markdown</a>, <small>Comments can be formatted with <a href="/markdown" target="_blank">Markdown</a>,
and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a> and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a>
in your comment.</small><p> in your comment.</small><p>
<button type="submit" class="btn btn-default" name="action" value="preview">Preview Comment</button> <button type="submit" class="btn btn-default" name="action" value="preview">Preview Comment</button>
<button type="submit" class="btn btn-primary" name="action" value="save">Save</button> <button type="submit" class="btn btn-primary" name="action" value="save">Save</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -1,70 +1,70 @@
{# Common template for leaving a comment/updating the comment preview. #} {# Common template for leaving a comment/updating the comment preview. #}
{% if commenting_disabled %} {% if commenting_disabled %}
No new comments may be added to this thread. No new comments may be added to this thread.
{% else %} {% else %}
<form name="comment" action="{{ url_for('comment.preview') }}" method="POST"> <form name="comment" action="{{ url_for('comment.preview') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="thread" value="{{ thread }}"> <input type="hidden" name="thread" value="{{ thread }}">
<input type="hidden" name="url" value="{{ url }}"> <input type="hidden" name="url" value="{{ url }}">
<input type="hidden" name="subject" value="{{ subject }}"> <input type="hidden" name="subject" value="{{ subject }}">
<table border="0" cellspacing="2" cellpadding="2"> <table border="0" cellspacing="2" cellpadding="2">
<tr> <tr>
<td align="left" valign="middle"> <td align="left" valign="middle">
Your name: Your name:
</td> </td>
<td align="left" valign="middle"> <td align="left" valign="middle">
{% if session["login"] %} {% if session["login"] %}
<strong>{{ session["name"] }}</strong> <strong>{{ session["name"] }}</strong>
{% else %} {% else %}
<input type="text" class="form-control" size="40" name="name" value="{{ name }}"> <input type="text" class="form-control" size="40" name="name" value="{{ name }}">
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="middle"> <td align="left" valign="middle">
Your Email: Your Email:
</td> </td>
<td align="left" valign="middle"> <td align="left" valign="middle">
<input type="text" class="form-control" size="40" name="contact" value="{{ contact }}" placeholder="(optional; used for Gravatar icons and subscribing)"> <input type="text" class="form-control" size="40" name="contact" value="{{ contact }}" placeholder="(optional; used for Gravatar icons and subscribing)">
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="top"> <td align="left" valign="top">
Message: Message:
</td> </td>
<td align="left" valign="top"> <td align="left" valign="top">
<textarea class="form-control" cols="40" rows="8" name="message" style="width: 100%">{{ message }}</textarea> <textarea class="form-control" cols="40" rows="8" name="message" style="width: 100%">{{ message }}</textarea>
<div> <div>
<small>Comments can be formatted with <a href="/markdown" target="_blank">Markdown</a>, <small>Comments can be formatted with <a href="/markdown" target="_blank">Markdown</a>,
and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a> and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a>
in your comment.</small> in your comment.</small>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="left" valign="top"> <td colspan="2" align="left" valign="top">
<label> <label>
<input type="checkbox" name="subscribe" value="true"{% if subscribe == "true" %} checked{% endif %}> <input type="checkbox" name="subscribe" value="true"{% if subscribe == "true" %} checked{% endif %}>
Notify me of future comments on this page via e-mail Notify me of future comments on this page via e-mail
(<a href="{{ url_for('comment.privacy') }}" target="_blank">Privacy Policy</a>) (<a href="{{ url_for('comment.privacy') }}" target="_blank">Privacy Policy</a>)
</label> </label>
</td> </td>
</tr> </tr>
</table><p> </table><p>
<div style="display: none"> <div style="display: none">
If you can see this, don't touch the following fields.<br> If you can see this, don't touch the following fields.<br>
<input type="text" class="form-control" name="website" value="http://"><br> <input type="text" class="form-control" name="website" value="http://"><br>
<input type="text" class="form-control" name="email" value=""> <input type="text" class="form-control" name="email" value="">
</div> </div>
{% if preview %} {% if preview %}
<button class="btn btn-default" type="submit" name="action" value="preview">Refresh Preview</button> <button class="btn btn-default" type="submit" name="action" value="preview">Refresh Preview</button>
<button class="btn btn-primary" type="submit" name="action" value="submit">Submit Comment</button> <button class="btn btn-primary" type="submit" name="action" value="submit">Submit Comment</button>
{% else %} {% else %}
<button class="btn btn-primary" type="submit" name="action" value="preview">Leave Comment</button> <button class="btn btn-primary" type="submit" name="action" value="preview">Leave Comment</button>
{% endif %} {% endif %}
</form> </form>
{% endif %} {% endif %}

View File

@ -1,39 +1,39 @@
<a name="comments"></a> <a name="comments"></a>
{% if header %} {% if header %}
<h1>Comments</h1> <h1>Comments</h1>
{% endif %} {% endif %}
There {% if comments|length == 1 %}is{% else %}are{% endif %} There {% if comments|length == 1 %}is{% else %}are{% endif %}
{{ comments|length }} comment{% if comments|length != 1 %}s{% endif %} {{ comments|length }} comment{% if comments|length != 1 %}s{% endif %}
on this page.<p> on this page.<p>
{% for comment in comments %} {% for comment in comments %}
<div class="comment"> <div class="comment">
<div class="comment-author"> <div class="comment-author">
{% if comment["image"] and (comment["image"].startswith('http:') or comment["image"].startswith('https:') or comment["image"].startswith('//')) %} {% if comment["image"] and (comment["image"].startswith('http:') or comment["image"].startswith('https:') or comment["image"].startswith('//')) %}
<img src="{{ comment['image'] }}" alt="Avatar" width="96" height="96"> <img src="{{ comment['image'] }}" alt="Avatar" width="96" height="96">
{% elif comment["image"] %} {% elif comment["image"] %}
<img src="{{ photo_url }}/{{ comment['image'] }}" alt="Avatar" width="96" height="96"> <img src="{{ photo_url }}/{{ comment['image'] }}" alt="Avatar" width="96" height="96">
{% else %} {% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96"> <img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %} {% endif %}
<div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></div> <div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></div>
</div> </div>
<strong>Posted on {{ comment["pretty_time"] }} by {{ comment["name"] }}.</strong><p> <strong>Posted on {{ comment["pretty_time"] }} by {{ comment["name"] }}.</strong><p>
{{ comment["formatted_message"]|safe }} {{ comment["formatted_message"]|safe }}
<div class="clear"> <div class="clear">
{% if session["login"] %} {% if session["login"] %}
[IP: {{ comment["ip"] }} [IP: {{ comment["ip"] }}
| |
<a href="{{ url_for('comment.edit', thread=thread, cid=comment['id'], url=url) }}">Edit</a> <a href="{{ url_for('comment.edit', thread=thread, cid=comment['id'], url=url) }}">Edit</a>
| |
<a href="{{ url_for('comment.delete', thread=thread, cid=comment['id'], url=url) }}" onclick="return window.confirm('Are you sure?')">Delete</a>] <a href="{{ url_for('comment.delete', thread=thread, cid=comment['id'], url=url) }}" onclick="return window.confirm('Are you sure?')">Delete</a>]
{% endif %} {% endif %}
</div> </div>
</div><p> </div><p>
{% endfor %} {% endfor %}
<h2>Add a Comment</h2> <h2>Add a Comment</h2>

View File

@ -7,26 +7,26 @@
This is a preview of what your comment is going to look like once posted.<p> This is a preview of what your comment is going to look like once posted.<p>
<div class="comment"> <div class="comment">
<div class="comment-author"> <div class="comment-author">
{% if contact %} {% if contact %}
<img src="{{ gravatar }}" alt="Avatar" width="96" height="96"> <img src="{{ gravatar }}" alt="Avatar" width="96" height="96">
{% else %} {% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96"> <img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %}<br> {% endif %}<br>
<strong>{% if session["login"] %}{{ session["username"] }}{% else %}guest{% endif %}</strong> <strong>{% if session["login"] %}{{ session["username"] }}{% else %}guest{% endif %}</strong>
</div> </div>
<strong>Posted on {{ pretty_time }} by {{ name or "Anonymous" }}.</strong><p> <strong>Posted on {{ pretty_time }} by {{ name or "Anonymous" }}.</strong><p>
{{ preview|safe }} {{ preview|safe }}
<div class="clear"></div> <div class="clear"></div>
</div> </div>
{% if subscribe == "true" and contact %} {% if subscribe == "true" and contact %}
<p> <p>
You will be subscribed to future comments on this thread. Notification You will be subscribed to future comments on this thread. Notification
e-mails will be sent to {{ contact }}.<p> e-mails will be sent to {{ contact }}.<p>
{% endif %} {% endif %}
<h2>Edit Comment</h2> <h2>Edit Comment</h2>

View File

@ -15,46 +15,46 @@ e-mail address in the form below.<p>
<h2>Privacy Policy</h2> <h2>Privacy Policy</h2>
<ul> <ul>
<li> <li>
Your e-mail address that you use when you post the comment will only be Your e-mail address that you use when you post the comment will only be
used for sending you notifications via e-mail when somebody else replies used for sending you notifications via e-mail when somebody else replies
to the comment thread and for showing a to the comment thread and for showing a
<a href="http://www.gravatar.com/" target="_blank">Gravatar</a> next to <a href="http://www.gravatar.com/" target="_blank">Gravatar</a> next to
your comment. your comment.
</li> </li>
<li> <li>
Your e-mail will not be visible to anybody else on this site. Your e-mail will not be visible to anybody else on this site.
</li> </li>
<li> <li>
Your e-mail won't be given to any spammers so you don't need to worry Your e-mail won't be given to any spammers so you don't need to worry
about junk mail. about junk mail.
</li> </li>
<li> <li>
You can unsubscribe from individual comment threads by using the link You can unsubscribe from individual comment threads by using the link
provided in the notification e-mail. You can unsubscribe from ALL provided in the notification e-mail. You can unsubscribe from ALL
threads by using the form on this page. threads by using the form on this page.
</li> </li>
</ul> </ul>
<h2>Unsubscribe from All Comment Threads</h2> <h2>Unsubscribe from All Comment Threads</h2>
<form name="unsubscribe" action="{{ url_for('comment.unsubscribe') }}" method="POST"> <form name="unsubscribe" action="{{ url_for('comment.unsubscribe') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="thread" value="*"> <input type="hidden" name="thread" value="*">
Enter the e-mail address to be unsubscribed from all threads:<br> Enter the e-mail address to be unsubscribed from all threads:<br>
<input type="email" class="form-control" size="40" name="email"><p> <input type="email" class="form-control" size="40" name="email"><p>
<button type="submit" class="btn btn-primary">Unsubscribe</button> <button type="submit" class="btn btn-primary">Unsubscribe</button>
<div style="display: none"> <div style="display: none">
If you can see this, do not touch these fields.<br> If you can see this, do not touch these fields.<br>
<input type="text" class="form-control" name="url" value="http://"><br> <input type="text" class="form-control" name="url" value="http://"><br>
<input type="text" class="form-control" name="message" value=""> <input type="text" class="form-control" name="message" value="">
</div> </div>
</form> </form>

View File

@ -6,9 +6,9 @@
The e-mail address <strong>{{ email }}</strong> has been unsubscribed The e-mail address <strong>{{ email }}</strong> has been unsubscribed
{% if thread == "*" %} {% if thread == "*" %}
from all comment threads on this site. from all comment threads on this site.
{% else %} {% else %}
from the comment thread "{{ thread }}". from the comment thread "{{ thread }}".
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -9,39 +9,39 @@ You can use the form below to send me an e-mail.<p>
<form name="contact" action="{{ url_for('contact.send') }}" method="POST"> <form name="contact" action="{{ url_for('contact.send') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<table border="0" cellspacing="0" cellpadding="2"> <table border="0" cellspacing="0" cellpadding="2">
<tr> <tr>
<td width="50%" align="left" valign="middle"> <td width="50%" align="left" valign="middle">
<strong>Your name:</strong><br> <strong>Your name:</strong><br>
<small>(so I know who you are)</small><br> <small>(so I know who you are)</small><br>
<input type="text" class="form-control"size="40" name="name"> <input type="text" class="form-control"size="40" name="name">
</td> </td>
<td width="50%" align="left" valign="middle"> <td width="50%" align="left" valign="middle">
<strong>Your email:</strong><br> <strong>Your email:</strong><br>
<small>(if you want a response)</small><br> <small>(if you want a response)</small><br>
<input type="email" class="form-control" size="40" name="email"> <input type="email" class="form-control" size="40" name="email">
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="left" valign="middle"> <td colspan="2" align="left" valign="middle">
<strong>Message subject:</strong><br> <strong>Message subject:</strong><br>
<small>(optional)</small><br> <small>(optional)</small><br>
<input type="text" class="form-control" size="40" name="subject" style="width: 100%"><p> <input type="text" class="form-control" size="40" name="subject" style="width: 100%"><p>
<strong>Message:</strong><br> <strong>Message:</strong><br>
<small>(required)</small><br> <small>(required)</small><br>
<textarea class="form-control" cols="40" rows="12" name="message" style="width: 100%"></textarea> <textarea class="form-control" cols="40" rows="12" name="message" style="width: 100%"></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" align="right" valign="middle"> <td colspan="2" align="right" valign="middle">
<button type="submit" class="btn btn-primary">Send Message</button> <button type="submit" class="btn btn-primary">Send Message</button>
</td> </td>
</tr> </tr>
</table> </table>
<div style="display: none"> <div style="display: none">
If you can see these boxes, don't touch them.<br> If you can see these boxes, don't touch them.<br>
<input type="text" class="form-control" size="40" name="contact" value=""><br> <input type="text" class="form-control" size="40" name="contact" value=""><br>
<input type="text" class="form-control" size="40" name="website" value="http://"> <input type="text" class="form-control" size="40" name="website" value="http://">
</div> </div>
</form> </form>

View File

@ -5,26 +5,26 @@
<h1>Emoticon Theme: {{ theme_name }}</h1> <h1>Emoticon Theme: {{ theme_name }}</h1>
<table class="table" cellspacing="0" cellpadding="2"> <table class="table" cellspacing="0" cellpadding="2">
<thead> <thead>
<tr> <tr>
<th>Emoticon</th> <th>Emoticon</th>
<th>Trigger Text</th> <th>Trigger Text</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for img in smileys %} {% for img in smileys %}
<tr> <tr>
<td align="center" valign="middle"> <td align="center" valign="middle">
<img src="/static/smileys/{{ theme }}/{{ img['img'] }}"> <img src="/static/smileys/{{ theme }}/{{ img['img'] }}">
</td> </td>
<td align="left" valign="middle"> <td align="left" valign="middle">
{% for trigger in img['triggers'] %} {% for trigger in img['triggers'] %}
{{ trigger }}&nbsp;&nbsp;&nbsp;&nbsp; {{ trigger }}&nbsp;&nbsp;&nbsp;&nbsp;
{% endfor %} {% endfor %}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% endblock %} {% endblock %}

View File

@ -5,57 +5,57 @@
<h1>Album: {{ album }}</h1> <h1>Album: {{ album }}</h1>
{% if album_info["description"] %} {% if album_info["description"] %}
<div class="photo-description">{{ markdown|safe }}</div><p> <div class="photo-description">{{ markdown|safe }}</div><p>
{% endif %} {% endif %}
{% if album_info["format"] == "vertical" %} {% if album_info["format"] == "vertical" %}
{% for photo in photos %} {% for photo in photos %}
{% set data = photo["data"] %} {% set data = photo["data"] %}
{% if data["caption"] %} {% if data["caption"] %}
<h2>{{ data["caption"] }}</h2> <h2>{{ data["caption"] }}</h2>
{% endif %} {% endif %}
<a href="{{ url_for('photo.view_photo', key=photo['key']) }}"> <a href="{{ url_for('photo.view_photo', key=photo['key']) }}">
<img src="{{ app['photo_url'] }}/{{ data['large'] }}" class="portrait"> <img src="{{ app['photo_url'] }}/{{ data['large'] }}" class="portrait">
</a><p> </a><p>
{% if data["description"] %} {% if data["description"] %}
<div class="photo-description">{{ data["markdown"]|safe }}</div> <div class="photo-description">{{ data["markdown"]|safe }}</div>
{% endif %} {% endif %}
{% if loop.index < photos|length %}<hr>{% endif %} {% if loop.index < photos|length %}<hr>{% endif %}
{% endfor %} {% endfor %}
{% else %}{# classic layout #} {% else %}{# classic layout #}
<ul class="photo-grid"> <ul class="photo-grid">
{% for photo in photos %} {% for photo in photos %}
<li class="portrait"> <li class="portrait">
<div class="dummy"></div> <div class="dummy"></div>
<div class="photo-grid-item"> <div class="photo-grid-item">
<a href="{{ url_for('photo.view_photo', key=photo['key']) }}"> <a href="{{ url_for('photo.view_photo', key=photo['key']) }}">
<img src="{{ app['photo_url'] }}/{{ photo['data']['thumb'] }}" width="100%" height="100%"> <img src="{{ app['photo_url'] }}/{{ photo['data']['thumb'] }}" width="100%" height="100%">
<span class="name">{{ photo["data"]["caption"] }}</span> <span class="name">{{ photo["data"]["caption"] }}</span>
</a> </a>
</div> </div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
{% endif %} {% endif %}
{% if session["login"] %} {% if session["login"] %}
<h1>Administrative Options</h1> <h1>Administrative Options</h1>
<ul> <ul>
<li><a href="{{ url_for('photo.upload') }}">Upload a Photo</a></li> <li><a href="{{ url_for('photo.upload') }}">Upload a Photo</a></li>
{% if photos|length > 0 %} {% if photos|length > 0 %}
<li><a href="{{ url_for('photo.edit_album', album=album) }}">Edit Album Settings</a></li> <li><a href="{{ url_for('photo.edit_album', album=album) }}">Edit Album Settings</a></li>
<li><a href="{{ url_for('photo.bulk_captions', album=album) }}">Edit Image Titles/Descriptions</a></li> <li><a href="{{ url_for('photo.bulk_captions', album=album) }}">Edit Image Titles/Descriptions</a></li>
<li><a href="{{ url_for('photo.arrange_photos', album=album) }}">Rearrange Photos</a></li> <li><a href="{{ url_for('photo.arrange_photos', album=album) }}">Rearrange Photos</a></li>
<li><a href="{{ url_for('photo.delete_album', album=album) }}">Delete Album</a></li> <li><a href="{{ url_for('photo.delete_album', album=album) }}">Delete Album</a></li>
{% endif %} {% endif %}
</ul> </ul>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -5,33 +5,33 @@
<h1>Photo Albums</h1> <h1>Photo Albums</h1>
{% if albums|length == 0 %} {% if albums|length == 0 %}
<em>There are no photo albums yet.</em> <em>There are no photo albums yet.</em>
{% else %} {% else %}
<ul class="photo-grid"> <ul class="photo-grid">
{% for album in albums %} {% for album in albums %}
<li class="portrait"> <li class="portrait">
<div class="dummy"></div> <div class="dummy"></div>
<div class="photo-grid-item"> <div class="photo-grid-item">
<a href="{{ url_for('photo.album_index', name=album['name']) }}"> <a href="{{ url_for('photo.album_index', name=album['name']) }}">
<img src="{{ app['photo_url'] }}/{{ album['cover'] }}" width="100%" height="100%"> <img src="{{ app['photo_url'] }}/{{ album['cover'] }}" width="100%" height="100%">
<span class="name">{{ album["name"] }}</span> <span class="name">{{ album["name"] }}</span>
</a> </a>
</div> </div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
{% endif %} {% endif %}
{% if session["login"] %} {% if session["login"] %}
<h1>Administrative Options</h1> <h1>Administrative Options</h1>
<ul> <ul>
<li><a href="{{ url_for('photo.upload') }}">Upload a Photo</a></li> <li><a href="{{ url_for('photo.upload') }}">Upload a Photo</a></li>
{% if albums|length > 0 %}<li><a href="{{ url_for('photo.arrange_albums') }}">Rearrange Albums</a></li>{% endif %} {% if albums|length > 0 %}<li><a href="{{ url_for('photo.arrange_albums') }}">Rearrange Albums</a></li>{% endif %}
</ul> </ul>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -7,24 +7,24 @@
Drag and drop your albums in the positions you want them in.<p> Drag and drop your albums in the positions you want them in.<p>
<form name="arrange" id="arrange-form" action="{{ url_for('photo.arrange_albums') }}" method="POST"> <form name="arrange" id="arrange-form" action="{{ url_for('photo.arrange_albums') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="order" id="order" value=""> <input type="hidden" name="order" id="order" value="">
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary">Save Changes</button>
</form> </form>
<p> <p>
<ul id="arrange-photos" class="photo-grid"> <ul id="arrange-photos" class="photo-grid">
{% for album in albums %} {% for album in albums %}
<li data-name="{{ album['name'] }}" class="portrait"> <li data-name="{{ album['name'] }}" class="portrait">
<div class="dummy"></div> <div class="dummy"></div>
<div class="photo-grid-item"> <div class="photo-grid-item">
<a href="{{ url_for('photo.album_index', name=album['name']) }}"> <a href="{{ url_for('photo.album_index', name=album['name']) }}">
<img src="{{ app['photo_url'] }}/{{ album['cover'] }}" width="100%" height="100%"> <img src="{{ app['photo_url'] }}/{{ album['cover'] }}" width="100%" height="100%">
<span class="name">{{ album["name"] }}</span> <span class="name">{{ album["name"] }}</span>
</a> </a>
</div> </div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
@ -35,26 +35,26 @@ Drag and drop your albums in the positions you want them in.<p>
<link rel="stylesheet" type="text/css" media="all" href="/css/ui-lightness/jquery-ui-1.10.4.custom.css"> <link rel="stylesheet" type="text/css" media="all" href="/css/ui-lightness/jquery-ui-1.10.4.custom.css">
<script src="/js/jquery-ui-1.10.4.custom.js"></script> <script src="/js/jquery-ui-1.10.4.custom.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var $photos = $("#arrange-photos"), var $photos = $("#arrange-photos"),
$form = $("#arrange-form"), $form = $("#arrange-form"),
$order = $("#order"); $order = $("#order");
var doArrangePhotos = function() { var doArrangePhotos = function() {
var order = []; var order = [];
// Get the list of elements. // Get the list of elements.
var list = $photos.children().each(function() { var list = $photos.children().each(function() {
var name = $(this).data("name"); var name = $(this).data("name");
order.push(name); order.push(name);
}); });
$order.val(order.join(";")); $order.val(order.join(";"));
return true; return true;
}; };
$form.submit(doArrangePhotos); $form.submit(doArrangePhotos);
$photos.sortable(); $photos.sortable();
$photos.disableSelection(); $photos.disableSelection();
}); });
</script> </script>
{% endblock %} {% endblock %}

View File

@ -7,22 +7,22 @@
Drag and drop your photos in the positions you want them in.<p> Drag and drop your photos in the positions you want them in.<p>
<form name="arrange" id="arrange-form" action="{{ url_for('photo.arrange_photos', album=album) }}" method="POST"> <form name="arrange" id="arrange-form" action="{{ url_for('photo.arrange_photos', album=album) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="order" id="order" value=""> <input type="hidden" name="order" id="order" value="">
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary">Save Changes</button>
</form> </form>
<p> <p>
<ul id="arrange-photos" class="photo-grid"> <ul id="arrange-photos" class="photo-grid">
{% for photo in photos %} {% for photo in photos %}
<li data-name="{{ photo['key'] }}" class="portrait"> <li data-name="{{ photo['key'] }}" class="portrait">
<div class="dummy"></div> <div class="dummy"></div>
<div class="photo-grid-item"> <div class="photo-grid-item">
<img src="{{ app['photo_url'] }}/{{ photo['data']['thumb'] }}" width="100%" height="100%"> <img src="{{ app['photo_url'] }}/{{ photo['data']['thumb'] }}" width="100%" height="100%">
<span class="name">{{ photo['data']['caption'] }}</span> <span class="name">{{ photo['data']['caption'] }}</span>
</div> </div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
@ -33,26 +33,26 @@ Drag and drop your photos in the positions you want them in.<p>
<link rel="stylesheet" type="text/css" media="all" href="/css/ui-lightness/jquery-ui-1.10.4.custom.css"> <link rel="stylesheet" type="text/css" media="all" href="/css/ui-lightness/jquery-ui-1.10.4.custom.css">
<script src="/js/jquery-ui-1.10.4.custom.js"></script> <script src="/js/jquery-ui-1.10.4.custom.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var $photos = $("#arrange-photos"), var $photos = $("#arrange-photos"),
$form = $("#arrange-form"), $form = $("#arrange-form"),
$order = $("#order"); $order = $("#order");
var doArrangePhotos = function() { var doArrangePhotos = function() {
var order = []; var order = [];
// Get the list of elements. // Get the list of elements.
var list = $photos.children().each(function() { var list = $photos.children().each(function() {
var name = $(this).data("name"); var name = $(this).data("name");
order.push(name); order.push(name);
}); });
$order.val(order.join(";")); $order.val(order.join(";"));
return true; return true;
}; };
$form.submit(doArrangePhotos); $form.submit(doArrangePhotos);
$photos.sortable(); $photos.sortable();
$photos.disableSelection(); $photos.disableSelection();
}); });
</script> </script>
{% endblock %} {% endblock %}

View File

@ -9,27 +9,27 @@ shape. You can use this page to modify the region of the photo you want to
crop.<p> crop.<p>
<table border="0" cellspacing="4" cellpadding="2"> <table border="0" cellspacing="4" cellpadding="2">
<tr> <tr>
<td align="center" valign="middle"> <td align="center" valign="middle">
<img src="{{ app['photo_url'] }}/{{ preview }}" id="cropbox"> <img src="{{ app['photo_url'] }}/{{ preview }}" id="cropbox">
</td> </td>
<td align="center" valign="top"> <td align="center" valign="top">
<strong>Preview:</strong><br> <strong>Preview:</strong><br>
<div style="width: 100px; height: 100px; overflow: hidden"> <div style="width: 100px; height: 100px; overflow: hidden">
<img src="{{ app['photo_url'] }}/{{ preview }}" id="preview" style="max-width: none"> <img src="{{ app['photo_url'] }}/{{ preview }}" id="preview" style="max-width: none">
</div> </div>
<p> <p>
<form name="crop" action="{{ url_for('photo.crop', photo=photo) }}" method="POST"> <form name="crop" action="{{ url_for('photo.crop', photo=photo) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="x" id="x" value="0"> <input type="hidden" name="x" id="x" value="0">
<input type="hidden" name="y" id="y" value="0"> <input type="hidden" name="y" id="y" value="0">
<input type="hidden" name="length" id="length" value="0"> <input type="hidden" name="length" id="length" value="0">
<button type="submit" class="btn btn-primary">Crop Photo!</button> <button type="submit" class="btn btn-primary">Crop Photo!</button>
</form> </form>
</td> </td>
</tr> </tr>
</table> </table>
{% endblock %} {% endblock %}
@ -38,70 +38,70 @@ crop.<p>
<script src="/js/jquery.Jcrop.min.js"></script> <script src="/js/jquery.Jcrop.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jquery.Jcrop.css"> <link rel="stylesheet" type="text/css" href="/css/jquery.Jcrop.css">
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var $cropbox = $("#cropbox"), var $cropbox = $("#cropbox"),
$preview = $("#preview"), $preview = $("#preview"),
$x = $("#x"), $x = $("#x"),
$y = $("#y"), $y = $("#y"),
$length = $("#length"); $length = $("#length");
// Find the shortest side. // Find the shortest side.
var len; var len;
if ($cropbox.width() > $cropbox.height()) { if ($cropbox.width() > $cropbox.height()) {
len = $cropbox.height(); len = $cropbox.height();
} }
else { else {
len = $cropbox.width(); len = $cropbox.width();
} }
// Jcrop handler. // Jcrop handler.
var showPreview = function(coords) { var showPreview = function(coords) {
if (parseInt(coords.w) > 0) { if (parseInt(coords.w) > 0) {
var rx = 100 / coords.w; var rx = 100 / coords.w;
var ry = 100 / coords.h; var ry = 100 / coords.h;
var ht = $cropbox.height(); var ht = $cropbox.height();
var wt = $cropbox.width(); var wt = $cropbox.width();
// Make the coords into percentages, so it works on mobile. // Make the coords into percentages, so it works on mobile.
// Get the true dimensions of the image from PIL. // Get the true dimensions of the image from PIL.
var trueW = {{ true_width }}; var trueW = {{ true_width }};
var trueH = {{ true_height }}; var trueH = {{ true_height }};
// The actual (possibly scaled) image shown on the page is hereby called // The actual (possibly scaled) image shown on the page is hereby called
// the "display image"... turn our "display coords" into percentages // the "display image"... turn our "display coords" into percentages
// across the image. // across the image.
var percentX = coords.x / wt; var percentX = coords.x / wt;
var percentY = coords.y / ht; var percentY = coords.y / ht;
var percentLen = coords.w / wt; var percentLen = coords.w / wt;
// Now get our true coords by multiplying those percentages against the // Now get our true coords by multiplying those percentages against the
// true dimensions of the image from PIL. // true dimensions of the image from PIL.
var trueX = trueW * percentX; var trueX = trueW * percentX;
var trueY = trueH * percentY; var trueY = trueH * percentY;
var trueLen = trueW * percentLen; var trueLen = trueW * percentLen;
// Update the preview. // Update the preview.
$preview.css({ $preview.css({
width: Math.round(rx * wt) + "px", width: Math.round(rx * wt) + "px",
height: Math.round(ry * ht) + "px", height: Math.round(ry * ht) + "px",
marginLeft: "-" + Math.round(rx * coords.x) + "px", marginLeft: "-" + Math.round(rx * coords.x) + "px",
marginTop: "-" + Math.round(ry * coords.y) + "px" marginTop: "-" + Math.round(ry * coords.y) + "px"
}) })
// Update the form. // Update the form.
$x.val(parseInt(trueX)); $x.val(parseInt(trueX));
$y.val(parseInt(trueY)); $y.val(parseInt(trueY));
$length.val(parseInt(trueLen)); $length.val(parseInt(trueLen));
} }
} }
$cropbox.Jcrop({ $cropbox.Jcrop({
onChange: showPreview, onChange: showPreview,
onSelect: showPreview, onSelect: showPreview,
aspectRatio: 1, aspectRatio: 1,
setSelect: [ 0, 0, len, len ], setSelect: [ 0, 0, len, len ],
}) })
}); });
</script> </script>
{% endblock %} {% endblock %}

View File

@ -7,10 +7,10 @@
<img src="{{ app['photo_url'] }}/{{ photo['thumb'] }}" class="portrait"><p> <img src="{{ app['photo_url'] }}/{{ photo['thumb'] }}" class="portrait"><p>
<form name="delete" action="{{ url_for('photo.delete', key=key) }}" method="POST"> <form name="delete" action="{{ url_for('photo.delete', key=key) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
Are you <strong>sure</strong> you want to delete this photo?<p> Are you <strong>sure</strong> you want to delete this photo?<p>
<button type="submit" class="btn btn-warning">Yes, Delete This Photo</button> <button type="submit" class="btn btn-warning">Yes, Delete This Photo</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -5,10 +5,10 @@
<h1>Delete Album</h1> <h1>Delete Album</h1>
<form name="delete" action="{{ url_for('photo.delete_album', album=album) }}" method="POST"> <form name="delete" action="{{ url_for('photo.delete_album', album=album) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
Are you <strong>sure</strong> you want to delete the album <strong>{{ album }}</strong>?<p> Are you <strong>sure</strong> you want to delete the album <strong>{{ album }}</strong>?<p>
<button type="submit" class="btn btn-warning">Yes, Delete This Album</button> <button type="submit" class="btn btn-warning">Yes, Delete This Album</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -7,30 +7,30 @@
<img src="{{ app['photo_url'] }}/{{ photo['thumb'] }}" class="portrait"><p> <img src="{{ app['photo_url'] }}/{{ photo['thumb'] }}" class="portrait"><p>
<form name="edit" action="{{ url_for('photo.edit', key=key) }}" method="POST"> <form name="edit" action="{{ url_for('photo.edit', key=key) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<strong>Photo Caption:</strong><br> <strong>Photo Caption:</strong><br>
<input type="text" class="form-control"size="40" name="caption" value="{{ photo['caption'] }}"><p> <input type="text" class="form-control"size="40" name="caption" value="{{ photo['caption'] }}"><p>
<strong>Description:</strong><br> <strong>Description:</strong><br>
<textarea class="form-control" cols="50" rows="6" name="description">{{ photo['description'] }}</textarea><br> <textarea class="form-control" cols="50" rows="6" name="description">{{ photo['description'] }}</textarea><br>
<small>Use <a href="/markdown">Markdown</a> syntax.</small><p> <small>Use <a href="/markdown">Markdown</a> syntax.</small><p>
Rotate: Rotate:
<label> <label>
<input type="radio" name="rotate" value="" checked> Leave alone <input type="radio" name="rotate" value="" checked> Leave alone
</label> </label>
<label> <label>
<input type="radio" name="rotate" value="left"> Left 90&deg; <input type="radio" name="rotate" value="left"> Left 90&deg;
</label> </label>
<label> <label>
<input type="radio" name="rotate" value="right"> Right 90&deg; <input type="radio" name="rotate" value="right"> Right 90&deg;
</label> </label>
<label> <label>
<input type="radio" name="rotate" value="180"> 180&deg; <input type="radio" name="rotate" value="180"> 180&deg;
</label><p> </label><p>
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary">Save Changes</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -5,26 +5,26 @@
<h1>Edit Album: {{ album }}</h1> <h1>Edit Album: {{ album }}</h1>
<form id="album-editor" action="{{ url_for('photo.edit_album', album=album) }}" method="POST"> <form id="album-editor" action="{{ url_for('photo.edit_album', album=album) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<strong>Album Title:</strong><br> <strong>Album Title:</strong><br>
<input type="text" class="form-control" size="40" name="name" value="{{ album }}"><p> <input type="text" class="form-control" size="40" name="name" value="{{ album }}"><p>
<strong>Description:</strong><br> <strong>Description:</strong><br>
<textarea class="form-control" cols="50" rows="6" name="description">{{ album_info["description"] }}</textarea><br> <textarea class="form-control" cols="50" rows="6" name="description">{{ album_info["description"] }}</textarea><br>
<small>Use <a href="/markdown" target="_blank">Markdown</a> syntax.</small><p> <small>Use <a href="/markdown" target="_blank">Markdown</a> syntax.</small><p>
<strong>Display Format:</strong><br> <strong>Display Format:</strong><br>
<label> <label>
<input type="radio" name="format" value="classic"{% if album_info["format"] == "classic" %} checked{% endif %}> <input type="radio" name="format" value="classic"{% if album_info["format"] == "classic" %} checked{% endif %}>
<strong>Classic:</strong> Display a grid of thumbnails that must be clicked to view full size images. <strong>Classic:</strong> Display a grid of thumbnails that must be clicked to view full size images.
</label><br> </label><br>
<label> <label>
<input type="radio" name="format" value="vertical"{% if album_info["format"] == "vertical" %} checked{% endif %}> <input type="radio" name="format" value="vertical"{% if album_info["format"] == "vertical" %} checked{% endif %}>
<strong>Vertical:</strong> Display all full size photos in one vertical view. <strong>Vertical:</strong> Display all full size photos in one vertical view.
</label><p> </label><p>
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary">Save Changes</button>
</form> </form>

View File

@ -7,26 +7,26 @@
All captions use <a href="/markdown">Markdown</a> syntax.<p> All captions use <a href="/markdown">Markdown</a> syntax.<p>
<form id="caption-editor" action="{{ url_for('photo.bulk_captions', album=album) }}" method="POST"> <form id="caption-editor" action="{{ url_for('photo.bulk_captions', album=album) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<table width="100%" border="0" cellspacing="4" cellpadding="4"> <table width="100%" border="0" cellspacing="4" cellpadding="4">
{% for photo in photos %} {% for photo in photos %}
<tr> <tr>
<td width="100" align="center" valign="top"> <td width="100" align="center" valign="top">
<img src="{{ app['photo_url'] }}/{{ photo['data']['avatar'] }}" alt="Photo"> <img src="{{ app['photo_url'] }}/{{ photo['data']['avatar'] }}" alt="Photo">
</td> </td>
<td align="left" valign="top"> <td align="left" valign="top">
<strong>Caption:</strong><br> <strong>Caption:</strong><br>
<input type="text" class="form-control" size="40" name="{{ photo['key'] }}:caption" value="{{ photo['data']['caption'] }}"><p> <input type="text" class="form-control" size="40" name="{{ photo['key'] }}:caption" value="{{ photo['data']['caption'] }}"><p>
<strong>Description:</strong><br> <strong>Description:</strong><br>
<textarea class="form-control" cols="50" rows="6" name="{{ photo['key'] }}:description">{{ photo['data']['description'] }}</textarea> <textarea class="form-control" cols="50" rows="6" name="{{ photo['key'] }}:description">{{ photo['data']['description'] }}</textarea>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</table><p> </table><p>
<button type="submit" class="btn btn-primary">Save Changes</button> <button type="submit" class="btn btn-primary">Save Changes</button>
</form> </form>

View File

@ -8,72 +8,72 @@ You can upload a photo from your computer or by pasting in the URL to a photo
somewhere else on the Internet. somewhere else on the Internet.
<form id="upload-form" action="{{ url_for('photo.upload') }}" method="POST" enctype="multipart/form-data"> <form id="upload-form" action="{{ url_for('photo.upload') }}" method="POST" enctype="multipart/form-data">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset> <fieldset>
<legend>Where is your picture located?</legend> <legend>Where is your picture located?</legend>
<label> <label>
<input type="radio" class="location" name="location" value="pc" checked> On my computer <input type="radio" class="location" name="location" value="pc" checked> On my computer
</label> </label>
<label> <label>
<input type="radio" class="location" name="location" value="www"> On the web <input type="radio" class="location" name="location" value="www"> On the web
</label><p> </label><p>
<div id="pic-pc" class="location-div"> <div id="pic-pc" class="location-div">
<strong>Upload a picture from my computer</strong><br> <strong>Upload a picture from my computer</strong><br>
<input type="file" size="30" name="file" id="file-picker" accept="image/*" multiple><p> <input type="file" size="30" name="file" id="file-picker" accept="image/*" multiple><p>
<strong>Or, drag images here:</strong><br> <strong>Or, drag images here:</strong><br>
<div id="dropbox" class="photo-upload-dropbox">Drag and drop images into this box</div> <div id="dropbox" class="photo-upload-dropbox">Drag and drop images into this box</div>
</div> </div>
<div id="pic-www" class="location-div"> <div id="pic-www" class="location-div">
<strong>Upload a picture from the Internet</strong><br> <strong>Upload a picture from the Internet</strong><br>
<input type="text" class="form-control" size="40" name="url" placeholder="http://" autocomplete="off"> <input type="text" class="form-control" size="40" name="url" placeholder="http://" autocomplete="off">
</div> </div>
<p> <p>
Only jpeg, gif and png images are supported. There is no maximum file size Only jpeg, gif and png images are supported. There is no maximum file size
limit, but be reasonable. limit, but be reasonable.
</fieldset> </fieldset>
<p> <p>
<fieldset> <fieldset>
<legend>Photo Options</legend> <legend>Photo Options</legend>
<strong>Photo album:</strong><br> <strong>Photo album:</strong><br>
<select id="album" name="album" class="form-control"> <select id="album" name="album" class="form-control">
<optgroup label="Albums"> <optgroup label="Albums">
{% for album in album_list %} {% for album in album_list %}
<option value="{{ album }}"{% if album == selected %} selected{% endif %}>{{ album }}</option> <option value="{{ album }}"{% if album == selected %} selected{% endif %}>{{ album }}</option>
{% endfor %} {% endfor %}
</optgroup> </optgroup>
<option value="">Create a new album</option> <option value="">Create a new album</option>
</select> </select>
<blockquote id="create-album"> <blockquote id="create-album">
<strong>New album:</strong><br> <strong>New album:</strong><br>
<input type="text" class="form-control" size="20" id="new-album" name="new-album"><p> <input type="text" class="form-control" size="20" id="new-album" name="new-album"><p>
<strong>Album Description:</strong><br> <strong>Album Description:</strong><br>
<textarea cols="50" class="form-control" rows="6" name="new-description"></textarea><br> <textarea cols="50" class="form-control" rows="6" name="new-description"></textarea><br>
<small>Shows up at the top of the album. <small>Shows up at the top of the album.
Use <a href="/markdown" target="_blank">Markdown</a> formatting.</small> Use <a href="/markdown" target="_blank">Markdown</a> formatting.</small>
</blockquote> </blockquote>
</fieldset> </fieldset>
<p> <p>
<fieldset id="upload-progress" style="display: none"> <fieldset id="upload-progress" style="display: none">
<legend>Upload Progress</legend> <legend>Upload Progress</legend>
<div class="upload-trough"> <div class="upload-trough">
<div id="upload-progress-bar" class="upload-progress-bar"></div> <div id="upload-progress-bar" class="upload-progress-bar"></div>
</div> </div>
</fieldset> </fieldset>
<p> <p>
<button type="submit" class="btn btn-primary" id="upload-button">Upload Picture</button> <button type="submit" class="btn btn-primary" id="upload-button">Upload Picture</button>
</form> </form>
@ -82,24 +82,24 @@ somewhere else on the Internet.
{% block scripts %} {% block scripts %}
<script type="text/javascript" src="/rophako/multiupload.js"></script> <script type="text/javascript" src="/rophako/multiupload.js"></script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$("#pic-www").hide(); $("#pic-www").hide();
$("#create-album").hide(); $("#create-album").hide();
$(".location").change(function() { $(".location").change(function() {
$(".location-div").hide(); $(".location-div").hide();
$("#pic-" + $(this).val()).show(); $("#pic-" + $(this).val()).show();
}); });
$("#album").change(function() { $("#album").change(function() {
if ($(this).val() === "") { if ($(this).val() === "") {
$("#create-album").show(); $("#create-album").show();
} }
else { else {
$("#new-album").val(""); $("#new-album").val("");
$("#create-album").hide(); $("#create-album").hide();
} }
}); });
}); });
</script> </script>
{% endblock %} {% endblock %}

View File

@ -3,17 +3,17 @@
{% block content %} {% block content %}
{% macro nav_links() %} {% macro nav_links() %}
<div class="right"> <div class="right">
Photo {{ photo["position"] }} of {{ photo["siblings"] }} Photo {{ photo["position"] }} of {{ photo["siblings"] }}
{% if photo["siblings"] > 1 %} {% if photo["siblings"] > 1 %}
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
[ [
<a href="{{ url_for('photo.view_photo', key=photo['previous']) }}">&lt; Previous</a> <a href="{{ url_for('photo.view_photo', key=photo['previous']) }}">&lt; Previous</a>
| |
<a href="{{ url_for('photo.view_photo', key=photo['next']) }}">Next &gt;</a> <a href="{{ url_for('photo.view_photo', key=photo['next']) }}">Next &gt;</a>
] ]
{% endif %} {% endif %}
</div> </div>
{% endmacro %} {% endmacro %}
<h1>Photo</h1> <h1>Photo</h1>
@ -23,41 +23,41 @@
{{ nav_links() }} {{ nav_links() }}
{% if photo["caption"] %} {% if photo["caption"] %}
<h2>{{ photo["caption"] }}</h2> <h2>{{ photo["caption"] }}</h2>
{% endif %} {% endif %}
<a href="{{ url_for('photo.view_photo', key=photo['next']) }}"> <a href="{{ url_for('photo.view_photo', key=photo['next']) }}">
<img src="{{ app['photo_url'] }}/{{ photo['large'] }}" class="portrait"> <img src="{{ app['photo_url'] }}/{{ photo['large'] }}" class="portrait">
</a><p> </a><p>
{% if photo["description"] %} {% if photo["description"] %}
<div class="photo-description">{{ photo["markdown"]|safe }}</div> <div class="photo-description">{{ photo["markdown"]|safe }}</div>
{% endif %} {% endif %}
<em>Uploaded by {{ author["name"] }} on {{ photo["pretty_time"] }}.</em> <em>Uploaded by {{ author["name"] }} on {{ photo["pretty_time"] }}.</em>
{% if session["login"] %} {% if session["login"] %}
<p>Embed this image in a blog post:<br> <p>Embed this image in a blog post:<br>
<input type="text" class="form-control inline" readonly value="![{{ photo['caption'] }}]({{ app['photo_url'] }}/{{ photo['large'] }})"> (Markdown)<br> <input type="text" class="form-control inline" readonly value="![{{ photo['caption'] }}]({{ app['photo_url'] }}/{{ photo['large'] }})"> (Markdown)<br>
<input type="text" class="form-control inline" readonly value='<img src="{{ app['photo_url'] }}/{{ photo['large'] }}" alt="{{ photo['caption'] }}">'> (HTML) <input type="text" class="form-control inline" readonly value='<img src="{{ app['photo_url'] }}/{{ photo['large'] }}" alt="{{ photo['caption'] }}">'> (HTML)
{% endif %} {% endif %}
{{ nav_links() }} {{ nav_links() }}
{% if session["login"] %} {% if session["login"] %}
<h1>Administrative Options</h1> <h1>Administrative Options</h1>
<ul> <ul>
<li><a href="{{ url_for('photo.upload') }}">Upload a Photo</a></li> <li><a href="{{ url_for('photo.upload') }}">Upload a Photo</a></li>
<li><a href="{{ url_for('photo.set_cover', album=photo['album'], key=photo['key']) }}">Set Album Cover</a></li> <li><a href="{{ url_for('photo.set_cover', album=photo['album'], key=photo['key']) }}">Set Album Cover</a></li>
<li><a href="{{ url_for('photo.set_profile', key=photo['key']) }}">Set as my Profile Picture</a></li> <li><a href="{{ url_for('photo.set_profile', key=photo['key']) }}">Set as my Profile Picture</a></li>
<li><a href="{{ url_for('photo.edit', key=photo['key']) }}">Edit this photo</a></li> <li><a href="{{ url_for('photo.edit', key=photo['key']) }}">Edit this photo</a></li>
<li><a href="{{ url_for('photo.crop', photo=photo['key']) }}">Change Thumbnail</a></li> <li><a href="{{ url_for('photo.crop', photo=photo['key']) }}">Change Thumbnail</a></li>
<li><a href="{{ url_for('photo.delete', key=photo['key']) }}">Delete this photo</a></li> <li><a href="{{ url_for('photo.delete', key=photo['key']) }}">Delete this photo</a></li>
</ul> </ul>
{% endif %} {% endif %}
{{ include_page("comment.partial_index", {{ include_page("comment.partial_index",
thread="photos-{}".format(photo["key"]), thread="photos-{}".format(photo["key"]),
subject="Photo Comment", subject="Photo Comment",
) | safe }} ) | safe }}
{% endblock %} {% endblock %}

View File

@ -6,8 +6,8 @@
<h1>Visitor Tracking</h1> <h1>Visitor Tracking</h1>
<ul> <ul>
<li><a href="{{ url_for('tracking.visitors') }}">Unique Visitors &amp; Visits</a></li> <li><a href="{{ url_for('tracking.visitors') }}">Unique Visitors &amp; Visits</a></li>
<li><a href="{{ url_for('tracking.referrers') }}">HTTP Referrers</a></li> <li><a href="{{ url_for('tracking.referrers') }}">HTTP Referrers</a></li>
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -10,26 +10,26 @@ the most recent 25 links, see <a href="#recent">the end of this page</a>.<p>
<div style="height: 450px; overflow: auto"> <div style="height: 450px; overflow: auto">
<table class="table" width="100%"> <table class="table" width="100%">
<thead> <thead>
<tr> <tr>
<th width="40">Hits</th> <th width="40">Hits</th>
<th>Query</th> <th>Query</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for link in referrers["referrers"] %} {% for link in referrers["referrers"] %}
{% if link %} {% if link %}
<tr> <tr>
<td align="center" valign="top"> <td align="center" valign="top">
{{ link[1] }} {{ link[1] }}
</td> </td>
<td align="left" valign="top" style="position: relative"> <td align="left" valign="top" style="position: relative">
{{ link[0]|safe }} {{ link[0]|safe }}
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
@ -37,7 +37,7 @@ the most recent 25 links, see <a href="#recent">the end of this page</a>.<p>
<ol> <ol>
{% for item in referrers["recent"] %} {% for item in referrers["recent"] %}
<li>{{ item }}</li> <li>{{ item }}</li>
{% endfor %} {% endfor %}
</ol> </ol>

View File

@ -17,38 +17,38 @@ Here is a full list of hits over time. Percentages are relative to the current
records.<p> records.<p>
<table class="table" width="100%" border="0" cellspacing="2" cellpadding="2"> <table class="table" width="100%" border="0" cellspacing="2" cellpadding="2">
<thead> <thead>
<tr> <tr>
<th width="20">Date</th> <th width="20">Date</th>
<th>Graph</th> <th>Graph</th>
<th width="250">Details</th> <th width="250">Details</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for date in history["traffic"]|reverse %} {% for date in history["traffic"]|reverse %}
<tr> <tr>
<td align="center" valign="middle" rowspan="2"> <td align="center" valign="middle" rowspan="2">
{{ date["date"] }} {{ date["date"] }}
</td> </td>
<td align="left" valign="middle"> <td align="left" valign="middle">
{% set pct = (date["unique"] / history["most_unique"][1]) * 100 %} {% set pct = (date["unique"] / history["most_unique"][1]) * 100 %}
<div class="visitor-graph unique" style="width: {{ pct|int }}%"></div> <div class="visitor-graph unique" style="width: {{ pct|int }}%"></div>
</td> </td>
<td align="left" valign="middle"> <td align="left" valign="middle">
Unique: {{ date["unique"] }} ({{ pct|int }}%) Unique: {{ date["unique"] }} ({{ pct|int }}%)
</td> </td>
</tr> </tr>
<tr> <tr>
<td align="left" valign="middle"> <td align="left" valign="middle">
{% set pct = (date["unique"] / history["most_unique"][1]) * 100 %} {% set pct = (date["unique"] / history["most_unique"][1]) * 100 %}
<div class="visitor-graph hits" style="width: {{ pct|int }}%"></div> <div class="visitor-graph hits" style="width: {{ pct|int }}%"></div>
</td> </td>
<td align="left" valign="middle"> <td align="left" valign="middle">
Hits: {{ date["hits"] }} ({{ pct|int }}%) Hits: {{ date["hits"] }} ({{ pct|int }}%)
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% endblock %} {% endblock %}

View File

@ -7,8 +7,8 @@
Are you sure you want to delete this {{ type }}?<p> Are you sure you want to delete this {{ type }}?<p>
<form name="confirm" action="{{ confirm_url }}" method="POST"> <form name="confirm" action="{{ confirm_url }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-primary" name="confirm" value="true">Confirm Deletion</button> <button type="submit" class="btn btn-primary" name="confirm" value="true">Confirm Deletion</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -3,37 +3,37 @@
{% block content %} {% block content %}
{% if preview %} {% if preview %}
<h1>Preview: {{ subject }}</h1> <h1>Preview: {{ subject }}</h1>
{{ rendered_body|safe }} {{ rendered_body|safe }}
<hr> <hr>
{% endif %} {% endif %}
<h1>Edit Wiki</h1> <h1>Edit Wiki</h1>
<form name="editor" action="{{ url_for('wiki.edit') }}" method="POST"> <form name="editor" action="{{ url_for('wiki.edit') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}"> <input type="hidden" name="token" value="{{ csrf_token() }}">
<strong>Title:</strong><br> <strong>Title:</strong><br>
<input type="text" class="form-control" size="80" name="name" value="{{ title }}"><p> <input type="text" class="form-control" size="80" name="name" value="{{ title }}"><p>
<strong>Body:</strong><br> <strong>Body:</strong><br>
<textarea class="form-control input-lg" cols="80" rows="20" name="body">{{ body }}</textarea><br> <textarea class="form-control input-lg" cols="80" rows="20" name="body">{{ body }}</textarea><br>
Markdown syntax. Markdown syntax.
<a href="{{ url_for('emoticons.index') }}" target="_blank">Emoticon reference</a> (opens in new window)<p> <a href="{{ url_for('emoticons.index') }}" target="_blank">Emoticon reference</a> (opens in new window)<p>
<strong>Revision Note (optional):</strong><br> <strong>Revision Note (optional):</strong><br>
<input type="text" class="form-control" size="80" name="note" value="{{ note }}"><p> <input type="text" class="form-control" size="80" name="note" value="{{ note }}"><p>
<strong>Options:</strong><br> <strong>Options:</strong><br>
<label> <label>
<input type="checkbox" name="history" value="true"{% if history %} checked{% endif %}> Add this revision to the page history <input type="checkbox" name="history" value="true"{% if history %} checked{% endif %}> Add this revision to the page history
(if unchecked, it will replace the most recent version with this version) (if unchecked, it will replace the most recent version with this version)
</label><p> </label><p>
<button type="submit" class="btn btn-default" name="action" value="preview">Preview</button> <button type="submit" class="btn btn-default" name="action" value="preview">Preview</button>
<button type="submit" class="btn btn-primary" name="action" value="publish">Publish</button> <button type="submit" class="btn btn-primary" name="action" value="publish">Publish</button>
</form> </form>
{% endblock %} {% endblock %}

View File

@ -5,36 +5,36 @@
<h1>History: {{ title }}</h1> <h1>History: {{ title }}</h1>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>Edited By</th> <th>Edited By</th>
<th>Revision Note</th> <th>Revision Note</th>
{% if session["login"] %} {% if session["login"] %}
<th>Delete?</th> <th>Delete?</th>
{% endif %} {% endif %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for item in history %} {% for item in history %}
<tr> <tr>
<td>{{ item["pretty_time"] }}</td> <td>{{ item["pretty_time"] }}</td>
<td>{{ item["author"]["name"] }}</td> <td>{{ item["author"]["name"] }}</td>
<td><a href="{{ url_for('wiki.view_page', name=link, revision=item['id']) }}">{{ item["note"] }}</a></td> <td><a href="{{ url_for('wiki.view_page', name=link, revision=item['id']) }}">{{ item["note"] }}</a></td>
{% if session["login"] %} {% if session["login"] %}
<td><a href="{{ url_for('wiki.delete_revision', name=link, revision=item['id']) }}">Delete</a></td> <td><a href="{{ url_for('wiki.delete_revision', name=link, revision=item['id']) }}">Delete</a></td>
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% if session["login"] %} {% if session["login"] %}
<p> <p>
<strong>Admin Actions:</strong> <strong>Admin Actions:</strong>
<ul> <ul>
<li><a href="{{ url_for('wiki.delete_page', name=link) }}">Delete Page</a></li> <li><a href="{{ url_for('wiki.delete_page', name=link) }}">Delete Page</a></li>
</ul> </ul>
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View File

@ -3,17 +3,17 @@
{% block content %} {% block content %}
{% if session["login"] %} {% if session["login"] %}
<div class="right"> <div class="right">
[ <a href="{{ url_for('wiki.edit') }}">New Page</a> ] [ <a href="{{ url_for('wiki.edit') }}">New Page</a> ]
</div> </div>
{% endif %} {% endif %}
<h1>Wiki Pages</h1> <h1>Wiki Pages</h1>
<ul> <ul>
{% for page in pages %} {% for page in pages %}
<li><a href="{{ url_for('wiki.view_page', name=page['link']) }}">{{ page['name'] }}</a></li> <li><a href="{{ url_for('wiki.view_page', name=page['link']) }}">{{ page['name'] }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endblock %} {% endblock %}

View File

@ -8,7 +8,7 @@ This wiki page does not exist yet (that means it's a 404 error!)
{% if session["login"] %} {% if session["login"] %}
<ul> <ul>
<li><a href="{{ url_for('wiki.edit', name=title, note='Created initial page.') }}">Create This Page</a></li> <li><a href="{{ url_for('wiki.edit', name=title, note='Created initial page.') }}">Create This Page</a></li>
</ul> </ul>
{% endif %} {% endif %}

View File

@ -3,16 +3,16 @@
{% block content %} {% block content %}
<div class="right"> <div class="right">
Last edited by {{ author["name"] }} on {{ pretty_time }} Last edited by {{ author["name"] }} on {{ pretty_time }}
[ <a href="{{ url_for('wiki.history', name=link) }}">History</a> [ <a href="{{ url_for('wiki.history', name=link) }}">History</a>
| <a href="{{ url_for('wiki.list_pages') }}">Index</a> | <a href="{{ url_for('wiki.list_pages') }}">Index</a>
| <a href="{{ url_for('wiki.view_page', name=link, source='1') }}">Source</a> | <a href="{{ url_for('wiki.view_page', name=link, source='1') }}">Source</a>
{% if session["login"] %} {% if session["login"] %}
| <a href="{{ url_for('wiki.edit', name=title) }}">Edit</a> | <a href="{{ url_for('wiki.edit', name=title) }}">Edit</a>
| <a href="{{ url_for('wiki.edit') }}">New Page</a> | <a href="{{ url_for('wiki.edit') }}">New Page</a>
{% endif %} {% endif %}
] ]
</div> </div>
<h1 class="wiki-title">{{ title }}</h1> <h1 class="wiki-title">{{ title }}</h1>

View File

@ -18,62 +18,62 @@ Github!</a><p>
<h2>Features</h2> <h2>Features</h2>
<ul> <ul>
<li><strong>Web Blog</strong> <li><strong>Web Blog</strong>
<ul> <ul>
<li>Rophako's primary feature, apart from being a general content <li>Rophako's primary feature, apart from being a general content
management system, is to be a web blog. The blog supports having management system, is to be a web blog. The blog supports having
multiple authors and having multiple avatars (you can upload an multiple authors and having multiple avatars (you can upload an
avatar for each topic your blog covers, and select the avatar when avatar for each topic your blog covers, and select the avatar when
you post an entry).</li> you post an entry).</li>
<li>There's a built-in RSS feed for the blog so your readers can <li>There's a built-in RSS feed for the blog so your readers can
follow it in their RSS readers.</li> follow it in their RSS readers.</li>
<li>Tag your blog posts with a list of categories and enable your <li>Tag your blog posts with a list of categories and enable your
readers to use them to read just the posts they're interested in.</li> readers to use them to read just the posts they're interested in.</li>
<li>Blog posts can be commented on by guests on the Internet.</li> <li>Blog posts can be commented on by guests on the Internet.</li>
<li>Include graphical emoticons in your blog posts!</li> <li>Include graphical emoticons in your blog posts!</li>
</ul></li> </ul></li>
<li><strong>Photo Albums</strong> <li><strong>Photo Albums</strong>
<ul> <ul>
<li>Upload as many pictures as you want to photo albums on your site. <li>Upload as many pictures as you want to photo albums on your site.
The default settings allow for having relatively high-resolution The default settings allow for having relatively high-resolution
photos (800 pixels wide), and thumbnailing is done automatically.</li> photos (800 pixels wide), and thumbnailing is done automatically.</li>
<li>The staff user accounts on your site can pick a photo from the <li>The staff user accounts on your site can pick a photo from the
albums to be "their" profile photo, which will be used on their albums to be "their" profile photo, which will be used on their
blog posts and comments (if they don't select one of the blog blog posts and comments (if they don't select one of the blog
avatars instead).</li> avatars instead).</li>
<li>Photos, like blog posts, can be commented on.</li> <li>Photos, like blog posts, can be commented on.</li>
<li>Drag-and-drop user interface to rearrange your photos and photo <li>Drag-and-drop user interface to rearrange your photos and photo
albums.</li> albums.</li>
</ul></li> </ul></li>
<li><strong>Comments</strong> <li><strong>Comments</strong>
<ul> <ul>
<li>Comments can be left by anyone on the Internet. A reverse CAPTCHA <li>Comments can be left by anyone on the Internet. A reverse CAPTCHA
is used that stops random spam bots from posting comments.</li> is used that stops random spam bots from posting comments.</li>
<li>Comments can include graphical emoticons, like blog posts.</li> <li>Comments can include graphical emoticons, like blog posts.</li>
<li>Commenters can subscribe to a comment thread when they post, so that <li>Commenters can subscribe to a comment thread when they post, so that
they'll receive e-mail notifications when somebody else replies to they'll receive e-mail notifications when somebody else replies to
that thread. Unsubscribing is easy, too.</li> that thread. Unsubscribing is easy, too.</li>
<li>If a commenter leaves their e-mail address, <li>If a commenter leaves their e-mail address,
<a href="http://www.gravatar.com/" target="_blank">Gravatar</a> <a href="http://www.gravatar.com/" target="_blank">Gravatar</a>
avatars are used. If they don't have a Gravatar, you can specify avatars are used. If they don't have a Gravatar, you can specify
the default fall-back avatar to use.</li> the default fall-back avatar to use.</li>
</ul></li> </ul></li>
<li><strong>Dual Template System</strong> <li><strong>Dual Template System</strong>
<ul> <ul>
<li>When Rophako wants to show the user a page, it first looks in your <li>When Rophako wants to show the user a page, it first looks in your
custom site's template folder before defaulting to its built-in custom site's template folder before defaulting to its built-in
templates.</li> templates.</li>
<li>All of Rophako's core features (including this page!) have templates <li>All of Rophako's core features (including this page!) have templates
built in. So, you don't need to write any HTML code to get blogs, built in. So, you don't need to write any HTML code to get blogs,
photo albums and everything else working!</li> photo albums and everything else working!</li>
<li>If you want to customize Rophako's built-in pages (for example, the <li>If you want to customize Rophako's built-in pages (for example, the
blog templates), you can just add files to your custom site's folder blog templates), you can just add files to your custom site's folder
with the same file names. Rophako will use your templates instead with the same file names. Rophako will use your templates instead
of its own!</li> of its own!</li>
</ul></li> </ul></li>
</ul> </ul>
{{ include_page("blog.partial_index") | safe }} {{ include_page("blog.partial_index") | safe }}

View File

@ -1,69 +1,69 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="/css/codehilite.css"> <link rel="stylesheet" type="text/css" href="/css/codehilite.css">
<link rel="stylesheet" type="text/css" href="/smoke/style.css"> <link rel="stylesheet" type="text/css" href="/smoke/style.css">
</head> </head>
<body> <body>
<header> <header>
<a href="/"> <a href="/">
<img src="/smoke/firemarble.png" width="161" height="169" alt="Logo"> <img src="/smoke/firemarble.png" width="161" height="169" alt="Logo">
</a> </a>
<span>Rophako</span> <span>Rophako</span>
</header> </header>
<nav> <nav>
<ul> <ul>
<li class="header">:: Navigation</li> <li class="header">:: Navigation</li>
<li><a href="/">Home</a></li> <li><a href="/">Home</a></li>
<li><a href="/photos/albums">Photo Albums</a></li> <li><a href="/photos/albums">Photo Albums</a></li>
<li><a href="https://github.com/kirsle/rophako" target="_blank">View on Github</a></li> <li><a href="https://github.com/kirsle/rophako" target="_blank">View on Github</a></li>
<li><a href="https://github.com/kirsle/rophako/archive/master.zip">Download</a></li> <li><a href="https://github.com/kirsle/rophako/archive/master.zip">Download</a></li>
<li class="header">:: Site Admin</li> <li class="header">:: Site Admin</li>
{% if session["login"] %} {% if session["login"] %}
{% if session["role"] == "admin" %} {% if session["role"] == "admin" %}
<li><a href="{{ url_for('admin.index') }}">Admin Center</a></li> <li><a href="{{ url_for('admin.index') }}">Admin Center</a></li>
{% endif %} {% endif %}
<li><a href="{{ url_for('blog.update') }}">Update Blog</a></li> <li><a href="{{ url_for('blog.update') }}">Update Blog</a></li>
{% if "impersonator" in session %} {% if "impersonator" in session %}
<li><a href="{{ url_for('admin.unimpersonate') }}">Unimpersonate</a> <li><a href="{{ url_for('admin.unimpersonate') }}">Unimpersonate</a>
{% endif %} {% endif %}
<li><a href="{{ url_for('account.logout') }}">Log out {{ session["username"] }}</a></li> <li><a href="{{ url_for('account.logout') }}">Log out {{ session["username"] }}</a></li>
{% else %} {% else %}
<li><a href="{{ url_for('account.login') }}">Log in</a></li> <li><a href="{{ url_for('account.login') }}">Log in</a></li>
{% endif %} {% endif %}
</ul> </ul>
</nav> </nav>
<div id="content"> <div id="content">
{% with messages = get_flashed_messages() %} {% with messages = get_flashed_messages() %}
{% if messages %} {% if messages %}
<h1>Notice!</h1> <h1>Notice!</h1>
<ul> <ul>
{% for message in messages %} {% for message in messages %}
<li>{{ message }}</li> <li>{{ message }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
<footer> <footer>
<div> <div>
&copy; {{ strftime("%Y") }} Noah Petherbridge. Web design released along with the Rophako CMS &copy; {{ strftime("%Y") }} Noah Petherbridge. Web design released along with the Rophako CMS
under the GNU General Public License v2.0.<br> under the GNU General Public License v2.0.<br>
<a href="https://github.com/kirsle/rophako" target="_blank"> <a href="https://github.com/kirsle/rophako" target="_blank">
{{ app["name"] }} v{{ app["version"] }} on Python {{ app["python_version"] }} {{ app["name"] }} v{{ app["version"] }} on Python {{ app["python_version"] }}
</a> </a>
</div> </div>
</footer> </footer>
</div> </div>
<script type="text/javascript" src="/js/jquery-2.1.0.min.js"></script> <script type="text/javascript" src="/js/jquery-2.1.0.min.js"></script>

View File

@ -73,7 +73,7 @@ get translated into a line break (<code>&lt;br&gt;</code>) in the output.
<code> <code>
This is an H1<br> This is an H1<br>
=============<p> =============<p>
This is an H2<br> This is an H2<br>
------------- -------------
</code> </code>
@ -293,12 +293,12 @@ get translated into a line break (<code>&lt;br&gt;</code>) in the output.
<td> <td>
<ol> <ol>
<li>This is a list item with two paragraphs. Lorem ipsum dolor <li>This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.<p> mi posuere lectus.<p>
Vestibulum enim wisi, viverra nec, fringilla in, laoreet Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.</li> sit amet velit.</li>
<li>Suspendisse id sem consectetuer libero luctus adipiscing.</li> <li>Suspendisse id sem consectetuer libero luctus adipiscing.</li>
</ol> </ol>

View File

@ -7,74 +7,74 @@
*********************/ *********************/
body { body {
background-image: url("navbg.png"); background-image: url("navbg.png");
background-position: 0 0; background-position: 0 0;
background-repeat: repeat-y; background-repeat: repeat-y;
background-color: #CFCFCF; background-color: #CFCFCF;
font-family: Ubuntu,Verdana,Arial,Helvetica,sans-serif; font-family: Ubuntu,Verdana,Arial,Helvetica,sans-serif;
font-size: small; font-size: small;
color: #000000; color: #000000;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
small { small {
font-size: 9pt; font-size: 9pt;
} }
a:link, a:visited { a:link, a:visited {
color: #FF4400; color: #FF4400;
text-decoration: underline; text-decoration: underline;
} }
a img { a img {
border: 0; border: 0;
} }
h1, h1,
h2, h2,
h3, h3,
h4 { h4 {
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
text-shadow: 2px 2px 4px #FF4444; text-shadow: 2px 2px 4px #FF4444;
padding: 0; padding: 0;
margin: 15px 0; margin: 15px 0;
} }
h1 { h1 {
font-size: 34pt; font-size: 34pt;
} }
h1:first-of-type { h1:first-of-type {
margin-top: 0; margin-top: 0;
} }
h2 { h2 {
font-size: 28pt; font-size: 28pt;
} }
h3 { h3 {
font-size: 24pt; font-size: 24pt;
} }
h4 { h4 {
font-size: 18pt; font-size: 18pt;
} }
fieldset { fieldset {
display: block; display: block;
border: 1px solid #666666; border: 1px solid #666666;
} }
fieldset legend { fieldset legend {
font-weight: bold; font-weight: bold;
} }
/* Markdown Code-Hilite class overrides. */ /* Markdown Code-Hilite class overrides. */
.codehilite { .codehilite {
border: 1px dashed #000000; border: 1px dashed #000000;
padding: 0px 20px; padding: 0px 20px;
background-color: transparent; background-color: transparent;
} }
pre, code { pre, code {
font-family: "DejaVu Sans Mono","Ubuntu Mono","Lucida Console","Courier New","Courier",monospace; font-family: "DejaVu Sans Mono","Ubuntu Mono","Lucida Console","Courier New","Courier",monospace;
font-size: 10pt; font-size: 10pt;
} }
/* Use responsive images in Markdown code. */ /* Use responsive images in Markdown code. */
@ -89,234 +89,234 @@ pre, code {
*********************/ *********************/
.right { .right {
text-align: right; text-align: right;
} }
.center { .center {
text-align: center; text-align: center;
} }
.clear { .clear {
clear: both; clear: both;
} }
table.table, table.table,
table.table th, table.table th,
table.table td { table.table td {
border: 1px solid #999999; border: 1px solid #999999;
} }
table.table { table.table {
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
} }
table.table-wide { table.table-wide {
width: 100%; width: 100%;
} }
table.table th { table.table th {
background-color: #333333; background-color: #333333;
color: #FFFFFF; color: #FFFFFF;
text-align: left; text-align: left;
padding: 4px; padding: 4px;
} }
table.table tr:nth-child(even) { table.table tr:nth-child(even) {
background-color: #FFFFFF; background-color: #FFFFFF;
} }
table.table tr:nth-child(odd) { table.table tr:nth-child(odd) {
background-color: #CFCFCF; background-color: #CFCFCF;
} }
table.table td { table.table td {
padding: 4px; padding: 4px;
} }
/* Photo Upload page */ /* Photo Upload page */
.photo-upload-dropbox { .photo-upload-dropbox {
border: 2px dashed #000000; border: 2px dashed #000000;
padding: 40px; padding: 40px;
} }
.photo-upload-dropbox.active { .photo-upload-dropbox.active {
border: 4px dashed #FF0000; border: 4px dashed #FF0000;
} }
.upload-trough { .upload-trough {
position: relative; position: relative;
border: 1px solid #000000; border: 1px solid #000000;
width: 100%; width: 100%;
height: 28px; height: 28px;
} }
.upload-progress-bar { .upload-progress-bar {
position: relative; position: relative;
width: 0%; width: 0%;
height: 100%; height: 100%;
background-color: #FF9900; background-color: #FF9900;
} }
/* Photo Grids: see http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */ /* Photo Grids: see http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
ul.photo-grid { ul.photo-grid {
list-style: none; list-style: none;
display: inline; display: inline;
margin: 0; margin: 0;
padding: 0; padding: 0;
position: relative; position: relative;
} }
ul.photo-grid li { ul.photo-grid li {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 260px; width: 260px;
height: 260px; height: 260px;
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
} }
ul.photo-grid li .dummy { ul.photo-grid li .dummy {
padding-top: 100%; padding-top: 100%;
} }
.photo-grid-item { .photo-grid-item {
cursor: pointer; cursor: pointer;
overflow: hidden; /* Crop off long names, etc. */ overflow: hidden; /* Crop off long names, etc. */
/* We use absolute positioning to detach this element from the flow, */ /* We use absolute positioning to detach this element from the flow, */
/* allowing the .dummy to dictate the height of the square. */ /* allowing the .dummy to dictate the height of the square. */
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.photo-grid-item img { .photo-grid-item img {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.photo-grid-item .name { .photo-grid-item .name {
position: absolute; position: absolute;
top: 4px; top: 4px;
left: 4px; left: 4px;
right: 4px; right: 4px;
font-family: Arial,Helvetica,sans-serif; font-family: Arial,Helvetica,sans-serif;
font-size: 14pt; font-size: 14pt;
font-weight: bold; font-weight: bold;
color: #FFFFFF; color: #FFFFFF;
text-align: left; text-align: left;
text-shadow: 1px 1px 0px #000000, text-shadow: 1px 1px 0px #000000,
-1px -1px 0px #000000, -1px -1px 0px #000000,
1px -1px 0px #000000, 1px -1px 0px #000000,
-1px 1px 0px #000000; -1px 1px 0px #000000;
} }
/* Make a photo look nice. */ /* Make a photo look nice. */
.portrait { .portrait {
display: inline; display: inline;
background-color: #CFCFCF; background-color: #CFCFCF;
padding: 4px; padding: 4px;
border: 1px solid #000000; border: 1px solid #000000;
box-shadow: 0px 0px 4px #FF4444; box-shadow: 0px 0px 4px #FF4444;
} }
/* Photo description blocks */ /* Photo description blocks */
.photo-description { .photo-description {
display: block; display: block;
border: 1px solid #000000; border: 1px solid #000000;
box-shadow: 0px 0px 4px #000000; box-shadow: 0px 0px 4px #000000;
padding: 10px; padding: 10px;
margin: 20px 0px; margin: 20px 0px;
background-color: #646464; background-color: #646464;
color: #FFFFFF; color: #FFFFFF;
width: 790px; width: 790px;
} }
/* Blog titles when shown on index view */ /* Blog titles when shown on index view */
a.blog-title-index:link, a.blog-title-index:visited { a.blog-title-index:link, a.blog-title-index:visited {
font-size: 32pt; font-size: 32pt;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
text-decoration: none; text-decoration: none;
text-shadow: 2px 2px 4px #FF4444; text-shadow: 2px 2px 4px #FF4444;
} }
a.blog-title-index:hover, a.blog-title-index:active { a.blog-title-index:hover, a.blog-title-index:active {
text-decoration: underline; text-decoration: underline;
text-shadow: 2px 2px 4px #FF4444; text-shadow: 2px 2px 4px #FF4444;
} }
/* Poster's avatar box */ /* Poster's avatar box */
.blog-author, .comment-author { .blog-author, .comment-author {
float: right; float: right;
background-color: #999999; background-color: #999999;
border: 1px solid #000000; border: 1px solid #000000;
padding: 2px; padding: 2px;
margin-left: 10px; margin-left: 10px;
margin-bottom: 10px; margin-bottom: 10px;
width: 100px; /* 96 avatar width + 4px padding */ width: 100px; /* 96 avatar width + 4px padding */
text-align: center; text-align: center;
font-weight: bold font-weight: bold
} }
.blog-author a, .comment-author a { .blog-author a, .comment-author a {
text-decoration: none; text-decoration: none;
} }
div.siikir-avatar { div.siikir-avatar {
width: 96px; width: 96px;
margin: auto; margin: auto;
} }
/* Timestamp and author line below blog titles */ /* Timestamp and author line below blog titles */
.blog-timestamp { .blog-timestamp {
font-style: italic; font-style: italic;
padding-left: 30px; padding-left: 30px;
padding-top: 5px; padding-top: 5px;
padding-bottom: 10px padding-bottom: 10px
} }
ul.blog-categories { ul.blog-categories {
list-style: none; list-style: none;
display: inline; display: inline;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
ul.blog-categories li { ul.blog-categories li {
display: inline; display: inline;
} }
ul.blog-categories li:after { ul.blog-categories li:after {
content: ", "; content: ", ";
} }
ul.blog-categories li:last-child:after { ul.blog-categories li:last-child:after {
content: ""; content: "";
} }
/* Blog comment wrapper */ /* Blog comment wrapper */
.comment { .comment {
border: 1px dashed #006699; border: 1px dashed #006699;
padding: 5px padding: 5px
} }
/* Style overrides for comments */ /* Style overrides for comments */
.comment h1 { .comment h1 {
font-size: 14pt; font-size: 14pt;
} }
.comment h2 { .comment h2 {
font-size: 12pt; font-size: 12pt;
} }
.comment h3 { .comment h3 {
font-size: 10pt; font-size: 10pt;
} }
.comment h4 { .comment h4 {
font-size: 9pt; font-size: 9pt;
} }
/* Wiki styles */ /* Wiki styles */
a.wiki-broken { a.wiki-broken {
text-decoration: line-through; text-decoration: line-through;
} }
/* Visitor history page */ /* Visitor history page */
@ -341,90 +341,90 @@ a.wiki-broken {
*********************/ *********************/
header { header {
display: block; display: block;
background-image: url("header.png"); background-image: url("header.png");
background-position: left bottom; background-position: left bottom;
background-repeat: repeat-x; background-repeat: repeat-x;
margin: 0; margin: 0;
height: 174px; height: 174px;
} }
header img { header img {
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 16px; left: 16px;
width: 161px; width: 161px;
height: 169px; height: 169px;
} }
header span { header span {
font-size: 72pt; font-size: 72pt;
font-weight: bold; font-weight: bold;
font-style: italic; font-style: italic;
line-height: 169px; line-height: 169px;
color: #CFCFCF; color: #CFCFCF;
margin-left: 220px; margin-left: 220px;
} }
nav { nav {
position: absolute; position: absolute;
top: 180px; top: 180px;
left: 0px; left: 0px;
width: 200px; width: 200px;
} }
nav ul { nav ul {
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
nav ul li { nav ul li {
display: block; display: block;
line-height: 1.5em; line-height: 1.5em;
padding-left: 10px; padding-left: 10px;
color: #FFFFFF; color: #FFFFFF;
} }
nav ul li.header { nav ul li.header {
background-image: url("navhead.png"); background-image: url("navhead.png");
background-repeat: no-repeat; background-repeat: no-repeat;
height: 34px; height: 34px;
line-height: 34px; line-height: 34px;
font-weight: bold; font-weight: bold;
color: #000000; color: #000000;
margin: 8px 0px; margin: 8px 0px;
} }
nav a:link, nav a:visited { nav a:link, nav a:visited {
color: #FFFFFF; color: #FFFFFF;
text-decoration: none; text-decoration: none;
} }
nav a:hover, nav a:active { nav a:hover, nav a:active {
text-decoration: underline; text-decoration: underline;
} }
#content { #content {
position: absolute; position: absolute;
top: 180px; top: 180px;
left: 220px; left: 220px;
right: 20px; right: 20px;
} }
footer { footer {
display: block; display: block;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
color: #666666; color: #666666;
margin: 40px 0px; margin: 40px 0px;
} }
footer div { footer div {
display: block; display: block;
width: 400px; width: 400px;
margin: auto; margin: auto;
} }
footer a:link, footer a:visited { footer a:link, footer a:visited {
color: #666666; color: #666666;
} }