Spaces to tabs in HTML and CSS

This commit is contained in:
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">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset>
<legend>Log In</legend>
<legend>Log In</legend>
<strong>Username:</strong><br>
<input type="text" class="form-control" size="20" name="username" id="username"><p>
<strong>Username:</strong><br>
<input type="text" class="form-control" size="20" name="username" id="username"><p>
<strong>Passphrase:</strong><br>
<input type="password" class="form-control" size="20" name="password"><p>
<strong>Passphrase:</strong><br>
<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>
</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">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<fieldset>
<legend>Admin User</legend>
<legend>Admin User</legend>
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
a typical username.<p>
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
a typical username.<p>
<strong>Username:</strong><br>
<input type="text" class="form-control" size="40" name="username" id="username" placeholder="admin"><p>
<strong>Username:</strong><br>
<input type="text" class="form-control" size="40" name="username" id="username" placeholder="admin"><p>
<strong>Real name:</strong><br>
<input type="text" class="form-control" size="40" name="name" placeholder="John Doe"><p>
<strong>Real name:</strong><br>
<input type="text" class="form-control" size="40" name="name" placeholder="John Doe"><p>
<strong>Passphrase:</strong><br>
This can be as long as you want. Pick something
<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>
<strong>Passphrase:</strong><br>
This can be as long as you want. Pick something
<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>
<strong>Confirm Passphrase:</strong><br>
<input type="password" class="form-control" size="40" id="pw2" name="password2" placeholder="correct horse battery staple"><p>
<strong>Confirm Passphrase:</strong><br>
<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>
</form>

View File

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

View File

@ -6,14 +6,14 @@
<h1>Admin Center</h1>
<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>
<h1>Maintenance Tasks</h1>
<ul>
<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_blog_index') }}">Rebuild Blog Index</a></li>
<li><a href="{{ url_for('admin.rebuild_visitor_counts') }}">Rebuild Visitor Counts</a></li>
</ul>
{% endblock %}

View File

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

View File

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

View File

@ -1,19 +1,19 @@
{% for tag in tags %}
{% if not tag["small"] %}
&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small><br>
{% endif %}
{% if not tag["small"] %}
&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small><br>
{% endif %}
{% endfor %}
{% if has_small %}
<div id="blog_show_more" style="display: none">
{% for tag in tags %}
{% if tag["small"] %}
&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small><br>
{% endif %}
{% endfor %}
</div>
<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>
</div>
<div id="blog_show_more" style="display: none">
{% for tag in tags %}
{% if tag["small"] %}
&#0187; <a href="{{ url_for('blog.category', category=tag['category']) }}">{{ tag['category'] }}</a>
<small>({{ tag['count'] }})</small><br>
{% endif %}
{% endfor %}
</div>
<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>
</div>
{% endif %}

View File

