Rather nice and satisfactory. Slightly conflates the issue of configuration and internationalisation at present, but I think internationalisation is a target to hit as a separate job.
This commit is contained in:
simon 2017-03-12 17:14:43 +00:00
parent 5d9462b7c3
commit 2f897089fe
17 changed files with 295 additions and 186 deletions

View file

@ -5,21 +5,21 @@
<input type="hidden" name="redirect-to" value="{{redirect-to}}"/>
{% if user %}
<p class="widget">
<label for="submit">To finish editing</label>
<input name="action" id="action" type="submit" class="action-dangerous" value="Logout!"/>
<label for="submit">{{config.save-prompt}}</label>
<input name="action" id="action" type="submit" class="action-dangerous" value="{{config.logout-label}}"/>
</p>
{% else %}
<p class="widget">
<label for="username">Your username</label>
<label for="username">{{config.your-uname-prompt}}</label>
<input name="username" id="username" type="text" required/>
</p>
<p class="widget">
<label for="password">Your password</label>
<label for="password">{{config.old-pass-prompt}}</label>
<input name="password" id="password" type="password" required/>
</p>
<p class="widget">
<label for="submit">To edit this wiki</label>
<input name="action" id="action" type="submit" class="action" value="Login!"/>
<label for="submit">{{config.login-prompt}}</label>
<input name="action" id="action" type="submit" class="action" value="{{config.login-label}}"/>
</p>
{% endif %}
</form>

View file

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
<title>{{config.site-title}}: {{title}}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="{{servlet-context}}/content/stylesheet.css" media="screen and (min-device-width: 1025px)" rel="stylesheet" type="text/css" />
<link href="{{servlet-context}}/css/print.css" media="print" rel="stylesheet" type="text/css" />
@ -13,23 +13,23 @@
<!-- navbar -->
<div id="nav">
{% if user %}
<p class="user" id="user">You are logged in as {{user}} | <a href="passwd">change password</a></p>
<p class="user" id="user">{{config.logged-in-as}} {{user}} | <a href="passwd">{{config.change-pass-link}}</a></p>
{% endif %}
<img id="nav-icon" src="{{servlet-context}}/img/threelines.png" alt="Menu"/>
<ul id="nav-menu" class="nav">
<li class="{{wiki-selected}}"><a href="{{servlet-context}}/">Home</a></li>
<li class="{{wiki-selected}}"><a href="{{servlet-context}}/">{{config.home-link}}</a></li>
{% if admin %}
<li class="{{admin-selected}}"><a href="{{servlet-context}}/edit-users">Edit users</a></li>
<li class="{{admin-selected}}"><a href="{{servlet-context}}/edit-users">{{config.edit-users-link}}</a></li>
{% endif %}
<li class="{{auth-selected}}"><a href="{{servlet-context}}/auth">
{% if user %}
Log out
{{config.logout-link}}
{% else %}
Log in
{{config.login-link}}
{% endif %}</a></li>
</ul>
</div>
<h1>{{title}}</h1>
<h1>{{config.site-title}}: {{title}}</h1>
{{header|safe}}
{% if message %}
<div id="message">
@ -52,13 +52,10 @@
</div>
<div id="cookies">
<div id="more-about-cookies">
This website stores session information as a 'cookie' on your browser. This helps us show you the content
you want to see. This cookie does not identify you, and cannot be read by other websites. It is deleted by
your browser as soon as you leave this site. This website does not use any third party cookies, so your
visit here cannot be tracked by other websites.
{{config.cookies-more}}
</div>
<div id="about-cookies">
About cookies
{{config.cookies-about}}
</div>
</div>
<footer>

View file

@ -6,17 +6,14 @@
<input type="hidden" name="page" value="{{page}}"/>
<textarea name="src" id="src" rows="25" cols="80">{{content}}</textarea>
<p class="widget">
<label for="summary">What have you changed?</label>
<label for="summary">{{config.what-changed-prompt}}</label>
<input name="summary" id="summary" type="text"
value="{%if exists%}{%else%}New file {{title}}{%endif%}" required/>
</p>
<p class="widget">
<label for="submit">When you have finished editing</label>
<input name="submit" id="submit" type="submit" class="action" value="Save!"/>
<label for="submit">{{config.save-prompt}}</label>
<input name="submit" id="submit" type="submit" class="action" value="{{config.save-label}}"/>
</p>
</form>
</div>
<script>
var simplemde = new SimpleMDE();
</script>
{% endblock %}

View file

