<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>History for {{filter.id}}</title>
    <link rel="stylesheet" href="/css/default.css">
  </head>
  <body>
		{{> menu}}
		<div id="content">
			<div id="changes">
				<h1>History for {{filter.id}}</h1>

				{{#filter}}
				<form id="filter" action="/changes">
					<p>
					<strong>Filter</strong><br>
					<input type="checkbox" id="minor" name="minor" {{#minor}}checked{{/minor}}>
					<label for="minor">include minor changes</label><br>
					<input type="checkbox" id="all" name="all" {{#all}}checked{{/all}}>
					<label for="all">list all changes (not just the last one)</label><br>
					<label for="id" class="wide">by page name </label>
					<input type="text" class="wide" id="name" name="id" value="{{id}}"><br>
					<label for="author" class="wide">by author name </label>
					<input type="text" class="wide" id="author" name="author" value="{{author}}"><br>
					<label>limit to <input type="number" class="narrow" name="n" value="{{n}}"> items</label>
					</p>
					<p><button>Filter changes</button></p>
				</form>
				{{/filter}}

				{{^empty}}
				<form id="filter" action="/diff/{{filter.id}}">
					{{^locked}}
					<p>Using the ｢rollback｣ button on this page resets the page
					to that particular point in time, undoing any later changes
					to this page.</p>
					{{/locked}}
				{{/empty}}

				{{#changes}}
				{{#first}}<h2>{{date}}</h2>{{/first}}
				{{#day}}<h2>{{date}}</h2>{{/day}}
				<p>
					<input type="radio" name="from" value="{{to}}" {{#second}}checked{{/second}}>
					<input type="radio" name="to" value="{{to}}" {{#first}}checked{{/first}}>
					{{time}}
					{{#kept}}{{^locked}}
					<button formmethod="post" formaction="/rollback/{{filter.id}}/{{to}}" name="summary" value="Rollback to {{time}}">rollback</button>
					{{/locked}}{{/kept}}
					{{#revision}}(<a href="/diff/{{filter.id}}/{{to}}">diff</a>){{/revision}}
					<a href="/view/{{filter.id}}/{{to}}">{{filter.id}}</a> …
					{{#author}}<a href="/view/{{author}}">{{author}}</a>{{/author}}
					{{^author}}<span class="ip-code">{{#code}}<span class="c{{c}}">{{c}}</span>{{/code}}</span>{{/author}}
					{{#summary}}
					– {{summary}}
					{{/summary}}
					{{#minor}}(minor){{/minor}}
				</p>
				{{/changes}}
				{{^empty}}
				<input type="submit" value="Show difference">
				</form>
				{{/empty}}
				{{#empty}}
				<p><strong>There are no changes.</strong></p>
				{{/empty}}
			</div>
    </div>

		{{^locked}}
		<form id="lock" method="post" action="/lock/{{filter.id}}">
			<p>This page editable. If you're an administrator, you can lock it.</p>
			<p><button name="pw" value="">Lock page</button></p>
		</form>
		{{/locked}}
		{{#locked}}
		<form id="unlock" method="post" action="/unlock/{{filter.id}}">
			<p>This page is locked. If you're an administrator, you can unlock it.</p>
			<p><button name="pw" value="">Unlock page</button></p>
		</form>
		{{/locked}}

    <div id="footer">
      <hr/>
      <p>
				<a href="/">Home</a>
      </p>
    </div>

  </body>
</html>
