Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A prettier treestatus

  • Loading branch information...
commit 53e9e1158d234cfc1ba51c107f6b582f4e90accd 1 parent 5c85c0f
@graememcc graememcc authored
View
BIN  treestatus/static/background.jpg
Deleted file not rendered
View
BIN  treestatus/static/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  treestatus/static/opensans.woff
Binary file not shown
View
21 treestatus/static/releng.css
@@ -1,21 +0,0 @@
-body {
- background: #FFF url('/static/background.jpg') no-repeat fixed top left;
- margin-left: 20px;
- margin-right: 20px;
- font-family: sans-serif;
-}
-
-div.main {
- width: 75%;
- margin: 20px auto;
-}
-
-h1 {
- border: 3px solid #AAA;
- background-color: #EFF;
- padding: 10px;
- -moz-border-radius: 10px;
- text-align: center;
-}
-
-
View
201 treestatus/static/style.css
@@ -0,0 +1,201 @@
+@font-face {
+ font-family: 'Open sans';
+ font-style: normal;
+ font-weight: 400;
+ src: local('Open sans') url('/static/opensans.woff');
+}
+
+html, body {
+ margin: 0;
+ padding: 0;
+ height: 100%;
+}
+
+body {
+ background: url('/static/background.png') scroll repeat-x rgb(249, 249, 249) 0 0;
+ font-family: sans-serif;
+}
+
+h1, h2 {
+ color: rgb(72,72,72);
+ font-family: 'Open sans', sans-serif;
+ font-weight: bold;
+ text-align: center;
+}
+
+h1 {
+ font-size: 300%;
+}
+
+table {
+ margin-left: auto;
+ margin-right: auto;
+ border-collapse: collapse;
+ min-width: 720px;
+ margin-bottom: 40px;
+}
+
+thead {
+ background-color: #0095dd;
+ color: white;
+ font-family: 'Open sans', sans-serif;
+ text-align: left;
+}
+
+th {
+ padding: 5px;
+}
+
+tr {
+ border-top: 1px solid gray;
+}
+
+td {
+ padding-top: 5px;
+ padding-bottom: 5px;
+}
+
+thead > tr {
+ border: none;
+}
+
+a {
+ color:#2983c8;
+ text-decoration:none
+}
+
+a:hover,a:active{
+ color:#20679e;
+ text-decoration:underline;
+}
+
+a:hover.loginout, a:active.loginout {
+ color: white;
+ text-decoration: none;
+}
+
+.error {
+ color: red;
+}
+
+p.error {
+ text-align: center;
+ color: black;
+}
+
+.tableCheck {
+ min-width: 20px;
+}
+
+.tableName {
+ min-width: 200px;
+}
+
+.tableState {
+ min-width: 100px;
+}
+
+.tableReason {
+ min-width: 400px;
+}
+
+.history .tableReason {
+ min-width: 200px;
+}
+
+.history td {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+.tableTags {
+ min-width: 100px;
+}
+
+td.tableSheriff, td.tableAdmin {
+ text-align: center;
+}
+
+.open {
+ color: green;
+}
+
+.closed {
+ color: red;
+}
+
+.footerWrapper {
+ border-top: 1px solid gray;
+ padding-top: 5px;
+}
+
+.atRight {
+ float: right;
+}
+
+.help td {
+ border: 1px solid grey;
+ padding: 5px;
+}
+
+.loginout {
+ background-color: #0095dd;
+ color: white;
+ font-family: 'Open sans', sans-serif;
+ padding: 5px;
+ margin-left: 5px;
+ margin-right: 5px;
+}
+
+#container {
+ min-height: 100%;
+ position: relative;
+}
+
+#main {
+ padding: 10px;
+ padding-bottom: 60px;
+}
+
+#stacksWrapper {
+ text-align: center;
+ margin-bottom: 40px;
+}
+
+#tableWrapper h2, #modify h2, #helpHeading{
+ text-align: left;
+}
+
+#tableWrapper div {
+ margin-top: 20px;
+ margin-bottom: 40px;
+}
+
+#modify {
+ display: table;
+ margin-left: auto;
+ margin-right: auto;
+ min-width: 720px;
+}
+
+#add {
+ display: table;
+ margin-left: auto;
+ margin-right: auto;
+ min-width: 720px;
+ padding: 10px;
+ background-color: #ffffe0;
+ border: 1px grey dashed;
+}
+
+h2#previous {
+ text-align: center;
+}
+
+#footer {
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ text-align: center;
+ height: 60px;
+}
View
32 treestatus/templates/badlogin.html
@@ -2,18 +2,28 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tree Status</title>
- <link rel="stylesheet" type="text/css" href="/static/releng.css" />
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
- <h1>Insufficient permissions</h1>
- <p>
- You do not have permission to login to this system
- </p>
- <p>
- <a href="/">All trees</a>
- <a href="/help">Help</a>
- <a href="https://github.com/catlee/treestatus">Source</a>
- <a href="/login">Login</a>
- </p>
+ <div id="container">
+ <div id="main">
+ <span class="atRight">
+ <a class="loginout" href="/login">Login</a>
+ </span>
+ <h1>TreeStatus</h1>
+ <h2 class="error">Sorry!</h2>
+ <p class="error">
+ You do not have permission to login to this system.
+ </p>
+ </div>
+ <div id="footer">
+ <span class="footerWrapper">
+ <a href="/">All trees</a>
+ <a href="/help">Help</a>
+ <a href="https://github.com/catlee/treestatus">Source</a>
+ <a href="/login">Login</a>
+ </span>
+ </div>
+ </div>
</body>
</html>
View
77 treestatus/templates/help.html
@@ -2,36 +2,55 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Treestatus Docs</title>
- <link rel="stylesheet" type="text/css" href="/static/releng.css" />
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
- <h1>API</h1>
- <table border="1">
- <thead>
- <tr><th>URL</th><th>Method</th><th>Parameters</th><th>Description</th></tr>
- </thead>
- <tbody>
- <tr><td>/</td><td>GET</td><td>[optional]&nbsp;format=json</td><td>Returns a list of all trees and their statuses</td></tr>
- <tr><td>/</td><td>POST</td><td>status=$status<br/>reason<br/>trees=$tree<br/>[optional]&nbsp;tags=$tag</td><td>Sets the status of $trees to $status, with the specified reason. trees can be specified multiple times to set the status of multiple trees. tags can also be given multiple times.</td></tr>
- <tr><td>/</td><td>POST</td><td>newtree=$treename</td><td>Adds a new tree called treename</td></tr>
- <tr><td>/$treename</td><td>GET</td><td>[optional]&nbsp;format=json</td><td>Returns status of $treename</td></tr>
- <tr><td>/$treename</td><td>POST</td><td>status=$status<br/>reason<br/>[optional]&nbsp;tags=$tag</td><td>Sets the status of $treename to status, with the specified reason and tags. tags can be given multiple times to set multiple tags.</td></tr>
- <tr><td>/$treename</td><td>DELETE (or POST with _method=DELETE)</td><td>reason</td><td>Remove this tree</td></tr>
- <tr><td>/$treename/logs</td><td>GET</td><td>[optional]&nbsp;format=json<br/>[optional]&nbsp;all=1</td><td>Returns logs of events on $treename. If all=1 then all events are returned, otherwise only the most recent 100 are returned.</td></tr>
- </tbody>
- </table>
- <p>treenames should be urlencoded if they contain special characters
- such as '/'. Note that this means that in your browser they'll most
- likely appear as doubly encoded.</p>
- <p>
- <a href="/">All trees</a>
- <a href="/help">Help</a>
- <a href="https://github.com/catlee/treestatus">Source</a>
- {% if 'REMOTE_USER' in request.environ: %}
- <a href="/logout">Logout</a> ({{request.environ['REMOTE_USER']}})
- {% else: %}
- <a href="/login">Login</a>
- {% endif %}
- </p>
+ <div id="container">
+ <div id="main">
+ <span class="atRight">
+ {% if 'REMOTE_USER' in request.environ: -%}
+ {{request.environ['REMOTE_USER']}}
+ <a class="loginout" href="/logout">Logout</a>
+ {% else: -%}
+ <a class="loginout" href="/login">Login</a>
+ {% endif -%}
+ </span>
+ <h1>TreeStatus</h1>
+ <h2 id="helpHeading">API documentation</h2>
+ <p>
+ Treename parameters should be urlencoded if they contain special characters
+ such as '/'. Note that this means that in your browser they'll most
+ likely appear as doubly encoded.
+ </p>
+ <div id="tableWrapper">
+ <table class="help">
+ <thead>
+ <tr><th>URL</th><th>Method</th><th>Parameters</th><th>Description</th></tr>
+ </thead>
+ <tbody>
+ <tr><td>/</td><td>GET</td><td>[optional]&nbsp;format=json</td><td>Returns a list of all trees and their statuses</td></tr>
+ <tr><td>/</td><td>POST</td><td>status=$status<br/>reason<br/>trees=$tree<br/>[optional]&nbsp;tags=$tag</td><td>Sets the status of $trees to $status, with the specified reason. trees can be specified multiple times to set the status of multiple trees. tags can also be given multiple times.</td></tr>
+ <tr><td>/</td><td>POST</td><td>newtree=$treename</td><td>Adds a new tree called treename</td></tr>
+ <tr><td>/$treename</td><td>GET</td><td>[optional]&nbsp;format=json</td><td>Returns status of $treename</td></tr>
+ <tr><td>/$treename</td><td>POST</td><td>status=$status<br/>reason<br/>[optional]&nbsp;tags=$tag</td><td>Sets the status of $treename to status, with the specified reason and tags. tags can be given multiple times to set multiple tags.</td></tr>
+ <tr><td>/$treename</td><td>DELETE (or POST with _method=DELETE)</td><td>reason</td><td>Remove this tree</td></tr>
+ <tr><td>/$treename/logs</td><td>GET</td><td>[optional]&nbsp;format=json<br/>[optional]&nbsp;all=1</td><td>Returns logs of events on $treename. If all=1 then all events are returned, otherwise only the most recent 100 are returned.</td></tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div id="footer">
+ <span class="footerWrapper">
+ <a href="/">All trees</a>
+ <a href="/help">Help</a>
+ <a href="https://github.com/catlee/treestatus">Source</a>
+ {% if 'REMOTE_USER' in request.environ: %}
+ <a href="/logout">Logout</a>
+ {% else: %}
+ <a href="/login">Login</a>
+ {% endif %}
+ </span>
+ </div>
+ </div>
</body>
</html>
View
197 treestatus/templates/index.html
@@ -2,93 +2,120 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tree Status</title>
- <link rel="stylesheet" type="text/css" href="/static/releng.css" />
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
-<h1>Trees</h1>
-{% if 'REMOTE_USER' in request.environ: -%}
-<form method="post" action="">
-<input type="hidden" name="token" value="{{token}}" />
-{% endif -%}
-<table>
- <thead>
- <tr><th>name</th><th>state</th><th>reason</th></tr>
- </thead>
- <tbody>
-{% for tree in trees -%}
-<tr>
- <td>
- {% if 'REMOTE_USER' in request.environ: -%}
- <input type="checkbox" name="tree" value="{{tree.tree}}" />
- {% endif -%}
- <a href="/{{tree.tree|urlencode|urlencode}}">{{tree.tree}}</a>
- </td>
- <td>{{tree.status.upper()}}</td>
- <td>{{tree.reason or ""}}</td>
-</tr>
-{% endfor -%}
-{% if 'REMOTE_USER' in request.environ: -%}
- <tr>
- <td valign="top">Modify selected trees</td>
- <td valign="top">
- <select name="status">
- <option value="closed">Closed</option>
- <option value="open">Open</option>
- <option value="approval required">Approval Required</option>
- </select>
- </td>
- <td><input type="text" name="reason" size="30" /><br/>
- <input type="checkbox" name="tags" value="infra" id="infra" />
- <label for="infra">infrastructure related</label><br/>
- <input type="checkbox" name="remember" value="remember" id="remember" checked="checked" />
- <label for="remember">remember previous state</label><br/>
- <input type="submit" />
- </td>
- </tr>
- <tr>
- <td><input type="text" name="newtree" /></td>
- <td><input type="submit" value="Add tree" /></td>
- </tr>
-{% endif -%}
- </tbody>
-</table>
-{% if 'REMOTE_USER' in request.environ: -%}
-</form>
-{% if stacks -%}
-<h2>Previous states</h2>
-{% for stack in stacks: -%}
-<form method="post" action="">
-<p>
-<input type="hidden" name="token" value="{{token}}" />
-<input type="hidden" name="restore" value="{{stack.id}}" />
-At {{stack.when.strftime("%Y-%m-%d %H:%M:%S")}}
-{{stack.who}} changed
-{% for t in stack.trees -%}
-{%- if loop.index0 > 0 -%}
-,
-{%- endif -%}
-{{t.tree}}
-{%- endfor %}
-to {{stack.status.upper()}} {{stack.reason}}
-<input type="submit" value="restore" />
-</p>
-</form>
-{% endfor -%}
-{% endif -%}
-{% endif -%}
+<div id="container">
+ <div id="main">
+ <span class="atRight">
+ {% if 'REMOTE_USER' in request.environ: -%}
+ {{request.environ['REMOTE_USER']}}
+ <a class="loginout" href="/logout">Logout</a>
+ {% else: -%}
+ <a class="loginout" href="/login">Login</a>
+ {% endif -%}
+ </span>
+ <h1>TreeStatus</h1>
+ <div id="tableWrapper">
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <form method="post" action="">
+ <input type="hidden" name="token" value="{{token}}" />
+ {% endif -%}
+ <table>
+ <thead>
+ <tr>
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <th class="tableCheck"></th>
+ {% endif -%}
+ <th class="tableName">Name</th><th class="tableState">State</th><th class="tableReason">Reason</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for tree in trees -%}
+ <tr>
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <td class="tableCheck">
+ <input type="checkbox" name="tree" value="{{tree.tree}}" />
+ </td>
+ {% endif -%}
+ <td class="tableName">
+ <a href="/{{tree.tree|urlencode|urlencode}}">{{tree.tree}}</a>
+ </td>
+ <td class="tableState {{tree.status.lower()}}">{{tree.status.upper()}}</td>
+ <td class="tableReason">{{tree.reason or ""}}</td>
+ </tr>
+ {% endfor -%}
+ </tbody>
+ </table>
-<p>
-<a href="/">All trees</a>
-<a href="/help">Help</a>
-<a href="https://github.com/catlee/treestatus">Source</a>
-{% if user and user.is_admin -%}
-<a href="/users">Manage Users</a>
-{% endif -%}
-{% if 'REMOTE_USER' in request.environ: -%}
-<a href="/logout">Logout</a> ({{request.environ['REMOTE_USER']}})
-{% else: -%}
-<a href="/login">Login</a>
-{% endif -%}
-</p>
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <div id="modify">
+ <h2>Modify selected trees</h2>
+ <label for="status">New state:
+ <select name="status">
+ <option value="closed">Closed</option>
+ <option value="open">Open</option>
+ <option value="approval required">Approval Required</option>
+ </select>
+ </label>
+ <label for="reason">Reason:
+ <input type="text" name="reason" size="30" /><br/>
+ </label>
+ <label for="infra">Infrastructure related?
+ <input type="checkbox" name="tags" value="infra" id="infra" />
+ </label><br/>
+ <label for="remember">Remember previous state
+ <input type="checkbox" name="remember" value="remember" id="remember" checked="checked" />
+ </label><br/>
+ <span class="atRight"><input type="submit" value="Submit"/></span>
+ </div>
+ <div id="add">
+ <label for="newtree">Add tree:
+ <input type="text" name="newtree" />
+ </label>
+ <span class="atRight"><input type="submit" value="Add" /></span>
+ </div>
+ </form>
+ </div>
+ {% if stacks -%}
+ <div id="stacksWrapper">
+ <h2>Previous states</h2>
+ {% for stack in stacks: -%}
+ <form method="post" action="">
+ <p>
+ <input type="hidden" name="token" value="{{token}}" />
+ <input type="hidden" name="restore" value="{{stack.id}}" />
+ At {{stack.when.strftime("%Y-%m-%d %H:%M:%S")}}
+ {{stack.who}} changed
+ {% for t in stack.trees -%}
+ {%- if loop.index0 > 0 -%}
+ ,
+ {%- endif -%}
+ {{t.tree}}
+ {%- endfor %}
+ to {{stack.status.upper()}} {{stack.reason}}
+ <input type="submit" value="restore" />
+ </p>
+ </form>
+ {% endfor -%}
+ </div>
+ {% endif -%}
+ {% endif -%}
+ </div>
+ <div id="footer">
+ <span class="footerWrapper">
+ <a href="/">All trees</a>
+ <a href="/help">Help</a>
+ <a href="https://github.com/catlee/treestatus">Source</a>
+ {% if user and user.is_admin -%}
+ <a href="/users">Manage Users</a>
+ {% endif -%}
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <a href="/logout">Logout</a>
+ {% else: -%}
+ <a href="/login">Login</a>
+ {% endif -%}
+ </span>
+ </div>
</body>
</html>
View
122 treestatus/templates/tree.html
@@ -2,42 +2,94 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{{tree.tree}} - {{tree.status}}</title>
- <link rel="stylesheet" type="text/css" href="/static/releng.css" />
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
-<h1>{{tree.tree}} is {{tree.status.upper()}}</h1>
-{% if tree.reason: -%}
-<h2>Reason: {{tree.reason}}</h2>
-{% endif -%}
-{% if 'REMOTE_USER' in request.environ: -%}
-<form method="post" action="/{{tree.tree}}">
-<p>
-Reason: <input type="text" name="reason" size="40" />
-<select name="status">
- <option value="closed">Closed</option>
- <option value="open">Open</option>
- <option value="approval required">Approval Required</option>
-</select>
-<input type="hidden" name="token" value="{{token}}" />
-<input type="checkbox" name="tags" value="infra" id="infra" /><label for="infra">infrastructure related</label><br/>
-<input type="submit" />
-</p>
-</form>
-{% endif -%}
-<ul>
-{% for log in logs: -%}
-<li>{{log.who}} {{log.when}} action: {{log.action}}; reason: {{log.reason}}; tags: {{", ".join(log.tags)}}</li>
-{% endfor -%}
-</ul>
-<p>
-<a href="/">All trees</a>
-<a href="/help">Help</a>
-<a href="https://github.com/catlee/treestatus">Source</a>
-{% if 'REMOTE_USER' in request.environ: -%}
-<a href="/logout">Logout</a> ({{request.environ['REMOTE_USER']}})
-{% else: -%}
-<a href="/login">Login</a>
-{% endif -%}
-</p>
+ <div id="container">
+ <div id = "main">
+ <span class="atRight">
+ {% if 'REMOTE_USER' in request.environ: -%}
+ {{request.environ['REMOTE_USER']}}
+ <a class="loginout" href="/logout">Logout</a>
+ {% else: -%}
+ <a class="loginout" href="/login">Login</a>
+ {% endif -%}
+ </span>
+ <h1>TreeStatus</h1>
+ <h2>{{tree.tree}} is <span class="{{tree.status.lower()}}">{{tree.status.upper()}}</span></h2><br/>
+ {% if tree.reason: -%}
+ <h2>Reason: {{tree.reason}}</h2>
+ {% endif -%}
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <div id="modify">
+ <h2>Modify this tree</h2>
+ <form method="post" action="/{{tree.tree}}">
+ <label for="status">New state:
+ <select name="status">
+ <option value="closed">Closed</option>
+ <option value="open">Open</option>
+ <option value="approval required">Approval Required</option>
+ </select>
+ </label>
+ <label for="reason">Reason:
+ <input type="text" name="reason" size="30" /><br />
+ </label>
+ <label for="infra">Infrastructure related?
+ <input type="checkbox" name="tags" value="infra" id="infra" />
+ </label><br/>
+ <input type="hidden" name="token" value="{{token}}" />
+ <span class="atRight"><input type="submit" value="Submit"/></span>
+ </form>
+ </div>
+ {% endif -%}
+ <div id="tableWrapper">
+ <h2 id="previous">History</h2>
+ <table class="history">
+ <thead>
+ <tr>
+ <th class="tableWho">User</th>
+ <th class="tableWhen">Time</th>
+ <th class="tableState">Action</th>
+ <th class="tableReason">Reason</th>
+ <th class="tableTags">Tags</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for log in logs: -%}
+ <tr>
+ <td class="tableWho">
+ {{log.who}}
+ </td>
+ <td class="tableWhen">
+ {{log.when}}
+ </td>
+ <td class="tableState">
+ {{log.action}}
+ </td>
+ <td class="tableReason">
+ {{log.reason}}
+ </td>
+ <td class="tableTags">
+ {{", ".join(log.tags)}}
+ </td>
+ </tr>
+ {% endfor -%}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <div id="footer">
+ <span class="footerWrapper">
+ <a href="/">All trees</a>
+ <a href="/help">Help</a>
+ <a href="https://github.com/catlee/treestatus">Source</a>
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <a href="/logout">Logout</a>
+ {% else: -%}
+ <a href="/login">Login</a>
+ {% endif -%}
+ </span>
+ </div>
+ </div>
</body>
</html>
View
119 treestatus/templates/users.html
@@ -2,56 +2,79 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tree Status</title>
- <link rel="stylesheet" type="text/css" href="/static/releng.css" />
+ <link rel="stylesheet" type="text/css" href="/static/style.css" />
</head>
<body>
-<h1>Users</h1>
-<form method="post" action="">
-<input type="hidden" name="token" value="{{token}}">
-<table>
- <thead>
- <tr><th>name</th><th>sheriff</th><th>admin</th><th>delete</th></tr>
- </thead>
- <tbody>
-{% for u in users -%}
- <tr>
- <td>{{u.name}}</td>
- {% if u.is_sheriff -%}
- <input type="hidden" name="was_sheriff" value="{{u.id}}"/>
- {% endif -%}
- {% if u.is_admin -%}
- <input type="hidden" name="was_admin" value="{{u.id}}"/>
- {% endif -%}
- <td><input type="checkbox" name="sheriff" value="{{u.id}}" {{'checked=1' if u.is_sheriff else ''}}/></td>
- <td><input type="checkbox" name="admin" value="{{u.id}}" {{'checked=1' if u.is_admin else ''}}/></td>
- <td>
- <input type="submit" name="delete:{{u.id}}" value="delete" />
- <td/>
- </tr>
-{% endfor -%}
- <tr>
- <td></td>
- <td colspan="3"><input type="submit"/></td>
- </tr>
- <tr>
- <td><input type="text" name="newuser"></td>
- <td><input type="submit" value="Add user"></td>
- </tr>
-</table>
-</form>
+ <div id="container">
+ <div id="main">
+ <span class="atRight">
+ {% if 'REMOTE_USER' in request.environ: -%}
+ {{request.environ['REMOTE_USER']}}
+ <a class="loginout" href="/logout">Logout</a>
+ {% else: -%}
+ <a class="loginout" href="/login">Login</a>
+ {% endif -%}
+ </span>
+ <h1>TreeStatus</h1>
+ <h2>Manage Users</h2>
+ <div id="tableWrapper">
+ <form method="post" action="">
+ <input type="hidden" name="token" value="{{token}}">
+ <table>
+ <thead>
+ <tr>
+ <th class="tableWho">Email</th>
+ <th class="tableSheriff">Sheriff?</th>
+ <th class="tableAdmin">Admin?</th>
+ <th class="tableDelete"></th></tr>
+ </thead>
+ <tbody>
+ {% for u in users -%}
+ <tr>
+ <td class="tableWho">{{u.name}}</td>
+ {% if u.is_sheriff -%}
+ <input type="hidden" name="was_sheriff" value="{{u.id}}"/>
+ {% endif -%}
+ {% if u.is_admin -%}
+ <input type="hidden" name="was_admin" value="{{u.id}}"/>
+ {% endif -%}
+ <td class="tableSheriff"><input type="checkbox" name="sheriff" value="{{u.id}}" {{'checked=1' if u.is_sheriff else ''}}/></td>
+ <td class="tableAdmin"><input type="checkbox" name="admin" value="{{u.id}}" {{'checked=1' if u.is_admin else ''}}/></td>
+ <td class="tableDelete">
+ <input type="submit" name="delete:{{u.id}}" value="Delete" />
+ <td/>
+ </tr>
+ {% endfor -%}
+ </tbody>
+ </table>
+ <div id="modify">
+ <span class="atRight"><input type="submit" value="Submit"/></span>
+ </div>
+ <div id="add">
+ <label for="newuser">Add user:
+ <input type="text" name="newuser" />
+ </label>
+ <span class="atRight"><input type="submit" value="Add" /></span>
+ </div>
+ </form>
+ </div>
+ </div>
-<p>
-<a href="/">All trees</a>
-<a href="/help">Help</a>
-<a href="https://github.com/catlee/treestatus">Source</a>
-{% if user and user.is_admin -%}
-<a href="/users">Manage Users</a>
-{% endif -%}
-{% if 'REMOTE_USER' in request.environ: -%}
-<a href="/logout">Logout</a> ({{request.environ['REMOTE_USER']}})
-{% else: -%}
-<a href="/login">Login</a>
-{% endif -%}
-</p>
+ <div id="footer">
+ <span class="footerWrapper">
+ <a href="/">All trees</a>
+ <a href="/help">Help</a>
+ <a href="https://github.com/catlee/treestatus">Source</a>
+ {% if user and user.is_admin -%}
+ <a href="/users">Manage Users</a>
+ {% endif -%}
+ {% if 'REMOTE_USER' in request.environ: -%}
+ <a href="/logout">Logout</a>
+ {% else: -%}
+ <a href="/login">Login</a>
+ {% endif -%}
+ </span>
+ </div>
+ </div>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.