@ -5,13 +5,13 @@
<h1>Delete Entry</h1>
<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="confirm" value="true">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="confirm" value="true">
Are you sure you want to delete the blog post,
"{{ subject }}"?<p>
Are you sure you want to delete the blog post,
"{{ subject }}"?<p>
<button type="submit" class="btn btn-warning">Confirm Deletion</button>
<button type="submit" class="btn btn-warning">Confirm Deletion</button>
</form>
{% endblock %}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,159 +3,159 @@
{% block content %}
{% if preview %}
<h1>Preview: {{ subject }}</h1>
<h1>Preview: {{ subject }}</h1>
{{ rendered_body|safe }}
{{ rendered_body|safe }}
<hr>
<hr>
{% endif %}
<h1>Update Blog</h1>
<form name="editor" action="{{ url_for('blog.update') }}" method="POST">
<input type="hidden" name="id" value="{{ post_id }}">
<input type="hidden" name="author" value="{{ author }}">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="id" value="{{ post_id }}">
<input type="hidden" name="author" value="{{ author }}">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<strong>Subject:</strong><br>
<input type="text" class="form-control" size="80" name="subject" value="{{ subject }}"><p>
<strong>Subject:</strong><br>
<input type="text" class="form-control" size="80" name="subject" value="{{ subject }}"><p>
<strong>Friendly ID:</strong><br>
You can leave this blank if this is a new post. It defaults to be based
on the subject.<br>
<input type="text" class="form-control" size="80" name="fid" value="{{ fid }}"><p>
<strong>Friendly ID:</strong><br>
You can leave this blank if this is a new post. It defaults to be based
on the subject.<br>
<input type="text" class="form-control" size="80" name="fid" value="{{ fid }}"><p>
<strong>Body:</strong><br>
<label>
<input type="radio" name="format" value="markdown"{% if format == "markdown" %} checked{% endif %}> Markdown
</label>
<label>
<input type="radio" name="format" value="html"{% if format == "html" %} checked{% endif %}> HTML
</label><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="{{ 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>
where you want the division to appear.<p>
<strong>Body:</strong><br>
<label>
<input type="radio" name="format" value="markdown"{% if format == "markdown" %} checked{% endif %}> Markdown
</label>
<label>
<input type="radio" name="format" value="html"{% if format == "html" %} checked{% endif %}> HTML
</label><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="{{ 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>
where you want the division to appear.<p>
<strong>Avatar:</strong><br>
<span id="avatar-preview"></span>
<select name="avatar" id="avatar" class="form-control">
<option value=""{% if avatar == "" %} selected{% endif %}>Use my profile picture</option>
{% for pic in avatars %}
<option value="{{ pic }}"{% if avatar == pic %} selected{% endif %}>{{ pic }}</option>
{% endfor %}
</select><p>
<strong>Avatar:</strong><br>
<span id="avatar-preview"></span>
<select name="avatar" id="avatar" class="form-control">
<option value=""{% if avatar == "" %} selected{% endif %}>Use my profile picture</option>
{% for pic in avatars %}
<option value="{{ pic }}"{% if avatar == pic %} selected{% endif %}>{{ pic }}</option>
{% endfor %}
</select><p>
<strong>Categories:</strong><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>
<strong>Categories:</strong><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>
<strong>Privacy:</strong><br>
<select name="privacy" class="form-control">
<option value="public"{% if privacy == "public" %} selected{% endif %}>
Public: everybody can see this blog entry
</option>
<option value="private"{% if privacy == "private" %} selected{% endif %}>
Private: only site admins can see this blog entry
</option>
</select><p>
<strong>Privacy:</strong><br>
<select name="privacy" class="form-control">
<option value="public"{% if privacy == "public" %} selected{% endif %}>
Public: everybody can see this blog entry
</option>
<option value="private"{% if privacy == "private" %} selected{% endif %}>
Private: only site admins can see this blog entry
</option>
</select><p>
<strong>Options:</strong><br>
<label>
<input type="checkbox" name="emoticons" value="true"{% if emoticons %} checked{% endif %}>
Enable graphical emoticons
</label><br>
<label>
<input type="checkbox" name="comments" value="true"{% if comments %} checked{% endif %}>
Enable comments on this entry
</label><p>
<strong>Options:</strong><br>
<label>
<input type="checkbox" name="emoticons" value="true"{% if emoticons %} checked{% endif %}>
Enable graphical emoticons
</label><br>
<label>
<input type="checkbox" name="comments" value="true"{% if comments %} checked{% endif %}>
Enable comments on this entry
</label><p>
<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="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="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="sec" id="sec" value="{{ sec }}"><br>
mm / dd / yyyy @ hh:mm:ss<br>
<label>
<input type="checkbox" id="autoup" value="yes"{% if post_id == "" %} checked{% endif %}>
Automatically update
</label><p>
<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="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="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="sec" id="sec" value="{{ sec }}"><br>
mm / dd / yyyy @ hh:mm:ss<br>
<label>
<input type="checkbox" id="autoup" value="yes"{% if post_id == "" %} checked{% endif %}>
Automatically update
</label><p>
<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-default" name="action" value="preview">Preview</button>
<button type="submit" class="btn btn-primary" name="action" value="publish">Publish Entry</button>
</form>
{% endblock %}
{% block scripts %}
<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() {
// Preview their selected avatar.
updateAvatar();
$("#avatar").on("change", updateAvatar);
$(document).ready(function() {
// Preview their selected avatar.
updateAvatar();
$("#avatar").on("change", updateAvatar);
// Start ticking the timestamp updater.
setInterval(timestamps, 500)
});
// Start ticking the timestamp updater.
setInterval(timestamps, 500)
});
function updateAvatar() {
var chosen = $("#avatar").val();
function updateAvatar() {
var chosen = $("#avatar").val();
var picture = ""; // which pic to show
if (chosen === "") {
picture = userPic;
}
else {
picture = "/static/avatars/" + chosen;
}
var picture = ""; // which pic to show
if (chosen === "") {
picture = userPic;
}
else {
picture = "/static/avatars/" + chosen;
}
// Show the pic
if (picture.length) {
$("#avatar-preview").html("<img src=\"" + picture + "\" alt=\"Preview\"><br>");
}
else {
$("#avatar-preview").html("");
}
}
// Show the pic
if (picture.length) {
$("#avatar-preview").html("<img src=\"" + picture + "\" alt=\"Preview\"><br>");
}
else {
$("#avatar-preview").html("");
}
}
function timestamps() {
function padout(num) {
if (num < 10) {
return '0' + num;
}
return num;
}
function timestamps() {
function padout(num) {
if (num < 10) {
return '0' + num;
}
return num;
}
if ($("#autoup").is(":checked")) {
var d = new Date();
var mon = d.getMonth(); // 0..11
var day = d.getDate(); // 1..31
var year = d.getFullYear(); // 2014
var hour = d.getHours(); // 0..23
var min = d.getMinutes(); // 0..59
var sec = d.getSeconds(); // 0..59
if ($("#autoup").is(":checked")) {
var d = new Date();
var mon = d.getMonth(); // 0..11
var day = d.getDate(); // 1..31
var year = d.getFullYear(); // 2014
var hour = d.getHours(); // 0..23
var min = d.getMinutes(); // 0..59
var sec = d.getSeconds(); // 0..59
// Adjust the dates.
mon++;
mon = padout(mon);
day = padout(day);
hour = padout(hour);
min = padout(min);
sec = padout(sec);
// Adjust the dates.
mon++;
mon = padout(mon);
day = padout(day);
hour = padout(hour);
min = padout(min);
sec = padout(sec);
// Update the fields.
$("#month").val(mon);
$("#day").val(day);
$("#year").val(year);
$("#hour").val(hour);
$("#min").val(min);
$("#sec").val(sec);
}
}
// Update the fields.
$("#month").val(mon);
$("#day").val(day);
$("#year").val(year);
$("#hour").val(hour);
$("#min").val(min);
$("#sec").val(sec);
}
}
</script>
{% endblock %}

View File

@ -7,23 +7,23 @@
Current preview of the comment:<p>
<div class="comment">
{{ comment["formatted_message"]|safe }}
{{ comment["formatted_message"]|safe }}
</div>
<h2>Edit Comment</h2>
<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="url" value="{{ url }}">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="url" value="{{ url }}">
<strong>Message:</strong><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>,
and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a>
in your comment.</small><p>
<strong>Message:</strong><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>,
and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a>
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-primary" name="action" value="save">Save</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>
</form>
{% endblock %}

