Basic bootstrap design

This commit is contained in:
Las Zenow 2012-08-17 08:25:44 +02:00
parent 86f5362fc1
commit c13899c757
12 changed files with 7796 additions and 42 deletions

View file

@ -1,16 +1,41 @@
{{template "header.html"}}
<h1>{{.Title}}</h1>
<p>{{.Description}}</p>
{{if .Cover}}<img src="{{.Cover}}" alt="{{.Title}}" />{{end}}
<ul>
<li><strong>Author:</strong> {{range .Author}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}</li>
<li><strong>Publisher:</strong> <a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a></li>
<li><strong>Tags:</strong> {{range .Subject}}<a href="/search/?q=subject:{{.}}">{{.}}</a>, {{end}}</li>
<li><strong>Date:</strong> {{.Date}}</li>
<li><strong>Lang:</strong> {{range .Lang}}<a href="/search/?q=lang:{{.}}">{{.}}</a> {{end}}</li>
</ul>
<div class="row">
<div class="span8 offset4">
<h1>{{.Title}}</h1>
</div>
</div>
<div class="row">
{{if .Cover}}
<div class="span4">
<img src="{{.Cover}}" alt="{{.Title}}" class="pull-right" />
</div>
{{end}}
<p><a href="/{{.Path}}">download</a></p>
<div class="span8">
<div class="row"><p></p></div>
<div class="row">
<div class="span4">
<ul class="unstyled">
{{if .Author}}<li><strong>Author:</strong> {{range .Author}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}</li>{{end}}
{{if .Publisher}}<li><strong>Publisher:</strong> <a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a></li>{{end}}
{{if .Subject}}<li><strong>Tags:</strong> {{range .Subject}}<a href="/search/?q=subject:{{.}}">{{.}}</a>, {{end}}</li>{{end}}
{{if .Date}}<li><strong>Date:</strong> {{.Date}}</li>{{end}}
{{if .Lang}}<li><strong>Lang:</strong> {{range .Lang}}<a href="/search/?q=lang:{{.}}">{{.}}</a> {{end}}</li>{{end}}
</ul>
</div>
<div class="span4">
<p><a href="/{{.Path}}" class="btn btn-large btn-inverse pull-right">download</a></p>
</div>
</div>
<div class="row">
<div class="span8">
<p>{{.Description}}</p>
</div>
</div>
</div>
</div>
{{template "footer.html"}}

View file

@ -1,5 +1,22 @@
<footer>
<p><small>Chief Librarian: Las Zenow (zenow@tormail.org)</small></p>
<footer class="footer">
<hr />
<p><small>Chief Librarian: Las Zenow (zenow@tormail.org)<br />
Fork the source code from <a href="https://gitorious.org/trantor">gitorious</a></small>.</p>
</footer>
<!-- Placed at the end of the document so the pages load faster -->
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap-transition.js"></script>
<script src="/js/bootstrap-alert.js"></script>
<script src="/js/bootstrap-modal.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/bootstrap-scrollspy.js"></script>
<script src="/js/bootstrap-tab.js"></script>
<script src="/js/bootstrap-tooltip.js"></script>
<script src="/js/bootstrap-popover.js"></script>
<script src="/js/bootstrap-button.js"></script>
<script src="/js/bootstrap-collapse.js"></script>
<script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-typeahead.js"></script>
</body>
</html>

View file

@ -1,6 +1,33 @@
<html>
<head>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.css" rel="stylesheet">
<style type="text/css">
.centered { text-align:center; }
.down { vertical-align:text-bottom; }
</style>
<title>Imperial Library of Trantor</title>
</head>
<body>
<a href="/">Index</a> || <a href="/about/">About</a> || <a href="/upload/">Upload your epub</a>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/">Imperial Library</a>
<div class="nav-collapse">
<ul class="nav">
<li><a href="/">Home</a></li>
<li><a href="/about/">About</a></li>
<li><a href="/upload/">Upload your epub</a></li>
</ul>
</div><!--/.nav-collapse -->
<form class="navbar-search pull-right" action="/search/">
<input type="search" class="search-query span3" name="q" {{if .}}value="{{.}}"{{else}}placeholder="Search"{{end}} />
</form>
</div>
</div>
</div>

View file

@ -1,22 +1,37 @@
{{template "header.html"}}
<h1>Imperial Library of Trantor</h1>
<p><img src="/img/library.jpg" alt="library" /></p>
<!--<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>
</form>-->
<p>Last books added:
<ul>
<div class="row">
<div class="span8">
<p>Last books added:</p>
</div>
<div class="span4">
<p class="pull-right">{{.Count}} books</p>
</div>
</div>
<div class="row">
{{with .Books}}
{{range .}}
<li><a href="/book/{{.Title}}">{{if .CoverSmall}}<img src="{{.CoverSmall}}" alt="{{.Title}}" />{{end}}
<strong>{{.Title}}</strong></a> - {{range .Author}}{{.}}, {{end}}</li>
<div class="span2">
<p class="centered down"><a href="/book/{{.Title}}">{{if .CoverSmall}}<img src="{{.CoverSmall}}" alt="{{.Title}}" />{{end}}</a></p>
</div>
{{end}}
{{end}}
</ul>
</p>
</div>
<div class="row">
{{with .Books}}
{{range .}}
<div class="span2">
<p class="centered"><a href="/book/{{.Title}}"><strong>{{.Title}}</strong></a></p>
</div>
{{end}}
{{end}}
</div>
{{template "footer.html"}}

View file

@ -1,24 +1,45 @@
{{template "header.html"}}
{{template "header.html" .Search}}
<h1>Search</h1>
<form action="/search/">
<input type="search" name="q" value="{{.Search}}"/>
<input type="submit" value="Search">
</form>
<p class="centered">Found {{.Found}} books. Page {{.Page}}</p>
<p>Found {{.Found}} books. Page {{.Page}}</p>
<ul>
{{with .Books}}
{{range .}}
<li><a href="/book/{{.Title}}">{{if .CoverSmall}}<img src="{{.CoverSmall}}" alt="{{.Title}}" />{{end}}
<strong>{{.Title}}</strong></a> - {{range .Author}}{{.}}, {{end}}</li>
{{end}}
<ul class="pager">
{{if .Prev}}
<li class="previous">
<a href="{{.Prev}}">&larr; Prev</a>
</li>
{{end}}
{{if .Next}}
<li class="next">
<a href="{{.Next}}">Next &rarr;</a>
</li>
{{end}}
</ul>
<p>
{{if .Prev}}<a href="{{.Prev}}">&lt;Prev</a> {{end}}
{{if .Next}}<a href="{{.Next}}">Next&gt;</a>{{end}}</p>
{{with .Books}}
{{range .}}
<div class="row">
<div class="span2">
<p class="pull-right"><a href="/book/{{.Title}}">{{if .CoverSmall}}<img src="{{.CoverSmall}}" alt="{{.Title}}" />{{end}}</a></p>
</div>
<div class="span10">
<p class="well"><a href="/book/{{.Title}}"><strong>{{.Title}}</strong></a><br />
{{range .Author}}{{.}}, {{end}}</p>
</div>
</div>
{{end}}
{{end}}
<ul class="pager">
{{if .Prev}}
<li class="previous">
<a href="{{.Prev}}">&larr; Prev</a>
</li>
{{end}}
{{if .Next}}
<li class="next">
<a href="{{.Next}}">Next &rarr;</a>
</li>
{{end}}
</ul>
{{template "footer.html"}}