# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
- '/usr/lib/ais/html_templates',
+ '/usr/lib/ais/www_templates',
)
INSTALLED_APPS = (
+++ /dev/null
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<link rel=icon href='/aiga_water_transportation.svg' sizes=any type='image/svg+xml'>
-<link rel=icon href='/aiga_water_transportation.png' sizes='16x16' type='image/png'>
-<link rel=stylesheet href='/global.css'>
-<link rel=alternate type='application/rss+xml' title='All the news about AIS ship monitoring' href='/news/feed'>
-<title>{% block title %}No title{% endblock %} - AIS</title>
-<script src='/javascript/jquery/jquery.js' type='text/javascript'></script>
-<script src='/global.js' type='text/javascript'></script>
-{% block style_extra %}{% endblock %}
-
-<div id=header>
- <span id=bannertitle>AIS ship monitoring</span>
- <span id=bannermenu>Welcome <a href='/user/{{user.login}}/'>{{ user.name }}</a> ☮ <a href='/user/{{user.login}}/change_password'>change password</a></span>
- <br class=clearall>
- <div id=tabs>
- <a href='/'{% block tab_active_news %}{% endblock %} title="Home page">news</a>
- <a href='/vessel/'{% block tab_active_vessel %}{% endblock %} title="Look for some specific ships">vessels</a>
- <a href='/fleet/'{% block tab_active_fleet %}{% endblock %} title="These are groups of ships shared amongst small groups of users">fleets</a>
- <a href='/user/'{% block tab_active_user %}{% endblock %} title="Accounts to access that web site">users</a>
- {% if user.job_set.count %}
- <a href='/job/'{% block tab_active_job %}{% endblock %} title="Acynchronous jobs">jobs</a>
- {% endif %}
- <a href='/source/'{% block tab_active_source %}{% endblock %} title="Real time statistics">sources</a>
- </div>
-</div>
-<div id=main>
- {% block breadcrumbs %}
- You are here: <a href='/'>home</a>
- {% endblock %}
-
-
- <div style="padding:1ex;">
- {% for message in user.get_messages %}
- <div class=message>
- {{ message.category.id }}: {{ message.txt|safe }}
- </div>
- {% endfor %}
- {% block content %}{% endblock %}
- </div>
-</div>
-
-<div id=footer>
-<!--a href='/svn'-->This<!--/a--> is <a href='http://www.gnu.org/licenses/gpl.html' target=_blank noreferrer>GPL Software</a>
-☮ <a href='http://www.enercoop.coop/' target=_blank noreferrer>Powered by renewable energy</a>
-, <a href='http://www.debian.org/' target=_blank noreferrer>Debian/GNU Linux</a>
-<!--☮ <a href='http://ipv6.com/articles/general/ipv6-the-next-generation-internet.htm' target=_blank noreferrer>IPv6 ready</a>-->
-</div>
+++ /dev/null
-{% extends "fleets.html" %}
-
-{% block title %}
-Fleet {{ fleet.name }} details
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/fleet/{{fleet.name}}/">{{ fleet.name }}</a>
-{% endblock %}
-
-{% block content %}
-<h3>Details of fleet {{ fleet.name }}</h3>
-{{ fleet.description|linebreaksbr }}<br><br>
-<a href=lastpos class=button>Last positions in Google Earth</a><br>
-<a href=list class=button>Vessel list</a> ({{ fleet.vessel_count }} vessel{{ fleet.vessel_count|pluralize }})<br>
-<a href=users class=button>User list</a> ({{ fleet.user_count }} user{{ fleet.user_count|pluralize }})<br>
-<a href=edit class=button>Change details</a><br>
-<a href=history class=button>Browse archives</a><br>
-<br>
-Tip: If you want to delete a fleet, just click "User list" above, and revoke your own access.<br>
-
-{% endblock %}
+++ /dev/null
-{% extends "fleet.html" %}
-
-{% block title %}
-{% if fleet.id %}
-Fleet {{ fleet.name }} edition
-{% else %}
-Fleet creation
-{% endif %}
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-{% if fleet.id %}
-/ <a href="/fleet/{{fleet.name}}/edit">edit</a>
-{% else %}
-<a href="/fleet/add">add</a>
-{% endif %}
-{% endblock %}
-
-{% block content %}
-{% if fleet.id %}
-<h3>Edition of fleet {{ fleet.name }}</h3>
-{% else %}
-<h3>Creation of a new fleet</h3>
-{% endif %}
-<form method=post>
-{% include "fragment_formerror.html" %}
-<table>
-{{ form.as_table }}
-<tr><th><td>
-<input type=submit value=Save>
-</table>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "fleet.html" %}
-
-{% block title %}
-Fleet {{ fleet.name }} history
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/fleet/{{fleet.name}}/history">history</a>
-{% endblock %}
-
-{% block content %}
-
-<h2>Download archive data for fleet {{ fleet.name }}</h2>
-
-{% include "fragment_vessel_history.html" %}
-
-{% endblock %}
+++ /dev/null
-{% extends "fleet.html" %}
-
-{% block title %}
-Fleet {{ fleet.name }} access control list
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/fleet/{{fleet.name}}/users">users</a>
-{% endblock %}
-
-{% block content %}
-<h3>Users of {{ fleet.name }} fleet</h3>
-<ul>
-{% for fleetuser in fleetusers %}
-<li><a href='/user/{{fleetuser.user.login}}/'>{{ fleetuser.user.name }}</a>
-<span style="font-size:80%"><a href='?action=revoke&user={{fleetuser.user.login}}'>revoke access</a></span>
-{% endfor %}
-</ul>
-
-<h3>Add a user</h3>
-<form method=get>
-<input type=hidden name=action value=add>
-<select name=user>
-{% for user in otherusers %}
-<option value={{user.login}}>{{ user.name }}</option>
-{% endfor %}
-</select>
-<input type=submit value=Share>
-</form>
-You can't find the person you want? Do not give your password. Just <a href='/user/add' class=button>create a user account</a>, then come back to that page.
-{% endblock %}
+++ /dev/null
-{% extends "fleet.html" %}
-
-{% block title %}
-Adding vessels in fleet {{ fleet.name }}
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/fleet/{{fleet.name}}/add_vessel">add vessel</a>
-{% endblock %}
-
-{% block content %}
-<h3>Vessels in {{ fleet.name }} fleet</h3>
-
-<form method="post">
-<table>
-{{ form.as_table }}
-</table>
-<input type=submit>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "fleet.html" %}
-
-{% block title %}
-Fleet {{ fleet.name }} vessels
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/fleet/{{fleet.name}}/list">list</a>
-{% endblock %}
-
-{% block content %}
-<h3>Vessels in {{ fleet.name }} fleet</h3>
-
-<form method=post action=add>Add a vessel by MMSI: <input name=mmsi><input type=submit value=Add></form>
-{% if vessels %}
-<table>
-<tr>
- <th>Name
- <th>MMSI
- <th>IMO
- <th>Callsign
- <th>Type
- <th>Updated
-{% for vessel in vessels %}
-{% with vessel.get_last_nmea as nmea %}
-<tr>
- <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_name }}</a>
- <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_mmsi_public }}</a>
- <td>{{ vessel.imo|default_if_none:""}}
- <td>{{ nmea.get_callsign }}
- <td>{{ nmea.get_shiptype }}
- <td>{{ nmea.get_last_updated_delta_str }}
-{% endwith %}
-{% endfor %}
-</table>
-{% else %}
-Fleet is empty.
-{% endif %}
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}
-Fleets
-{% endblock %}
-
-{% block tab_active_fleet %} id=tabactive{% endblock %}
-
-{% block style_extra %}
-<style>
-div.fleet {
-}
-div.fleet span.fleetname {
- font-size: 150%;
-}
-</style>
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/fleet/">fleet</a>
-{% endblock %}
-
-{% block content %}
-<h3>Select a fleet:</h3>
-{% for fleetuser in fleetusers %}
-<a href='{{ fleetuser.fleet.name }}/'>
-<div class=fleet>
-<span class=fleetname>{{ fleetuser.fleet.name }}</span><br>
-{{ fleetuser.fleet.description|linebreaksbr }}<br>
-{{ fleetuser.fleet.vessel_count }} vessel{{ fleetuser.fleet.vessel_count|pluralize }}
-- {{ fleetuser.fleet.user_count }} user{{ fleetuser.fleet.user_count|pluralize }}
-- {{ fleetuser.fleet.job_count }} periodic job{{ fleetuser.fleet.job_count|pluralize }}
-</div>
-</a>
-
-<br><br>
-{% endfor %}
-
-<a href=add class=button>Create a new fleet</a>
-
-{% endblock %}
+++ /dev/null
-{% if form.errors %}
-<ul class=errorlist><li>Please correct the error{{form.errors|pluralize}} bellow</ul>
-{% endif %}
+++ /dev/null
-<span id=csvhint style="display:none;">Make sure you select "Charset: UTF-8" and "Separated by: Coma" when you <a href="/oocalc_howto.png">choose import options</a>.<br></span>
-
-<script type='text/javascript'>
-function show_hide_start_end_time(value) {
- if (value=='duration') {
- $('#id_start_date').attr('disabled', 'disabled');
- $('#id_duration_0').removeAttr('disabled');
- $('#id_duration_1').removeAttr('disabled');
- $('#id_end_date').attr('disabled', 'disabled');
- } else if (value=='date_date') {
- $('#id_start_date').removeAttr('disabled');
- $('#id_duration_0').attr('disabled', 'disabled');
- $('#id_duration_1').attr('disabled', 'disabled');
- $('#id_end_date').removeAttr('disabled');
- } else if (value=='start_duration') {
- $('#id_start_date').removeAttr('disabled');
- $('#id_duration_0').removeAttr('disabled');
- $('#id_duration_1').removeAttr('disabled');
- $('#id_end_date').attr('disabled', 'disabled');
- } else {
- $('#id_start_date').attr('disabled', 'disabled');
- $('#id_duration_0').attr('disabled', 'disabled');
- $('#id_duration_1').attr('disabled', 'disabled');
- $('#id_end_date').attr('disabled', 'disabled');
- }
-}
-$(document).ready(function () {
- show_hide_start_end_time($('input:radio[name=period_type]:checked').val());
-});
-</script>
-<form method=post action=history>
-{% include "fragment_formerror.html" %}
-<table>
-{{ form.as_table }}
-<tr><th><td>
-<input type=submit value=Get>
-</table>
-</form>
+++ /dev/null
-{% extends "base.html" %}
-
-{% block tab_active_news %} id=tabactive{% endblock %}
-
-{% block content %}
-
-<h3>Last changes</h3>
-{% for n in news %}
-<b>{{ n.created|date:"Y-m-d" }}</b> ☮ <b>{{ n.title }}</b><br>
-{{ n.txt|linebreaksbr }}
-<br><br>
-{% endfor %}
-
-<div class='hr'><hr /></div>
-
-<h3>External links</h3>
-<ul>
-<li><a href='http://www.dxinfocentre.com/tropo_eur.html' target=_blank noreferrer>Tropospheric Ducting Forecasts: Europe</a>
-<li><a href='http://en.wikipedia.org/wiki/Automatic_Identification_System' target=_blank noreferrer>AIS on Wikipedia</a>
-<li><a href='http://www.marinetraffic.com/' target=_blank noreferrer>Marine Traffic</a>
-<li><a href='http://www.seasearcher.com/' target=_blank noreferrer>Sea Searcher</a>
-<li><a href='http://www.vesseltracker.com/' target=_blank noreferrer>Vessel Tracker</a>
-<li><a href='http://www.aislive.com/' target=_blank noreferrer>AIS Live</a>
-<li><a href='http://www.digital-seas.com/' target=_blank noreferrer>Digital Seas</a>
-<li><a href='http://www.aishub.net/' target=_blank noreferrer>Ais Hub</a>
-<li><a href='http://www.coaa.co.uk/shipplotter.htm' target=_blank noreferrer>Ship Plotter</a>
-</ul>
-{% endblock %}
+++ /dev/null
-{% extends "jobs.html" %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ {{ job.id }}
-{% endblock %}
-
-{% block title %}
-Job {{ job.id }} details
-{% endblock %}
-
-{% block content %}
-
-<h3>Job {{ job.id }}</h3>
-<tt>{{ job.command }}</tt><br>
-{% if job.finish_time %}
-Status: <b>Completed</b> at {{ job.finish_time|date:"Y-m-d H:i:s" }} UTC in {{ job.process_time }}<br>
-Result: {% if job.result %}<b>Error {{ job.result }}</b>{% else %}<b>Success</b><br>
-Result size: {{ job.get_sucess_size|filesizeformat }}<br>
-<a href="/job/{{ job.id }}/download" class=button>download</a>{% endif %}<br>
-{% else %}
- {% if job.start_time %}
- Status: <b>Running</b> since {{ job.start_time|date:"Y-m-d H:i:s" }} UTC ( {{ job.running_time}} ) <br>
- {% with job.get_stats as stats %}
- {% if stats %}
- Process ID: {{ stats.pid }}<br>
- CPU ID: {{ stats.processor }}<br>
- Nice: {{ stats.nice }}<br>
- State: {{ stats.nice_state }}<br>
- Virtual size: {{ stats.vsize|filesizeformat }}<br>
- Time scheduled in user mode: {{ stats.nice_utime }} s<br>
- Time scheduled in system mode: {{ stats.nice_stime }} s<br>
- {% else %}
- <b>Internal error</b>: process {{ job.pid }} stats are not available.<br>
- Either the job just terminated, or the job runner daemon may have a problem....
- {% endif %}
- {% endwith %}
- {% else %}
- Status: <b>Queued</b> since {{ job.queue_time }}.<br>
- Position in jobs queue: {{ job.queue_rank }} / {{ queue_size }}<br>
- {% endif %}
-{% endif %}
-
-
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block tab_active_job %} id=tabactive{% endblock %}
-
-{% block title %}
-Jobs
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/job/">job</a>
-{% endblock %}
-
-{% block content %}
-
-{% if not jobs %}
-<p><b>No results.</b>
-{% endif %}
-<ul>
-{% for job in jobs %}
-<li><a href="{{job.id}}/">Job {{ job.id }}</a><br>
-<tt>{{ job.command }}</tt><br>
-{% if job.finish_time %}
-Status: <b>Completed</b> at {{ job.finish_time|date:"Y-m-d H:i:s" }} UTC in {{ job.process_time }}<br>
-Result: {% if job.result %}<b>Error {{ job.result }}</b>{% else %}<b>Success</b><br>
-<a href="/job/{{ job.id }}/download" class=button>download</a>{% endif %}<br>
-{% else %}
- {% if job.start_time %}
- Status: <b>Running</b> since {{ job.start_time }}.<br>
- Pid: {{ job.pid }}<br>
- {% else %}
- Status: <b>Queued</b> since {{ job.queue_time }}.<br>
- Position in jobs queue: {{ job.queue_rank }} / {{ queue_size }}<br>
- {% endif %}
-{% endif %}
-
-{% endfor %}
-</ul>
-{% if archive %}
-<a href="." class=button>Hide archived jobs</a>
-{% else %}
-<a href="?archive" class=button>Show archived jobs</a>
-{% endif %}
-
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block content %}
-Have a nice day!
-{% endblock %}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns='http://www.w3.org/2005/Atom'>
-<id>tag:nirgal.com,2000:ais</id>
-<link rel='self' type='application/atom+xml' href='https://{{request.get_host}}/news/feed' />
-<link rel='alternate' type='text/html' href='https://{{request.get_host}}/news/' />
-<title>AIS news</title>
-<subtitle type='text'>AIS ship monitoring news</subtitle>
-<icon uri='https://{{request.get_host}}/aiga_water_transportation.svg' />
-<generator uri='https://ais.nirgal.com/svn'>AIS software</generator>
-<updated>{{ last_update|date:"Y-m-d" }}T{{ last_update|time:"h:i:s" }}Z</updated>
-<author>
- <name>Nirgal Vourgère</name>
- <uri>https://{{request.get_host}}/</uri>
- <email>jvourger@greenpeace.org</email>
-</author>
-
-{% for n in news %}
-<entry>
- <id>tag:nirgal.com,2000:ais/{{ n.id }}</id>
- <title>{{ n.title }}</title>
- <published>{{ n.created|date:"Y-m-d" }}T{{ n.created|time:"h:i:s" }}Z</published>
- <updated>{{ n.updated|date:"Y-m-d" }}T{{ n.updated|time:"h:i:s" }}Z</updated>
- <content type='html'>
- {{ n.txt|linebreaksbr|force_escape }}
- </content>
-</entry>
-{% endfor %}
-</feed>
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}
-News
-{% endblock %}
-
-{% block tab_active_news %} id=tabactive{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/news/">news</a>
-/ <a href="/news/{{ page }}">page {{ page }}</a>
-{% endblock %}
-
-{% block content %}
-
-<h3>News</h3>
-
-{% for n in news %}
-<b>{{ n.created|date:"Y-m-d" }}</b><br>
-{{ n.txt|linebreaksbr }}
-<br><br>
-{% endfor %}
-
-{% ifnotequal npages 1 %}
-<p>
-{% ifnotequal page 1 %}<a href='{{ page|add:"-1" }}' class=button>Previous</a>{% endifnotequal %}
-page {{ page }} / {{ npages }}
-{% ifnotequal page npages %}<a href='{{ page|add:"1" }}' class=button>Next</a>{% endifnotequal %}
-{% endifnotequal %}
-{% endblock %}
+++ /dev/null
-{% extends "sources_index.html" %}
-
-{% block title %}
-Sources graphs
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/source/stats">stats</a>
-{% endblock %}
-
-{% block content %}
-<center>
-{% for source in sources %}
-{% if show_bytes %}
- {% for period in periods %}
- <img src='/stats/{{source.id4}}-{{period.name_tiny}}-bytes.png'>
- {% endfor %}
- <br>
-{% endif %}
-{% if show_counts %}
- {% for period in periods %}
- <img src='/stats/{{source.id4}}-{{period.name_tiny}}-counts.png'>
- {% endfor %}
- <br>
-{% endif %}
-<br>
-{% endfor %}
-</center>
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block style_extra %}
-<style type="text/css">
-span.off {
- color: red;
-}
-span.on {
- color: green;
-}
-span.id2 {
-}
-</style>
-{% endblock %}
-
-{% block title %}
-Sources overview
-{% endblock %}
-
-{% block tab_active_source %} id=tabactive{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/source/">sources</a>
-{% endblock %}
-
-{% block content %}
-<h3>Monitored sources (activity in the last {{ active_minutes }} minute{{ active_minutes|pluralize }})</h3>
-<ul style='padding-left: 1ex;'>
-{% for source in sources %}
-<li style="list-style: none;">
-<span class={% if source.active %}on{% else %}off{% endif %}>
-{% if source.active %} ✔{% else %} ✖{% endif %}
-<span class=id2>{{source.id2}}</span>
-</span>
-{{source.name}}
-<br>
-{% endfor %}
-</ul>
-<h3>Statistical graphs</h3>
-<p>
-
-<form action='stats' method='get'>
-{% include "fragment_formerror.html" %}
-<table>
-{{ form.as_table }}
-<tr><th><td>
-<input type=submit value="View stats">
-</table>
-
-</form>
-
-{% endblock %}
+++ /dev/null
-{% extends "user_edit.html" %}
-
-{% block title %}
-Change password of {{ auser.name }}
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/user/{{auser.login}}/change_password">change password</a>
-{% endblock %}
-
-{% block content %}
-<h3>Change password of {{ auser.name }}</h3>
-
-<form method="post">
-{% include "fragment_formerror.html" %}
-<table>
-{{ form.as_table }}
-<tr><th><td>
-<input type=submit value="Set password">
-</table>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "user_edit.html" %}
-
-{% block title %}
-Delete user acccount {{ auser.name }}
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/user/{{auser.login}}/delete">delete</a>
-{% endblock %}
-
-{% block content %}
-<h3>Delete user acccount {{ auser.name }}</h3>
-You are about to delete acount {{ auser.name }}. <br>
-<b>This will also delete sub-accounts.</b><br>
-Are you sure?<br>
-<a href="?confirm=yes" class=button>Yes, delete it</a><br>
-
-{% endblock %}
+++ /dev/null
-{% extends "users.html" %}
-
-{% block title %}
-User {{ auser.login }} details
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-{% if auser.id %}
-/ <a href="/user/{{auser.login}}/">{{auser.login}}</a>
-{% else %}
-/ <a href="/user/add">add</a>
-{% endif %}
-{% endblock %}
-
-{% block content %}
-<h3>AIS user detail</h3>
-
-Full name: <b>{{ auser.name }}</b><br>
-Login name: <b>{{ auser.login }}</b><br>
-{% if auser.admin_ok %}
-Email: <b>{{ auser.email }}</b><br>
-{% if auser.phone %}
-Phone: <b>{{ auser.phone }}</b><br>
-{% endif %}
-{% endif %}
-Internal Id: </b>{{ auser.id }}</b><br>
-<br>
-Account created {% if auser.father %}by <b><a href="../{{auser.father.login}}/">{{ auser.father.name }}</a></b>{% endif %} on <b>{{ auser.creation_datetime|date}}.</b><br>
-Last access
-{% if auser.access_datetime %}on <b>{{ auser.access_datetime|date}}</b>.
-{% else %}
-<b>unknown</b>.
-{% endif %}
-<br>
-<br>
-{% with auser.fleets_count as nfleets %}
-Has access to {{ nfleets }} fleet{{ nfleets|pluralize }}.
-{% endwith %}<br>
-<br>
-
-{% if auser.admin_ok %}
-Account administration:<br>
-<a href=edit class=button>edit account</a>
-<a href=change_password class=button>change password</a>
-<a href=delete class=button>delete account</a>
-{% endif %}
-{% endblock %}
+++ /dev/null
-{% extends "user_detail.html" %}
-
-{% block title %}
-User edition
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-{% if auser.id %}
- / <a href="/user/{{auser.login}}/edit">edit</a>
-{% endif %}
-{% endblock %}
-
-{% block content %}
-<h3>AIS user edition</h3>
-
-<form method=post>
-{% include "fragment_formerror.html" %}
-<table>
-{{ form.as_table }}
-</table>
-<input type=submit value=Save>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block tab_active_user %} id=tabactive{% endblock %}
-
-{% block title %}
-User accounts
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }} / <a href="/user/">user</a>
-{% endblock %}
-
-{% block content %}
-<h3>User accounts</h3>
-<a href=add class=button>Create new account</a>
-<br>
-<br>
-{% block userlist %}
-{% for auser in users %}
-<a href='{{ auser.login }}/'>{{ auser.name }}</a>
-{%comment%}{% if auser.father %}sponsor: {{ auser.father }}{% endif %}{%endcomment%}
-{% if auser.password_hash %}{% else %}<b>Account disabled: No password</b>{% endif %}
-{% if auser.admin_ok %}
-<span style="font-size:60%">
-<a href='{{auser.login}}/change_password'>change password</a> - <a href='{{auser.login}}/delete'>delete account</a>
-</span>
-{% endif %}
-<br>
-{% endfor %}
-{% endblock %}
-<br>
-<br>
-{% block showtree %}
-<a href="?showtree" class=button>Show tree</a>
-{% endblock %}
-{% endblock %}
+++ /dev/null
-{% extends "users.html" %}
-{% load ais_extras %}
-
-{% block userlist %}
-{{ root|format_user_tree|safe }}
-{% endblock %}
-
-{% block showtree %}
-<a href=. class=button>Hide tree</a>
-{% endblock %}
+++ /dev/null
-{% extends "vessel_index.html" %}
-
-{% block style_extra %}
-{{ block.super }}
-{{ form.media }}
-{% endblock %}
-
-{% block title %}
-{{ nmea.get_title }} - ship details
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/vessel/{{nmea.strmmsi}}/">{{nmea.strmmsi}}</a>
-{% endblock %}
-
-{% block content %}
-<h3>{{ nmea.get_title }}</h3>
-MMSI: {{ nmea.get_mmsi_public }}<br>
-Last updated: {{ nmea.get_last_updated_str }}<br>
-Flag: {{ nmea.get_flag }}<br>
-{% comment %}Imo: <a href='http://www.xvas.it/SPECIAL/xVAS4Ts.php?imo={{ nmea.imo }}&mode='>{{ nmea.imo }}</a><br>{% endcomment %}
-Imo: {{ nmea.imo }}<br>
-Callsign: {{ nmea.get_callsign }}<br>
-Vessel type: {{ nmea.get_shiptype }}<br>
-{% if nmea.get_length %}
-Length: {{ nmea.get_length }} meters<br>
-{% endif %}
-{% if nmea.get_width %}
-Width: {{ nmea.get_width }} meters<br>
-{% endif %}
-Draught: {{ nmea.get_draught_str }}<br>
-<br>
-Status: {{ nmea.get_status }}<br>
-Speed over ground: {{ nmea.get_sog_str }}<br>
-Rotation: {{ nmea.get_rot_str }}<br>
-Latitude: {{ nmea.get_latitude_str }}<br>
-Longitude: {{ nmea.get_longitude_str }}<br>
-Course over ground: {{ nmea.get_cog_str }}<br>
-Heading: {{ nmea.get_heading_str }}<br>
-<br>
-Destination: {{ nmea.get_destination }}<br>
-ETA: {{ nmea.get_eta_str }}<br>
-<br>
-Sources: position by {{ nmea.get_source_1_str }}, voyage by {{ nmea.get_source_5_str }}<br>
-
-<br>
-<br>
-<a href=lastpos class=button>Position in google earth</a>
-<h2>Get archive data</h2>
-{% include "fragment_vessel_history.html" %}
-
-{% endblock %}
+++ /dev/null
-{% extends "vessel.html" %}
-
-{% block title %}
-Archive data for {{ nmea.get_name }}
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/vessel/{{nmea.strmmsi}}/history">history</a>
-{% endblock %}
-
-{% block content %}
-
-<h2>Download archive data for {{ nmea.get_name }}</h2>
-
-{% include "fragment_vessel_history.html" %}
-
-{% endblock %}
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}
-Vessel search
-{% endblock %}
-
-{% block tab_active_vessel %} id=tabactive{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/vessel/">vessel</a>
-{% endblock %}
-
-{% block content %}
-<h3>Look for vessels</h3>
-<form method=post>
-<table>
-{{ form.as_table }}
-<tr><th><td>
-<input type=submit value=Search>
-</table>
-</form>
-{% endblock %}
+++ /dev/null
-{% extends "vessel.html" %}
-
-{% block title %}
-{{ nmea.get_title}} - manual input
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/vessel/{{nmea.strmmsi}}/manual_input">manual input</a>
-{% endblock %}
-
-{% block content %}
-<h3>{{ nmea.get_title }} - Manual input</h3>
-Use this form to enter data aquired without AIS.
-<p>
-<form method="post">
-<table>
-{{ form.as_table }}
-</table>
-<input type=submit>
-</form>
-
-{% endblock %}
+++ /dev/null
-{% extends "vessel_index.html" %}
-
-{% load ais_extras %}
-
-{% block title %}
-Vessel search results
-{% endblock %}
-
-{% block breadcrumbs %}
-{{ block.super }}
-/ <a href="/vessel/search">search</a>
-{% endblock %}
-
-{% block content %}
-<h3>Vessel search results</h3>
-{% if vessels %}
-<table>
-<tr>
- <th>Name
- <th>MMSI
- <th>IMO
- <th>Callsign
-{% for vessel in vessels %}
-<tr>
- <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.name }}</a>
- <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.mmsi|sqlmmsi_to_strmmsi }}</a>
- <td>{{ vessel.imo|default_if_none:""}}
- <td>{{ vessel.callsign }}
-{% endfor %}
-</table>
-{% else %}
-<p>No result.
-<p>
-<a href="javascript:history.go(-1)" class=button>Try again</a>
-{% endif %}
-{% endblock %}
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<link rel=icon href='/aiga_water_transportation.svg' sizes=any type='image/svg+xml'>
+<link rel=icon href='/aiga_water_transportation.png' sizes='16x16' type='image/png'>
+<link rel=stylesheet href='/global.css'>
+<link rel=alternate type='application/rss+xml' title='All the news about AIS ship monitoring' href='/news/feed'>
+<title>{% block title %}No title{% endblock %} - AIS</title>
+<script src='/javascript/jquery/jquery.js' type='text/javascript'></script>
+<script src='/global.js' type='text/javascript'></script>
+{% block style_extra %}{% endblock %}
+
+<div id=header>
+ <span id=bannertitle>AIS ship monitoring</span>
+ <span id=bannermenu>Welcome <a href='/user/{{user.login}}/'>{{ user.name }}</a> ☮ <a href='/user/{{user.login}}/change_password'>change password</a></span>
+ <br class=clearall>
+ <div id=tabs>
+ <a href='/'{% block tab_active_news %}{% endblock %} title="Home page">news</a>
+ <a href='/vessel/'{% block tab_active_vessel %}{% endblock %} title="Look for some specific ships">vessels</a>
+ <a href='/fleet/'{% block tab_active_fleet %}{% endblock %} title="These are groups of ships shared amongst small groups of users">fleets</a>
+ <a href='/user/'{% block tab_active_user %}{% endblock %} title="Accounts to access that web site">users</a>
+ {% if user.job_set.count %}
+ <a href='/job/'{% block tab_active_job %}{% endblock %} title="Acynchronous jobs">jobs</a>
+ {% endif %}
+ <a href='/source/'{% block tab_active_source %}{% endblock %} title="Real time statistics">sources</a>
+ </div>
+</div>
+<div id=main>
+ {% block breadcrumbs %}
+ You are here: <a href='/'>home</a>
+ {% endblock %}
+
+
+ <div style="padding:1ex;">
+ {% for message in user.get_messages %}
+ <div class=message>
+ {{ message.category.id }}: {{ message.txt|safe }}
+ </div>
+ {% endfor %}
+ {% block content %}{% endblock %}
+ </div>
+</div>
+
+<div id=footer>
+<!--a href='/svn'-->This<!--/a--> is <a href='http://www.gnu.org/licenses/gpl.html' target=_blank noreferrer>GPL Software</a>
+☮ <a href='http://www.enercoop.coop/' target=_blank noreferrer>Powered by renewable energy</a>
+, <a href='http://www.debian.org/' target=_blank noreferrer>Debian/GNU Linux</a>
+<!--☮ <a href='http://ipv6.com/articles/general/ipv6-the-next-generation-internet.htm' target=_blank noreferrer>IPv6 ready</a>-->
+</div>
--- /dev/null
+{% extends "fleets.html" %}
+
+{% block title %}
+Fleet {{ fleet.name }} details
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/fleet/{{fleet.name}}/">{{ fleet.name }}</a>
+{% endblock %}
+
+{% block content %}
+<h3>Details of fleet {{ fleet.name }}</h3>
+{{ fleet.description|linebreaksbr }}<br><br>
+<a href=lastpos class=button>Last positions in Google Earth</a><br>
+<a href=list class=button>Vessel list</a> ({{ fleet.vessel_count }} vessel{{ fleet.vessel_count|pluralize }})<br>
+<a href=users class=button>User list</a> ({{ fleet.user_count }} user{{ fleet.user_count|pluralize }})<br>
+<a href=edit class=button>Change details</a><br>
+<a href=history class=button>Browse archives</a><br>
+<br>
+Tip: If you want to delete a fleet, just click "User list" above, and revoke your own access.<br>
+
+{% endblock %}
--- /dev/null
+{% extends "fleet.html" %}
+
+{% block title %}
+{% if fleet.id %}
+Fleet {{ fleet.name }} edition
+{% else %}
+Fleet creation
+{% endif %}
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+{% if fleet.id %}
+/ <a href="/fleet/{{fleet.name}}/edit">edit</a>
+{% else %}
+<a href="/fleet/add">add</a>
+{% endif %}
+{% endblock %}
+
+{% block content %}
+{% if fleet.id %}
+<h3>Edition of fleet {{ fleet.name }}</h3>
+{% else %}
+<h3>Creation of a new fleet</h3>
+{% endif %}
+<form method=post>
+{% include "fragment_formerror.html" %}
+<table>
+{{ form.as_table }}
+<tr><th><td>
+<input type=submit value=Save>
+</table>
+</form>
+{% endblock %}
--- /dev/null
+{% extends "fleet.html" %}
+
+{% block title %}
+Fleet {{ fleet.name }} history
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/fleet/{{fleet.name}}/history">history</a>
+{% endblock %}
+
+{% block content %}
+
+<h2>Download archive data for fleet {{ fleet.name }}</h2>
+
+{% include "fragment_vessel_history.html" %}
+
+{% endblock %}
--- /dev/null
+{% extends "fleet.html" %}
+
+{% block title %}
+Fleet {{ fleet.name }} access control list
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/fleet/{{fleet.name}}/users">users</a>
+{% endblock %}
+
+{% block content %}
+<h3>Users of {{ fleet.name }} fleet</h3>
+<ul>
+{% for fleetuser in fleetusers %}
+<li><a href='/user/{{fleetuser.user.login}}/'>{{ fleetuser.user.name }}</a>
+<span style="font-size:80%"><a href='?action=revoke&user={{fleetuser.user.login}}'>revoke access</a></span>
+{% endfor %}
+</ul>
+
+<h3>Add a user</h3>
+<form method=get>
+<input type=hidden name=action value=add>
+<select name=user>
+{% for user in otherusers %}
+<option value={{user.login}}>{{ user.name }}</option>
+{% endfor %}
+</select>
+<input type=submit value=Share>
+</form>
+You can't find the person you want? Do not give your password. Just <a href='/user/add' class=button>create a user account</a>, then come back to that page.
+{% endblock %}
--- /dev/null
+{% extends "fleet.html" %}
+
+{% block title %}
+Adding vessels in fleet {{ fleet.name }}
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/fleet/{{fleet.name}}/add_vessel">add vessel</a>
+{% endblock %}
+
+{% block content %}
+<h3>Vessels in {{ fleet.name }} fleet</h3>
+
+<form method="post">
+<table>
+{{ form.as_table }}
+</table>
+<input type=submit>
+</form>
+{% endblock %}
--- /dev/null
+{% extends "fleet.html" %}
+
+{% block title %}
+Fleet {{ fleet.name }} vessels
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/fleet/{{fleet.name}}/list">list</a>
+{% endblock %}
+
+{% block content %}
+<h3>Vessels in {{ fleet.name }} fleet</h3>
+
+<form method=post action=add>Add a vessel by MMSI: <input name=mmsi><input type=submit value=Add></form>
+{% if vessels %}
+<table>
+<tr>
+ <th>Name
+ <th>MMSI
+ <th>IMO
+ <th>Callsign
+ <th>Type
+ <th>Updated
+{% for vessel in vessels %}
+{% with vessel.get_last_nmea as nmea %}
+<tr>
+ <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_name }}</a>
+ <td><a href='/vessel/{{nmea.strmmsi}}/'>{{ nmea.get_mmsi_public }}</a>
+ <td>{{ vessel.imo|default_if_none:""}}
+ <td>{{ nmea.get_callsign }}
+ <td>{{ nmea.get_shiptype }}
+ <td>{{ nmea.get_last_updated_delta_str }}
+{% endwith %}
+{% endfor %}
+</table>
+{% else %}
+Fleet is empty.
+{% endif %}
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block title %}
+Fleets
+{% endblock %}
+
+{% block tab_active_fleet %} id=tabactive{% endblock %}
+
+{% block style_extra %}
+<style>
+div.fleet {
+}
+div.fleet span.fleetname {
+ font-size: 150%;
+}
+</style>
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/fleet/">fleet</a>
+{% endblock %}
+
+{% block content %}
+<h3>Select a fleet:</h3>
+{% for fleetuser in fleetusers %}
+<a href='{{ fleetuser.fleet.name }}/'>
+<div class=fleet>
+<span class=fleetname>{{ fleetuser.fleet.name }}</span><br>
+{{ fleetuser.fleet.description|linebreaksbr }}<br>
+{{ fleetuser.fleet.vessel_count }} vessel{{ fleetuser.fleet.vessel_count|pluralize }}
+- {{ fleetuser.fleet.user_count }} user{{ fleetuser.fleet.user_count|pluralize }}
+- {{ fleetuser.fleet.job_count }} periodic job{{ fleetuser.fleet.job_count|pluralize }}
+</div>
+</a>
+
+<br><br>
+{% endfor %}
+
+<a href=add class=button>Create a new fleet</a>
+
+{% endblock %}
--- /dev/null
+{% if form.errors %}
+<ul class=errorlist><li>Please correct the error{{form.errors|pluralize}} bellow</ul>
+{% endif %}
--- /dev/null
+<span id=csvhint style="display:none;">Make sure you select "Charset: UTF-8" and "Separated by: Coma" when you <a href="/oocalc_howto.png">choose import options</a>.<br></span>
+
+<script type='text/javascript'>
+function show_hide_start_end_time(value) {
+ if (value=='duration') {
+ $('#id_start_date').attr('disabled', 'disabled');
+ $('#id_duration_0').removeAttr('disabled');
+ $('#id_duration_1').removeAttr('disabled');
+ $('#id_end_date').attr('disabled', 'disabled');
+ } else if (value=='date_date') {
+ $('#id_start_date').removeAttr('disabled');
+ $('#id_duration_0').attr('disabled', 'disabled');
+ $('#id_duration_1').attr('disabled', 'disabled');
+ $('#id_end_date').removeAttr('disabled');
+ } else if (value=='start_duration') {
+ $('#id_start_date').removeAttr('disabled');
+ $('#id_duration_0').removeAttr('disabled');
+ $('#id_duration_1').removeAttr('disabled');
+ $('#id_end_date').attr('disabled', 'disabled');
+ } else {
+ $('#id_start_date').attr('disabled', 'disabled');
+ $('#id_duration_0').attr('disabled', 'disabled');
+ $('#id_duration_1').attr('disabled', 'disabled');
+ $('#id_end_date').attr('disabled', 'disabled');
+ }
+}
+$(document).ready(function () {
+ show_hide_start_end_time($('input:radio[name=period_type]:checked').val());
+});
+</script>
+<form method=post action=history>
+{% include "fragment_formerror.html" %}
+<table>
+{{ form.as_table }}
+<tr><th><td>
+<input type=submit value=Get>
+</table>
+</form>
--- /dev/null
+{% extends "base.html" %}
+
+{% block tab_active_news %} id=tabactive{% endblock %}
+
+{% block content %}
+
+<h3>Last changes</h3>
+{% for n in news %}
+<b>{{ n.created|date:"Y-m-d" }}</b> ☮ <b>{{ n.title }}</b><br>
+{{ n.txt|linebreaksbr }}
+<br><br>
+{% endfor %}
+
+<div class='hr'><hr /></div>
+
+<h3>External links</h3>
+<ul>
+<li><a href='http://www.dxinfocentre.com/tropo_eur.html' target=_blank noreferrer>Tropospheric Ducting Forecasts: Europe</a>
+<li><a href='http://en.wikipedia.org/wiki/Automatic_Identification_System' target=_blank noreferrer>AIS on Wikipedia</a>
+<li><a href='http://www.marinetraffic.com/' target=_blank noreferrer>Marine Traffic</a>
+<li><a href='http://www.seasearcher.com/' target=_blank noreferrer>Sea Searcher</a>
+<li><a href='http://www.vesseltracker.com/' target=_blank noreferrer>Vessel Tracker</a>
+<li><a href='http://www.aislive.com/' target=_blank noreferrer>AIS Live</a>
+<li><a href='http://www.digital-seas.com/' target=_blank noreferrer>Digital Seas</a>
+<li><a href='http://www.aishub.net/' target=_blank noreferrer>Ais Hub</a>
+<li><a href='http://www.coaa.co.uk/shipplotter.htm' target=_blank noreferrer>Ship Plotter</a>
+</ul>
+{% endblock %}
--- /dev/null
+{% extends "jobs.html" %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ {{ job.id }}
+{% endblock %}
+
+{% block title %}
+Job {{ job.id }} details
+{% endblock %}
+
+{% block content %}
+
+<h3>Job {{ job.id }}</h3>
+<tt>{{ job.command }}</tt><br>
+{% if job.finish_time %}
+Status: <b>Completed</b> at {{ job.finish_time|date:"Y-m-d H:i:s" }} UTC in {{ job.process_time }}<br>
+Result: {% if job.result %}<b>Error {{ job.result }}</b>{% else %}<b>Success</b><br>
+Result size: {{ job.get_sucess_size|filesizeformat }}<br>
+<a href="/job/{{ job.id }}/download" class=button>download</a>{% endif %}<br>
+{% else %}
+ {% if job.start_time %}
+ Status: <b>Running</b> since {{ job.start_time|date:"Y-m-d H:i:s" }} UTC ( {{ job.running_time}} ) <br>
+ {% with job.get_stats as stats %}
+ {% if stats %}
+ Process ID: {{ stats.pid }}<br>
+ CPU ID: {{ stats.processor }}<br>
+ Nice: {{ stats.nice }}<br>
+ State: {{ stats.nice_state }}<br>
+ Virtual size: {{ stats.vsize|filesizeformat }}<br>
+ Time scheduled in user mode: {{ stats.nice_utime }} s<br>
+ Time scheduled in system mode: {{ stats.nice_stime }} s<br>
+ {% else %}
+ <b>Internal error</b>: process {{ job.pid }} stats are not available.<br>
+ Either the job just terminated, or the job runner daemon may have a problem....
+ {% endif %}
+ {% endwith %}
+ {% else %}
+ Status: <b>Queued</b> since {{ job.queue_time }}.<br>
+ Position in jobs queue: {{ job.queue_rank }} / {{ queue_size }}<br>
+ {% endif %}
+{% endif %}
+
+
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block tab_active_job %} id=tabactive{% endblock %}
+
+{% block title %}
+Jobs
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/job/">job</a>
+{% endblock %}
+
+{% block content %}
+
+{% if not jobs %}
+<p><b>No results.</b>
+{% endif %}
+<ul>
+{% for job in jobs %}
+<li><a href="{{job.id}}/">Job {{ job.id }}</a><br>
+<tt>{{ job.command }}</tt><br>
+{% if job.finish_time %}
+Status: <b>Completed</b> at {{ job.finish_time|date:"Y-m-d H:i:s" }} UTC in {{ job.process_time }}<br>
+Result: {% if job.result %}<b>Error {{ job.result }}</b>{% else %}<b>Success</b><br>
+<a href="/job/{{ job.id }}/download" class=button>download</a>{% endif %}<br>
+{% else %}
+ {% if job.start_time %}
+ Status: <b>Running</b> since {{ job.start_time }}.<br>
+ Pid: {{ job.pid }}<br>
+ {% else %}
+ Status: <b>Queued</b> since {{ job.queue_time }}.<br>
+ Position in jobs queue: {{ job.queue_rank }} / {{ queue_size }}<br>
+ {% endif %}
+{% endif %}
+
+{% endfor %}
+</ul>
+{% if archive %}
+<a href="." class=button>Hide archived jobs</a>
+{% else %}
+<a href="?archive" class=button>Show archived jobs</a>
+{% endif %}
+
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block content %}
+Have a nice day!
+{% endblock %}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns='http://www.w3.org/2005/Atom'>
+<id>tag:nirgal.com,2000:ais</id>
+<link rel='self' type='application/atom+xml' href='https://{{request.get_host}}/news/feed' />
+<link rel='alternate' type='text/html' href='https://{{request.get_host}}/news/' />
+<title>AIS news</title>
+<subtitle type='text'>AIS ship monitoring news</subtitle>
+<icon uri='https://{{request.get_host}}/aiga_water_transportation.svg' />
+<generator uri='https://ais.nirgal.com/svn'>AIS software</generator>
+<updated>{{ last_update|date:"Y-m-d" }}T{{ last_update|time:"h:i:s" }}Z</updated>
+<author>
+ <name>Nirgal Vourgère</name>
+ <uri>https://{{request.get_host}}/</uri>
+ <email>jvourger@greenpeace.org</email>
+</author>
+
+{% for n in news %}
+<entry>
+ <id>tag:nirgal.com,2000:ais/{{ n.id }}</id>
+ <title>{{ n.title }}</title>
+ <published>{{ n.created|date:"Y-m-d" }}T{{ n.created|time:"h:i:s" }}Z</published>
+ <updated>{{ n.updated|date:"Y-m-d" }}T{{ n.updated|time:"h:i:s" }}Z</updated>
+ <content type='html'>
+ {{ n.txt|linebreaksbr|force_escape }}
+ </content>
+</entry>
+{% endfor %}
+</feed>
--- /dev/null
+{% extends "base.html" %}
+
+{% block title %}
+News
+{% endblock %}
+
+{% block tab_active_news %} id=tabactive{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/news/">news</a>
+/ <a href="/news/{{ page }}">page {{ page }}</a>
+{% endblock %}
+
+{% block content %}
+
+<h3>News</h3>
+
+{% for n in news %}
+<b>{{ n.created|date:"Y-m-d" }}</b><br>
+{{ n.txt|linebreaksbr }}
+<br><br>
+{% endfor %}
+
+{% ifnotequal npages 1 %}
+<p>
+{% ifnotequal page 1 %}<a href='{{ page|add:"-1" }}' class=button>Previous</a>{% endifnotequal %}
+page {{ page }} / {{ npages }}
+{% ifnotequal page npages %}<a href='{{ page|add:"1" }}' class=button>Next</a>{% endifnotequal %}
+{% endifnotequal %}
+{% endblock %}
--- /dev/null
+{% extends "sources_index.html" %}
+
+{% block title %}
+Sources graphs
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/source/stats">stats</a>
+{% endblock %}
+
+{% block content %}
+<center>
+{% for source in sources %}
+{% if show_bytes %}
+ {% for period in periods %}
+ <img src='/stats/{{source.id4}}-{{period.name_tiny}}-bytes.png'>
+ {% endfor %}
+ <br>
+{% endif %}
+{% if show_counts %}
+ {% for period in periods %}
+ <img src='/stats/{{source.id4}}-{{period.name_tiny}}-counts.png'>
+ {% endfor %}
+ <br>
+{% endif %}
+<br>
+{% endfor %}
+</center>
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block style_extra %}
+<style type="text/css">
+span.off {
+ color: red;
+}
+span.on {
+ color: green;
+}
+span.id2 {
+}
+</style>
+{% endblock %}
+
+{% block title %}
+Sources overview
+{% endblock %}
+
+{% block tab_active_source %} id=tabactive{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/source/">sources</a>
+{% endblock %}
+
+{% block content %}
+<h3>Monitored sources (activity in the last {{ active_minutes }} minute{{ active_minutes|pluralize }})</h3>
+<ul style='padding-left: 1ex;'>
+{% for source in sources %}
+<li style="list-style: none;">
+<span class={% if source.active %}on{% else %}off{% endif %}>
+{% if source.active %} ✔{% else %} ✖{% endif %}
+<span class=id2>{{source.id2}}</span>
+</span>
+{{source.name}}
+<br>
+{% endfor %}
+</ul>
+<h3>Statistical graphs</h3>
+<p>
+
+<form action='stats' method='get'>
+{% include "fragment_formerror.html" %}
+<table>
+{{ form.as_table }}
+<tr><th><td>
+<input type=submit value="View stats">
+</table>
+
+</form>
+
+{% endblock %}
--- /dev/null
+{% extends "user_edit.html" %}
+
+{% block title %}
+Change password of {{ auser.name }}
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/user/{{auser.login}}/change_password">change password</a>
+{% endblock %}
+
+{% block content %}
+<h3>Change password of {{ auser.name }}</h3>
+
+<form method="post">
+{% include "fragment_formerror.html" %}
+<table>
+{{ form.as_table }}
+<tr><th><td>
+<input type=submit value="Set password">
+</table>
+</form>
+{% endblock %}
--- /dev/null
+{% extends "user_edit.html" %}
+
+{% block title %}
+Delete user acccount {{ auser.name }}
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/user/{{auser.login}}/delete">delete</a>
+{% endblock %}
+
+{% block content %}
+<h3>Delete user acccount {{ auser.name }}</h3>
+You are about to delete acount {{ auser.name }}. <br>
+<b>This will also delete sub-accounts.</b><br>
+Are you sure?<br>
+<a href="?confirm=yes" class=button>Yes, delete it</a><br>
+
+{% endblock %}
--- /dev/null
+{% extends "users.html" %}
+
+{% block title %}
+User {{ auser.login }} details
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+{% if auser.id %}
+/ <a href="/user/{{auser.login}}/">{{auser.login}}</a>
+{% else %}
+/ <a href="/user/add">add</a>
+{% endif %}
+{% endblock %}
+
+{% block content %}
+<h3>AIS user detail</h3>
+
+Full name: <b>{{ auser.name }}</b><br>
+Login name: <b>{{ auser.login }}</b><br>
+{% if auser.admin_ok %}
+Email: <b>{{ auser.email }}</b><br>
+{% if auser.phone %}
+Phone: <b>{{ auser.phone }}</b><br>
+{% endif %}
+{% endif %}
+Internal Id: </b>{{ auser.id }}</b><br>
+<br>
+Account created {% if auser.father %}by <b><a href="../{{auser.father.login}}/">{{ auser.father.name }}</a></b>{% endif %} on <b>{{ auser.creation_datetime|date}}.</b><br>
+Last access
+{% if auser.access_datetime %}on <b>{{ auser.access_datetime|date}}</b>.
+{% else %}
+<b>unknown</b>.
+{% endif %}
+<br>
+<br>
+{% with auser.fleets_count as nfleets %}
+Has access to {{ nfleets }} fleet{{ nfleets|pluralize }}.
+{% endwith %}<br>
+<br>
+
+{% if auser.admin_ok %}
+Account administration:<br>
+<a href=edit class=button>edit account</a>
+<a href=change_password class=button>change password</a>
+<a href=delete class=button>delete account</a>
+{% endif %}
+{% endblock %}
--- /dev/null
+{% extends "user_detail.html" %}
+
+{% block title %}
+User edition
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+{% if auser.id %}
+ / <a href="/user/{{auser.login}}/edit">edit</a>
+{% endif %}
+{% endblock %}
+
+{% block content %}
+<h3>AIS user edition</h3>
+
+<form method=post>
+{% include "fragment_formerror.html" %}
+<table>
+{{ form.as_table }}
+</table>
+<input type=submit value=Save>
+</form>
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block tab_active_user %} id=tabactive{% endblock %}
+
+{% block title %}
+User accounts
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }} / <a href="/user/">user</a>
+{% endblock %}
+
+{% block content %}
+<h3>User accounts</h3>
+<a href=add class=button>Create new account</a>
+<br>
+<br>
+{% block userlist %}
+{% for auser in users %}
+<a href='{{ auser.login }}/'>{{ auser.name }}</a>
+{%comment%}{% if auser.father %}sponsor: {{ auser.father }}{% endif %}{%endcomment%}
+{% if auser.password_hash %}{% else %}<b>Account disabled: No password</b>{% endif %}
+{% if auser.admin_ok %}
+<span style="font-size:60%">
+<a href='{{auser.login}}/change_password'>change password</a> - <a href='{{auser.login}}/delete'>delete account</a>
+</span>
+{% endif %}
+<br>
+{% endfor %}
+{% endblock %}
+<br>
+<br>
+{% block showtree %}
+<a href="?showtree" class=button>Show tree</a>
+{% endblock %}
+{% endblock %}
--- /dev/null
+{% extends "users.html" %}
+{% load ais_extras %}
+
+{% block userlist %}
+{{ root|format_user_tree|safe }}
+{% endblock %}
+
+{% block showtree %}
+<a href=. class=button>Hide tree</a>
+{% endblock %}
--- /dev/null
+{% extends "vessel_index.html" %}
+
+{% block style_extra %}
+{{ block.super }}
+{{ form.media }}
+{% endblock %}
+
+{% block title %}
+{{ nmea.get_title }} - ship details
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/vessel/{{nmea.strmmsi}}/">{{nmea.strmmsi}}</a>
+{% endblock %}
+
+{% block content %}
+<h3>{{ nmea.get_title }}</h3>
+MMSI: {{ nmea.get_mmsi_public }}<br>
+Last updated: {{ nmea.get_last_updated_str }}<br>
+Flag: {{ nmea.get_flag }}<br>
+{% comment %}Imo: <a href='http://www.xvas.it/SPECIAL/xVAS4Ts.php?imo={{ nmea.imo }}&mode='>{{ nmea.imo }}</a><br>{% endcomment %}
+Imo: {{ nmea.imo }}<br>
+Callsign: {{ nmea.get_callsign }}<br>
+Vessel type: {{ nmea.get_shiptype }}<br>
+{% if nmea.get_length %}
+Length: {{ nmea.get_length }} meters<br>
+{% endif %}
+{% if nmea.get_width %}
+Width: {{ nmea.get_width }} meters<br>
+{% endif %}
+Draught: {{ nmea.get_draught_str }}<br>
+<br>
+Status: {{ nmea.get_status }}<br>
+Speed over ground: {{ nmea.get_sog_str }}<br>
+Rotation: {{ nmea.get_rot_str }}<br>
+Latitude: {{ nmea.get_latitude_str }}<br>
+Longitude: {{ nmea.get_longitude_str }}<br>
+Course over ground: {{ nmea.get_cog_str }}<br>
+Heading: {{ nmea.get_heading_str }}<br>
+<br>
+Destination: {{ nmea.get_destination }}<br>
+ETA: {{ nmea.get_eta_str }}<br>
+<br>
+Sources: position by {{ nmea.get_source_1_str }}, voyage by {{ nmea.get_source_5_str }}<br>
+
+<br>
+<br>
+<a href=lastpos class=button>Position in google earth</a>
+<h2>Get archive data</h2>
+{% include "fragment_vessel_history.html" %}
+
+{% endblock %}
--- /dev/null
+{% extends "vessel.html" %}
+
+{% block title %}
+Archive data for {{ nmea.get_name }}
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/vessel/{{nmea.strmmsi}}/history">history</a>
+{% endblock %}
+
+{% block content %}
+
+<h2>Download archive data for {{ nmea.get_name }}</h2>
+
+{% include "fragment_vessel_history.html" %}
+
+{% endblock %}
--- /dev/null
+{% extends "base.html" %}
+
+{% block title %}
+Vessel search
+{% endblock %}
+
+{% block tab_active_vessel %} id=tabactive{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/vessel/">vessel</a>
+{% endblock %}
+
+{% block content %}
+<h3>Look for vessels</h3>
+<form method=post>
+<table>
+{{ form.as_table }}
+<tr><th><td>
+<input type=submit value=Search>
+</table>
+</form>
+{% endblock %}
--- /dev/null
+{% extends "vessel.html" %}
+
+{% block title %}
+{{ nmea.get_title}} - manual input
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/vessel/{{nmea.strmmsi}}/manual_input">manual input</a>
+{% endblock %}
+
+{% block content %}
+<h3>{{ nmea.get_title }} - Manual input</h3>
+Use this form to enter data aquired without AIS.
+<p>
+<form method="post">
+<table>
+{{ form.as_table }}
+</table>
+<input type=submit>
+</form>
+
+{% endblock %}
--- /dev/null
+{% extends "vessel_index.html" %}
+
+{% load ais_extras %}
+
+{% block title %}
+Vessel search results
+{% endblock %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href="/vessel/search">search</a>
+{% endblock %}
+
+{% block content %}
+<h3>Vessel search results</h3>
+{% if vessels %}
+<table>
+<tr>
+ <th>Name
+ <th>MMSI
+ <th>IMO
+ <th>Callsign
+{% for vessel in vessels %}
+<tr>
+ <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.name }}</a>
+ <td><a href='/vessel/{{vessel.mmsi|sqlmmsi_to_strmmsi}}/'>{{ vessel.mmsi|sqlmmsi_to_strmmsi }}</a>
+ <td>{{ vessel.imo|default_if_none:""}}
+ <td>{{ vessel.callsign }}
+{% endfor %}
+</table>
+{% else %}
+<p>No result.
+<p>
+<a href="javascript:history.go(-1)" class=button>Try again</a>
+{% endif %}
+{% endblock %}