View File

@ -1,70 +1,70 @@
{# Common template for leaving a comment/updating the comment preview. #}
{% if commenting_disabled %}
No new comments may be added to this thread.
No new comments may be added to this thread.
{% else %}
<form name="comment" action="{{ url_for('comment.preview') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="thread" value="{{ thread }}">
<input type="hidden" name="url" value="{{ url }}">
<input type="hidden" name="subject" value="{{ subject }}">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="left" valign="middle">
Your name:
</td>
<td align="left" valign="middle">
{% if session["login"] %}
<strong>{{ session["name"] }}</strong>
{% else %}
<input type="text" class="form-control" size="40" name="name" value="{{ name }}">
{% endif %}
</td>
</tr>
<tr>
<td align="left" valign="middle">
Your Email:
</td>
<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)">
</td>
</tr>
<tr>
<td align="left" valign="top">
Message:
</td>
<td align="left" valign="top">
<textarea class="form-control" cols="40" rows="8" name="message" style="width: 100%">{{ message }}</textarea>
<div>
<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>
in your comment.</small>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<label>
<input type="checkbox" name="subscribe" value="true"{% if subscribe == "true" %} checked{% endif %}>
Notify me of future comments on this page via e-mail
(<a href="{{ url_for('comment.privacy') }}" target="_blank">Privacy Policy</a>)
</label>
</td>
</tr>
</table><p>
<form name="comment" action="{{ url_for('comment.preview') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="thread" value="{{ thread }}">
<input type="hidden" name="url" value="{{ url }}">
<input type="hidden" name="subject" value="{{ subject }}">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="left" valign="middle">
Your name:
</td>
<td align="left" valign="middle">
{% if session["login"] %}
<strong>{{ session["name"] }}</strong>
{% else %}
<input type="text" class="form-control" size="40" name="name" value="{{ name }}">
{% endif %}
</td>
</tr>
<tr>
<td align="left" valign="middle">
Your Email:
</td>
<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)">
</td>
</tr>
<tr>
<td align="left" valign="top">
Message:
</td>
<td align="left" valign="top">
<textarea class="form-control" cols="40" rows="8" name="message" style="width: 100%">{{ message }}</textarea>
<div>
<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>
in your comment.</small>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<label>
<input type="checkbox" name="subscribe" value="true"{% if subscribe == "true" %} checked{% endif %}>
Notify me of future comments on this page via e-mail
(<a href="{{ url_for('comment.privacy') }}" target="_blank">Privacy Policy</a>)
</label>
</td>
</tr>
</table><p>
<div style="display: none">
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="email" value="">
</div>
<div style="display: none">
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="email" value="">
</div>
{% if preview %}
<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>
{% else %}
<button class="btn btn-primary" type="submit" name="action" value="preview">Leave Comment</button>
{% endif %}
{% if preview %}
<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>
{% else %}
<button class="btn btn-primary" type="submit" name="action" value="preview">Leave Comment</button>
{% endif %}
</form>
</form>
{% endif %}

View File