@ -4,28 +4,28 @@
<div id="content" class="edit">
<form action="{{servlet-context}}/edit-user" method="POST">
<p class="widget">
<label for="target">Username</label>
<label for="target">{{config.username-prompt}}</label>
<input type="text" name="target" id="target" value="{{target}}" required/>
</p>
<p class="widget">
<label for="pass1">New password</label>
<label for="pass1">{{config.new-pass-prompt}}</label>
<input name="pass1" id="pass1" type="password"/>
</p>
<p class="widget">
<label for="pass2">And again</label>
<label for="pass2">{{config.rpt-pass-prompt}}</label>
<input name="pass2" id="pass2" type="password"/>
</p>
<p class="widget">
<label for="email">Email address</label>
<label for="email">{{config.email-prompt}}</label>
<input name="email" id="email" type="text" value="{{details.email}}" required/>
</p>
<p class="widget">
<label for="admin">Is administrator?</label>
<label for="admin">{{config.is-admin-prompt}}</label>
<input name="admin" id="admin" type="checkbox" {% if details.admin %}checked{% endif %}/>
</p>
<p class="widget">
<label for="submit">When you have finished editing</label>
<input name="submit" id="submit" type="submit" class="action" value="Save!"/>
<label for="submit">{{config.save-prompt}}</label>
<input name="submit" id="submit" type="submit" class="action" value="{{config.save-label}}"/>
</p>
</form>
</div>

View file

@ -4,16 +4,16 @@
<div id="content">
<table>
<tr>
<th>Edit</th><th>Delete</th>
<th>{{config.edit-col-hdr}}</th><th>{{config.del-col-hdr}}</th>
</tr>
{% for user in users %}
<tr>
<td><a href="edit-user?target={{user}}">Edit {{user}}</a></td>
<td><a href="delete-user?target={{user}}">Delete {{user}}</a></td>
<td><a href="edit-user?target={{user}}">{{config.edit-col-hdr}} {{user}}</a></td>
<td><a href="delete-user?target={{user}}">{{config.del-col-hdr}} {{user}}</a></td>
</tr>
{% endfor %}
<tr>
<td><a href="edit-user">Add new user</a></td>
<td><a href="edit-user">{{config.add-user-label}}</a></td>
<td></td>
</tr>
</table>

View file

@ -10,13 +10,13 @@
<input type="hidden" name="page" value="{{page}}"/>
<textarea name="src" id="src" rows="25" cols="80">{{content}}</textarea>
<p class="widget">
<label for="summary">What have you changed?</label>
<label for="summary">{{config.what-changed-prompt}}</label>
<input name="summary" id="summary" type="text"
value="{%if exists%}{%else%}New file {{title}}{%endif%}" required/>
</p>
<p class="widget">
<label for="submit">When you have finished editing</label>
<input name="submit" id="submit" type="submit" class="action" value="Save!"/>
<label for="submit">{{config.save-prompt}}</label>
<input name="submit" id="submit" type="submit" class="action" value="{{config.save-label}}"/>
</p>
</form>
</div>

View file

@ -1,26 +1,29 @@
{% extends "templates/base.html" %}
{% block content %}
<div id="content" class="history">
<table>
<tr>
<th>When</th><th>What</th><th>Version</th><th>Changes</th>
</tr>
{% for entry in history %}
<tr>
<td>S
{{entry.time}}
</td>
<td>
{{entry.message}}
</td>
<td>
<a href="version?page={{page}}&amp;version={{entry.id}}">Show version</a>
</td>
<td>
<a href="changes?page={{page}}&amp;version={{entry.id}}">What's changed since?</a>
</td>
</tr>
{% endfor %}
</table>
<table>
<tr>
<th>{{config.when-col-hdr}}</th>
<th>{{config.what-col-hdr}}</th>
<th>{{config.vers-col-hdr}}</th>
<th>{{config.change-col-hdr}}</th>
</tr>
{% for entry in history %}
<tr>
<td>S
{{entry.time}}
</td>
<td>
{{entry.message}}
</td>
<td>
<a href="version?page={{page}}&amp;version={{entry.id}}">Show version</a>
</td>
<td>
<a href="changes?page={{page}}&amp;version={{entry.id}}">What's changed since?</a>
</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}

View file

@ -4,8 +4,8 @@
<div id="content" class="wiki">
{% if editable %}
<ul class="minor-controls">
<li><a href="{{servlet-context}}/edit?page={{title}}">Edit this page</a></li>
<li><a href="history?page={{page}}">History</a></li>
<li><a href="{{servlet-context}}/edit?page={{title}}">{{config.edit-page-link}}</a></li>
<li><a href="history?page={{page}}">{{config.history-link}}</a></li>
</ul>
{% endif %}
{{content|safe}}