Move templates

This commit is contained in:
Las Zenow 2012-08-15 15:11:52 +02:00
parent 48d1997f4d
commit d924b577d1
9 changed files with 24 additions and 1 deletions

9
templates/about.html Normal file
View file

@ -0,0 +1,9 @@
{{template "header.html"}}
<p>The <strong>Imperial Library of Trantor</strong> (also known as <em>Galactic Library</em>) is a repository of ebooks on ePub format.</p>
<p>You can <a href="/upload/">upload</a> your books. And one of our librarians will take care to store them on our bast bookshelfs and make it avaliable for the rest of the galaxy.</p>
<p>We like to pay the authors, but not the corporations that make profit from them. We won't listen to any content remove request from corporations, editorials, right management organizations or any other blood-shuckers.<p>
{{template "footer.html"}}

16
templates/book.html Normal file
View file

@ -0,0 +1,16 @@
{{template "header.html"}}
<h1>{{.Title}}</h1>
<p>{{.Description}}</p>
<img src="{{.Cover}}" alt="{{.Title}}" />
<ul>
<li><strong>Author:</strong> {{range .Author}}{{.}}, {{end}}</li>
<li><strong>Publisher:</strong> {{.Publisher}}</li>
<li><strong>Tags:</strong> {{range .Subject}}{{.}}, {{end}}</li>
<li><strong>Date:</strong> {{.Date}}</li>
<li><strong>Lang:</strong> {{range .Lang}}{{.}} {{end}}</li>
</ul>
<p><a href="/{{.Path}}">download</a></p>
{{template "footer.html"}}

5
templates/footer.html Normal file
View file

@ -0,0 +1,5 @@
<footer>
<p><small>Chief Librarian: Las Zenow (zenow@tormail.org)</small></p>
</footer>
</body>
</html>

6
templates/header.html Normal file
View file

@ -0,0 +1,6 @@
<html>
<head>
<title>Imperial Library of Trantor</title>
</head>
<body>
<a href="/">Index</a> || <a href="/about/">About</a> || <a href="/upload/">Upload your epub</a>

21
templates/index.html Normal file
View file

@ -0,0 +1,21 @@
{{template "header.html"}}
<h1>Imperial Library of Trantor</h1>
<p><img src="/img/library.jpg" alt="library" /></p>
<form action="/search/">
<input type="search" name="q" />
<input type="submit" value="Search">
</form>
<p>Search on {{.Count}} books.</p>
<p>Last books added:
<ul>
{{with .Books}}
{{range .}}
<li><img src="{{.CoverSmall}}" alt="{{.Title}}" /><a href="/book/{{.Title}}">{{.Title}}</a> - {{range .Author}}{{.}}, {{end}}</li>
{{end}}
{{end}}
</ul>
</p>
{{template "footer.html"}}

23
templates/search.html Normal file
View file

@ -0,0 +1,23 @@
{{template "header.html"}}
<h1>Search</h1>
<form action="/search/">
<input type="search" name="q" value="{{.Search}}"/>
<input type="submit" value="Search">
</form>
<p>Found {{.Found}} books. Page {{.Page}}</p>
<ul>
{{with .Books}}
{{range .}}
<li><img src="{{.CoverSmall}}" alt="{{.Title}}" /><a href="/book/{{.Title}}">{{.Title}}</a> - {{range .Author}}{{.}}, {{end}}</li>
{{end}}
{{end}}
</ul>
<p>
{{if .Prev}}<a href="{{.Prev}}">&lt;Prev</a> {{end}}
{{if .Next}}<a href="{{.Next}}">Next&gt;</a>{{end}}</p>
{{template "footer.html"}}

10
templates/upload.html Normal file
View file

@ -0,0 +1,10 @@
{{template "header.html"}}
{{if .}}<p>{{.}}</p>{{end}}
<form method="POST" enctype="multipart/form-data">
<input accept="application/epub+zip" type="file" name="epub" />
<input type="submit" />
</form>
{{template "footer.html"}}