@ -1,39 +1,39 @@
<a name="comments"></a>
{% if header %}
<h1>Comments</h1>
<h1>Comments</h1>
{% endif %}
There {% if comments|length == 1 %}is{% else %}are{% endif %}
{{ comments|length }} comment{% if comments|length != 1 %}s{% endif %}
on this page.<p>
{{ comments|length }} comment{% if comments|length != 1 %}s{% endif %}
on this page.<p>
{% for comment in comments %}
<div class="comment">
<div class="comment-author">
{% 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">
{% elif comment["image"] %}
<img src="{{ photo_url }}/{{ comment['image'] }}" alt="Avatar" width="96" height="96">
{% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %}
<div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></div>
</div>
<div class="comment">
<div class="comment-author">
{% 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">
{% elif comment["image"] %}
<img src="{{ photo_url }}/{{ comment['image'] }}" alt="Avatar" width="96" height="96">
{% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %}
<div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></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">
{% if session["login"] %}
[IP: {{ comment["ip"] }}
|
<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>]
{% endif %}
</div>
</div><p>
<div class="clear">
{% if session["login"] %}
[IP: {{ comment["ip"] }}
|
<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>]
{% endif %}
</div>
</div><p>
{% endfor %}
<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>
<div class="comment">
<div class="comment-author">
{% if contact %}
<img src="{{ gravatar }}" alt="Avatar" width="96" height="96">
{% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %}<br>
<strong>{% if session["login"] %}{{ session["username"] }}{% else %}guest{% endif %}</strong>
</div>
<div class="comment-author">
{% if contact %}
<img src="{{ gravatar }}" alt="Avatar" width="96" height="96">
{% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %}<br>
<strong>{% if session["login"] %}{{ session["username"] }}{% else %}guest{% endif %}</strong>
</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>
{% if subscribe == "true" and contact %}
<p>
You will be subscribed to future comments on this thread. Notification
e-mails will be sent to {{ contact }}.<p>
<p>
You will be subscribed to future comments on this thread. Notification
e-mails will be sent to {{ contact }}.<p>
{% endif %}
<h2>Edit Comment</h2>

View File

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

View File

@ -6,9 +6,9 @@
The e-mail address <strong>{{ email }}</strong> has been unsubscribed
{% if thread == "*" %}
from all comment threads on this site.
from all comment threads on this site.
{% else %}
from the comment thread "{{ thread }}".
from the comment thread "{{ thread }}".
{% endif %}
{% 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">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="50%" align="left" valign="middle">
<strong>Your name:</strong><br>
<small>(so I know who you are)</small><br>
<input type="text" class="form-control"size="40" name="name">
</td>
<td width="50%" align="left" valign="middle">
<strong>Your email:</strong><br>
<small>(if you want a response)</small><br>
<input type="email" class="form-control" size="40" name="email">
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="middle">
<strong>Message subject:</strong><br>
<small>(optional)</small><br>
<input type="text" class="form-control" size="40" name="subject" style="width: 100%"><p>
<tr>
<td width="50%" align="left" valign="middle">
<strong>Your name:</strong><br>
<small>(so I know who you are)</small><br>
<input type="text" class="form-control"size="40" name="name">
</td>
<td width="50%" align="left" valign="middle">
<strong>Your email:</strong><br>
<small>(if you want a response)</small><br>
<input type="email" class="form-control" size="40" name="email">
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="middle">
<strong>Message subject:</strong><br>
<small>(optional)</small><br>
<input type="text" class="form-control" size="40" name="subject" style="width: 100%"><p>
<strong>Message:</strong><br>
<small>(required)</small><br>
<textarea class="form-control" cols="40" rows="12" name="message" style="width: 100%"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle">
<button type="submit" class="btn btn-primary">Send Message</button>
</td>
</tr>
<strong>Message:</strong><br>
<small>(required)</small><br>
<textarea class="form-control" cols="40" rows="12" name="message" style="width: 100%"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle">
<button type="submit" class="btn btn-primary">Send Message</button>
</td>
</tr>
</table>
<div style="display: none">
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="website" value="http://">
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="website" value="http://">
</div>
</form>

View File

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

View File

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

View File

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

View File

@ -7,24 +7,24 @@
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">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="order" id="order" value="">
<button type="submit" class="btn btn-primary">Save Changes</button>
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="order" id="order" value="">
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
<p>
<ul id="arrange-photos" class="photo-grid">
{% for album in albums %}
<li data-name="{{ album['name'] }}" class="portrait">
<div class="dummy"></div>
<div class="photo-grid-item">
<a href="{{ url_for('photo.album_index', name=album['name']) }}">
<img src="{{ app['photo_url'] }}/{{ album['cover'] }}" width="100%" height="100%">
<span class="name">{{ album["name"] }}</span>
</a>
</div>
</li>
<li data-name="{{ album['name'] }}" class="portrait">
<div class="dummy"></div>
<div class="photo-grid-item">
<a href="{{ url_for('photo.album_index', name=album['name']) }}">
<img src="{{ app['photo_url'] }}/{{ album['cover'] }}" width="100%" height="100%">
<span class="name">{{ album["name"] }}</span>
</a>
</div>
</li>
{% endfor %}
</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">
<script src="/js/jquery-ui-1.10.4.custom.js"></script>
<script>
$(document).ready(function() {
var $photos = $("#arrange-photos"),
$form = $("#arrange-form"),
$order = $("#order");
var doArrangePhotos = function() {
var order = [];
$(document).ready(function() {
var $photos = $("#arrange-photos"),
$form = $("#arrange-form"),
$order = $("#order");
var doArrangePhotos = function() {
var order = [];
// Get the list of elements.
var list = $photos.children().each(function() {
var name = $(this).data("name");
order.push(name);
});
// Get the list of elements.
var list = $photos.children().each(function() {
var name = $(this).data("name");
order.push(name);
});
$order.val(order.join(";"));
return true;
};
$order.val(order.join(";"));
return true;
};
$form.submit(doArrangePhotos);
$photos.sortable();
$photos.disableSelection();
});
$form.submit(doArrangePhotos);
$photos.sortable();
$photos.disableSelection();
});
</script>
{% endblock %}

View File

@ -7,22 +7,22 @@
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">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="order" id="order" value="">
<button type="submit" class="btn btn-primary">Save Changes</button>
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="order" id="order" value="">
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
<p>
<ul id="arrange-photos" class="photo-grid">
{% for photo in photos %}
<li data-name="{{ photo['key'] }}" class="portrait">
<div class="dummy"></div>
<div class="photo-grid-item">
<img src="{{ app['photo_url'] }}/{{ photo['data']['thumb'] }}" width="100%" height="100%">
<span class="name">{{ photo['data']['caption'] }}</span>
</div>
</li>
<li data-name="{{ photo['key'] }}" class="portrait">
<div class="dummy"></div>
<div class="photo-grid-item">
<img src="{{ app['photo_url'] }}/{{ photo['data']['thumb'] }}" width="100%" height="100%">
<span class="name">{{ photo['data']['caption'] }}</span>
</div>
</li>
{% endfor %}
</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">
<script src="/js/jquery-ui-1.10.4.custom.js"></script>
<script>
$(document).ready(function() {
var $photos = $("#arrange-photos"),
$form = $("#arrange-form"),
$order = $("#order");
var doArrangePhotos = function() {
var order = [];
$(document).ready(function() {
var $photos = $("#arrange-photos"),
$form = $("#arrange-form"),
$order = $("#order");
var doArrangePhotos = function() {
var order = [];
// Get the list of elements.
var list = $photos.children().each(function() {
var name = $(this).data("name");
order.push(name);
});
// Get the list of elements.
var list = $photos.children().each(function() {
var name = $(this).data("name");
order.push(name);
});
$order.val(order.join(";"));
return true;
};
$order.val(order.join(";"));
return true;
};
$form.submit(doArrangePhotos);
$photos.sortable();
$photos.disableSelection();
});
$form.submit(doArrangePhotos);
$photos.sortable();
$photos.disableSelection();
});
</script>
{% 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>
<table border="0" cellspacing="4" cellpadding="2">
<tr>
<td align="center" valign="middle">
<img src="{{ app['photo_url'] }}/{{ preview }}" id="cropbox">
</td>
<td align="center" valign="top">
<strong>Preview:</strong><br>
<div style="width: 100px; height: 100px; overflow: hidden">
<img src="{{ app['photo_url'] }}/{{ preview }}" id="preview" style="max-width: none">
</div>
<p>
<tr>
<td align="center" valign="middle">
<img src="{{ app['photo_url'] }}/{{ preview }}" id="cropbox">
</td>
<td align="center" valign="top">
<strong>Preview:</strong><br>
<div style="width: 100px; height: 100px; overflow: hidden">
<img src="{{ app['photo_url'] }}/{{ preview }}" id="preview" style="max-width: none">
</div>
<p>
<form name="crop" action="{{ url_for('photo.crop', photo=photo) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="x" id="x" value="0">
<input type="hidden" name="y" id="y" value="0">
<input type="hidden" name="length" id="length" value="0">
<form name="crop" action="{{ url_for('photo.crop', photo=photo) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="x" id="x" value="0">
<input type="hidden" name="y" id="y" value="0">
<input type="hidden" name="length" id="length" value="0">
<button type="submit" class="btn btn-primary">Crop Photo!</button>
</form>
</td>
</tr>
<button type="submit" class="btn btn-primary">Crop Photo!</button>
</form>
</td>
</tr>
</table>
{% endblock %}
@ -38,70 +38,70 @@ crop.<p>
<script src="/js/jquery.Jcrop.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jquery.Jcrop.css">
<script>
$(document).ready(function() {
var $cropbox = $("#cropbox"),
$preview = $("#preview"),
$x = $("#x"),
$y = $("#y"),
$length = $("#length");
$(document).ready(function() {
var $cropbox = $("#cropbox"),
$preview = $("#preview"),
$x = $("#x"),
$y = $("#y"),
$length = $("#length");
// Find the shortest side.
var len;
if ($cropbox.width() > $cropbox.height()) {
len = $cropbox.height();
}
else {
len = $cropbox.width();
}
// Find the shortest side.
var len;
if ($cropbox.width() > $cropbox.height()) {
len = $cropbox.height();
}
else {
len = $cropbox.width();
}
// Jcrop handler.
var showPreview = function(coords) {
if (parseInt(coords.w) > 0) {
var rx = 100 / coords.w;
var ry = 100 / coords.h;
var ht = $cropbox.height();
var wt = $cropbox.width();
// Jcrop handler.
var showPreview = function(coords) {
if (parseInt(coords.w) > 0) {
var rx = 100 / coords.w;
var ry = 100 / coords.h;
var ht = $cropbox.height();
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.
var trueW = {{ true_width }};
var trueH = {{ true_height }};
// Get the true dimensions of the image from PIL.
var trueW = {{ true_width }};
var trueH = {{ true_height }};
// The actual (possibly scaled) image shown on the page is hereby called
// the "display image"... turn our "display coords" into percentages
// across the image.
var percentX = coords.x / wt;
var percentY = coords.y / ht;
var percentLen = coords.w / wt;
// The actual (possibly scaled) image shown on the page is hereby called
// the "display image"... turn our "display coords" into percentages
// across the image.
var percentX = coords.x / wt;
var percentY = coords.y / ht;
var percentLen = coords.w / wt;
// Now get our true coords by multiplying those percentages against the
// true dimensions of the image from PIL.
var trueX = trueW * percentX;
var trueY = trueH * percentY;
var trueLen = trueW * percentLen;
// Now get our true coords by multiplying those percentages against the
// true dimensions of the image from PIL.
var trueX = trueW * percentX;
var trueY = trueH * percentY;
var trueLen = trueW * percentLen;
// Update the preview.
$preview.css({
width: Math.round(rx * wt) + "px",
height: Math.round(ry * ht) + "px",
marginLeft: "-" + Math.round(rx * coords.x) + "px",
marginTop: "-" + Math.round(ry * coords.y) + "px"
})
// Update the preview.
$preview.css({
width: Math.round(rx * wt) + "px",
height: Math.round(ry * ht) + "px",
marginLeft: "-" + Math.round(rx * coords.x) + "px",
marginTop: "-" + Math.round(ry * coords.y) + "px"
})
// Update the form.
$x.val(parseInt(trueX));
$y.val(parseInt(trueY));
$length.val(parseInt(trueLen));
}
}
// Update the form.
$x.val(parseInt(trueX));
$y.val(parseInt(trueY));
$length.val(parseInt(trueLen));
}
}
$cropbox.Jcrop({
onChange: showPreview,
onSelect: showPreview,
aspectRatio: 1,
setSelect: [ 0, 0, len, len ],
})
});
$cropbox.Jcrop({
onChange: showPreview,
onSelect: showPreview,
aspectRatio: 1,
setSelect: [ 0, 0, len, len ],
})
});
</script>
{% endblock %}

View File

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

View File

@ -5,10 +5,10 @@
<h1>Delete Album</h1>
<form name="delete" action="{{ url_for('photo.delete_album', album=album) }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
Are you <strong>sure</strong> you want to delete the album <strong>{{ album }}</strong>?<p>
<input type="hidden" name="token" value="{{ csrf_token() }}">
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>
{% endblock %}

View File

@ -7,30 +7,30 @@
<img src="{{ app['photo_url'] }}/{{ photo['thumb'] }}" class="portrait"><p>
<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>
<input type="text" class="form-control"size="40" name="caption" value="{{ photo['caption'] }}"><p>
<strong>Photo Caption:</strong><br>
<input type="text" class="form-control"size="40" name="caption" value="{{ photo['caption'] }}"><p>
<strong>Description:</strong><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>
<strong>Description:</strong><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>
Rotate:
<label>
<input type="radio" name="rotate" value="" checked> Leave alone
</label>
<label>
<input type="radio" name="rotate" value="left"> Left 90&deg;
</label>
<label>
<input type="radio" name="rotate" value="right"> Right 90&deg;
</label>
<label>
<input type="radio" name="rotate" value="180"> 180&deg;
</label><p>
Rotate:
<label>
<input type="radio" name="rotate" value="" checked> Leave alone
</label>
<label>
<input type="radio" name="rotate" value="left"> Left 90&deg;
</label>
<label>
<input type="radio" name="rotate" value="right"> Right 90&deg;
</label>
<label>
<input type="radio" name="rotate" value="180"> 180&deg;
</label><p>
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
{% endblock %}

View File

@ -5,26 +5,26 @@
<h1>Edit Album: {{ album }}</h1>
<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>
<input type="text" class="form-control" size="40" name="name" value="{{ album }}"><p>
<strong>Album Title:</strong><br>
<input type="text" class="form-control" size="40" name="name" value="{{ album }}"><p>
<strong>Description:</strong><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>
<strong>Description:</strong><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>
<strong>Display Format:</strong><br>
<label>
<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.
</label><br>
<label>
<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.
</label><p>
<strong>Display Format:</strong><br>
<label>
<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.
</label><br>
<label>
<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.
</label><p>
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>

View File

@ -7,26 +7,26 @@
All captions use <a href="/markdown">Markdown</a> syntax.<p>
<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">
{% for photo in photos %}
<tr>
<td width="100" align="center" valign="top">
<img src="{{ app['photo_url'] }}/{{ photo['data']['avatar'] }}" alt="Photo">
</td>
<td align="left" valign="top">
<strong>Caption:</strong><br>
<input type="text" class="form-control" size="40" name="{{ photo['key'] }}:caption" value="{{ photo['data']['caption'] }}"><p>
<table width="100%" border="0" cellspacing="4" cellpadding="4">
{% for photo in photos %}
<tr>
<td width="100" align="center" valign="top">
<img src="{{ app['photo_url'] }}/{{ photo['data']['avatar'] }}" alt="Photo">
</td>
<td align="left" valign="top">
<strong>Caption:</strong><br>
<input type="text" class="form-control" size="40" name="{{ photo['key'] }}:caption" value="{{ photo['data']['caption'] }}"><p>
<strong>Description:</strong><br>
<textarea class="form-control" cols="50" rows="6" name="{{ photo['key'] }}:description">{{ photo['data']['description'] }}</textarea>
</td>
</tr>
{% endfor %}
</table><p>
<strong>Description:</strong><br>
<textarea class="form-control" cols="50" rows="6" name="{{ photo['key'] }}:description">{{ photo['data']['description'] }}</textarea>
</td>
</tr>
{% endfor %}
</table><p>
<button type="submit" class="btn btn-primary">Save Changes</button>
<button type="submit" class="btn btn-primary">Save Changes</button>
</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.
<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>
<legend>Where is your picture located?</legend>
<fieldset>
<legend>Where is your picture located?</legend>
<label>
<input type="radio" class="location" name="location" value="pc" checked> On my computer
</label>
<label>
<input type="radio" class="location" name="location" value="www"> On the web
</label><p>
<label>
<input type="radio" class="location" name="location" value="pc" checked> On my computer
</label>
<label>
<input type="radio" class="location" name="location" value="www"> On the web
</label><p>
<div id="pic-pc" class="location-div">
<strong>Upload a picture from my computer</strong><br>
<input type="file" size="30" name="file" id="file-picker" accept="image/*" multiple><p>
<div id="pic-pc" class="location-div">
<strong>Upload a picture from my computer</strong><br>
<input type="file" size="30" name="file" id="file-picker" accept="image/*" multiple><p>
<strong>Or, drag images here:</strong><br>
<div id="dropbox" class="photo-upload-dropbox">Drag and drop images into this box</div>
</div>
<strong>Or, drag images here:</strong><br>
<div id="dropbox" class="photo-upload-dropbox">Drag and drop images into this box</div>
</div>
<div id="pic-www" class="location-div">
<strong>Upload a picture from the Internet</strong><br>
<input type="text" class="form-control" size="40" name="url" placeholder="http://" autocomplete="off">
</div>
<p>
<div id="pic-www" class="location-div">
<strong>Upload a picture from the Internet</strong><br>
<input type="text" class="form-control" size="40" name="url" placeholder="http://" autocomplete="off">
</div>
<p>
Only jpeg, gif and png images are supported. There is no maximum file size
limit, but be reasonable.
</fieldset>
<p>
Only jpeg, gif and png images are supported. There is no maximum file size
limit, but be reasonable.
</fieldset>
<p>
<fieldset>
<legend>Photo Options</legend>
<fieldset>
<legend>Photo Options</legend>
<strong>Photo album:</strong><br>
<select id="album" name="album" class="form-control">
<optgroup label="Albums">
{% for album in album_list %}
<option value="{{ album }}"{% if album == selected %} selected{% endif %}>{{ album }}</option>
{% endfor %}
</optgroup>
<option value="">Create a new album</option>
</select>
<strong>Photo album:</strong><br>
<select id="album" name="album" class="form-control">
<optgroup label="Albums">
{% for album in album_list %}
<option value="{{ album }}"{% if album == selected %} selected{% endif %}>{{ album }}</option>
{% endfor %}
</optgroup>
<option value="">Create a new album</option>
</select>
<blockquote id="create-album">
<strong>New album:</strong><br>
<input type="text" class="form-control" size="20" id="new-album" name="new-album"><p>
<blockquote id="create-album">
<strong>New album:</strong><br>
<input type="text" class="form-control" size="20" id="new-album" name="new-album"><p>
<strong>Album Description:</strong><br>
<textarea cols="50" class="form-control" rows="6" name="new-description"></textarea><br>
<small>Shows up at the top of the album.
Use <a href="/markdown" target="_blank">Markdown</a> formatting.</small>
</blockquote>
</fieldset>
<p>
<strong>Album Description:</strong><br>
<textarea cols="50" class="form-control" rows="6" name="new-description"></textarea><br>
<small>Shows up at the top of the album.
Use <a href="/markdown" target="_blank">Markdown</a> formatting.</small>
</blockquote>
</fieldset>
<p>
<fieldset id="upload-progress" style="display: none">
<legend>Upload Progress</legend>
<fieldset id="upload-progress" style="display: none">
<legend>Upload Progress</legend>
<div class="upload-trough">
<div id="upload-progress-bar" class="upload-progress-bar"></div>
</div>
</fieldset>
<p>
<div class="upload-trough">
<div id="upload-progress-bar" class="upload-progress-bar"></div>
</div>
</fieldset>
<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>
@ -82,24 +82,24 @@ somewhere else on the Internet.
{% block scripts %}
<script type="text/javascript" src="/rophako/multiupload.js"></script>
<script>
$(document).ready(function() {
$("#pic-www").hide();
$("#create-album").hide();
$(document).ready(function() {
$("#pic-www").hide();
$("#create-album").hide();
$(".location").change(function() {
$(".location-div").hide();
$("#pic-" + $(this).val()).show();
});
$(".location").change(function() {
$(".location-div").hide();
$("#pic-" + $(this).val()).show();
});
$("#album").change(function() {
if ($(this).val() === "") {
$("#create-album").show();
}
else {
$("#new-album").val("");
$("#create-album").hide();
}
});
});
$("#album").change(function() {
if ($(this).val() === "") {
$("#create-album").show();
}
else {
$("#new-album").val("");
$("#create-album").hide();
}
});
});
</script>
{% endblock %}

View File

@ -3,17 +3,17 @@
{% block content %}
{% macro nav_links() %}
<div class="right">
Photo {{ photo["position"] }} of {{ photo["siblings"] }}
{% if photo["siblings"] > 1 %}
&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['next']) }}">Next &gt;</a>
]
{% endif %}
</div>
<div class="right">
Photo {{ photo["position"] }} of {{ photo["siblings"] }}
{% if photo["siblings"] > 1 %}
&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['next']) }}">Next &gt;</a>
]
{% endif %}
</div>
{% endmacro %}
<h1>Photo</h1>
@ -23,41 +23,41 @@
{{ nav_links() }}
{% if photo["caption"] %}
<h2>{{ photo["caption"] }}</h2>
<h2>{{ photo["caption"] }}</h2>
{% endif %}
<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>
{% if photo["description"] %}
<div class="photo-description">{{ photo["markdown"]|safe }}</div>
<div class="photo-description">{{ photo["markdown"]|safe }}</div>
{% endif %}
<em>Uploaded by {{ author["name"] }} on {{ photo["pretty_time"] }}.</em>
{% if session["login"] %}
<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='<img src="{{ app['photo_url'] }}/{{ photo['large'] }}" alt="{{ photo['caption'] }}">'> (HTML)
<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='<img src="{{ app['photo_url'] }}/{{ photo['large'] }}" alt="{{ photo['caption'] }}">'> (HTML)
{% endif %}
{{ nav_links() }}
{% if session["login"] %}
<h1>Administrative Options</h1>
<h1>Administrative Options</h1>
<ul>
<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_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.crop', photo=photo['key']) }}">Change Thumbnail</a></li>
<li><a href="{{ url_for('photo.delete', key=photo['key']) }}">Delete this photo</a></li>
</ul>
<ul>
<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_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.crop', photo=photo['key']) }}">Change Thumbnail</a></li>
<li><a href="{{ url_for('photo.delete', key=photo['key']) }}">Delete this photo</a></li>
</ul>
{% endif %}
{{ include_page("comment.partial_index",
thread="photos-{}".format(photo["key"]),
subject="Photo Comment",
thread="photos-{}".format(photo["key"]),
subject="Photo Comment",
) | safe }}
{% endblock %}

View File

@ -6,8 +6,8 @@
<h1>Visitor Tracking</h1>
<ul>
<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.visitors') }}">Unique Visitors &amp; Visits</a></li>
<li><a href="{{ url_for('tracking.referrers') }}">HTTP Referrers</a></li>
</ul>
{% 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">
<table class="table" width="100%">
<thead>
<tr>
<th width="40">Hits</th>
<th>Query</th>
</tr>
</thead>
<tbody>
{% for link in referrers["referrers"] %}
{% if link %}
<tr>
<td align="center" valign="top">
{{ link[1] }}
</td>
<td align="left" valign="top" style="position: relative">
{{ link[0]|safe }}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
<thead>
<tr>
<th width="40">Hits</th>
<th>Query</th>
</tr>
</thead>
<tbody>
{% for link in referrers["referrers"] %}
{% if link %}
<tr>
<td align="center" valign="top">
{{ link[1] }}
</td>
<td align="left" valign="top" style="position: relative">
{{ link[0]|safe }}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
@ -37,7 +37,7 @@ the most recent 25 links, see <a href="#recent">the end of this page</a>.<p>
<ol>
{% for item in referrers["recent"] %}
<li>{{ item }}</li>
<li>{{ item }}</li>
{% endfor %}
</ol>

View File

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

View File

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

View File

@ -3,37 +3,37 @@
{% block content %}
{% if preview %}
<h1>Preview: {{ subject }}</h1>
<h1>Preview: {{ subject }}</h1>
{{ rendered_body|safe }}
{{ rendered_body|safe }}
<hr>
<hr>
{% endif %}
<h1>Edit Wiki</h1>
<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>
<input type="text" class="form-control" size="80" name="name" value="{{ title }}"><p>
<strong>Title:</strong><br>
<input type="text" class="form-control" size="80" name="name" value="{{ title }}"><p>
<strong>Body:</strong><br>
<textarea class="form-control input-lg" cols="80" rows="20" name="body">{{ body }}</textarea><br>
Markdown syntax.
<a href="{{ url_for('emoticons.index') }}" target="_blank">Emoticon reference</a> (opens in new window)<p>
<strong>Body:</strong><br>
<textarea class="form-control input-lg" cols="80" rows="20" name="body">{{ body }}</textarea><br>
Markdown syntax.
<a href="{{ url_for('emoticons.index') }}" target="_blank">Emoticon reference</a> (opens in new window)<p>
<strong>Revision Note (optional):</strong><br>
<input type="text" class="form-control" size="80" name="note" value="{{ note }}"><p>
<strong>Revision Note (optional):</strong><br>
<input type="text" class="form-control" size="80" name="note" value="{{ note }}"><p>
<strong>Options:</strong><br>
<label>
<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)
</label><p>
<strong>Options:</strong><br>
<label>
<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)
</label><p>
<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-default" name="action" value="preview">Preview</button>
<button type="submit" class="btn btn-primary" name="action" value="publish">Publish</button>
</form>
{% endblock %}

View File

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

View File

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

View File

@ -8,7 +8,7 @@ This wiki page does not exist yet (that means it's a 404 error!)
{% if session["login"] %}
<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>
{% endif %}

View File

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

View File

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

View File

@ -1,69 +1,69 @@
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}{% endblock %}</title>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="/css/codehilite.css">
<link rel="stylesheet" type="text/css" href="/smoke/style.css">
</head>
<link rel="stylesheet" type="text/css" href="/css/codehilite.css">
<link rel="stylesheet" type="text/css" href="/smoke/style.css">
</head>
<body>
<header>
<a href="/">
<img src="/smoke/firemarble.png" width="161" height="169" alt="Logo">
</a>
<span>Rophako</span>
<a href="/">
<img src="/smoke/firemarble.png" width="161" height="169" alt="Logo">
</a>
<span>Rophako</span>
</header>
<nav>
<ul>
<li class="header">:: Navigation</li>
<li><a href="/">Home</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/archive/master.zip">Download</a></li>
<ul>
<li class="header">:: Navigation</li>
<li><a href="/">Home</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/archive/master.zip">Download</a></li>
<li class="header">:: Site Admin</li>
{% if session["login"] %}
{% if session["role"] == "admin" %}
<li><a href="{{ url_for('admin.index') }}">Admin Center</a></li>
{% endif %}
<li><a href="{{ url_for('blog.update') }}">Update Blog</a></li>
{% if "impersonator" in session %}
<li><a href="{{ url_for('admin.unimpersonate') }}">Unimpersonate</a>
{% endif %}
<li><a href="{{ url_for('account.logout') }}">Log out {{ session["username"] }}</a></li>
{% else %}
<li><a href="{{ url_for('account.login') }}">Log in</a></li>
{% endif %}
</ul>
<li class="header">:: Site Admin</li>
{% if session["login"] %}
{% if session["role"] == "admin" %}
<li><a href="{{ url_for('admin.index') }}">Admin Center</a></li>
{% endif %}
<li><a href="{{ url_for('blog.update') }}">Update Blog</a></li>
{% if "impersonator" in session %}
<li><a href="{{ url_for('admin.unimpersonate') }}">Unimpersonate</a>
{% endif %}
<li><a href="{{ url_for('account.logout') }}">Log out {{ session["username"] }}</a></li>
{% else %}
<li><a href="{{ url_for('account.login') }}">Log in</a></li>
{% endif %}
</ul>
</nav>
<div id="content">
{% with messages = get_flashed_messages() %}
{% if messages %}
<h1>Notice!</h1>
{% with messages = get_flashed_messages() %}
{% if messages %}
<h1>Notice!</h1>
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
{% block content %}{% endblock %}
<footer>
<div>
&copy; {{ strftime("%Y") }} Noah Petherbridge. Web design released along with the Rophako CMS
under the GNU General Public License v2.0.<br>
<a href="https://github.com/kirsle/rophako" target="_blank">
{{ app["name"] }} v{{ app["version"] }} on Python {{ app["python_version"] }}
</a>
</div>
<footer>
<div>
&copy; {{ strftime("%Y") }} Noah Petherbridge. Web design released along with the Rophako CMS
under the GNU General Public License v2.0.<br>
<a href="https://github.com/kirsle/rophako" target="_blank">
{{ app["name"] }} v{{ app["version"] }} on Python {{ app["python_version"] }}
</a>
</div>
</footer>
</footer>
</div>
<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>
This is an H1<br>
=============<p>
This is an H2<br>
-------------
</code>
@ -293,12 +293,12 @@ get translated into a line break (<code>&lt;br&gt;</code>) in the output.
<td>
<ol>
<li>This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.<p>
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.<p>
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.</li>
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.</li>
<li>Suspendisse id sem consectetuer libero luctus adipiscing.</li>
</ol>

View File

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