Convert Id to ID

This commit is contained in:
Las Zenow 2016-07-30 07:59:30 -04:00
parent f12114c296
commit 52b9882be9
17 changed files with 76 additions and 78 deletions

View file

@ -4,13 +4,13 @@
{{with .Book}}
<script>
function delBook(){
var div = document.getElementById('delete');
var div = document.getElementByID('delete');
div.innerHTML =
'<div class="alert alert-error fade in"> \
<a class="close" data-dismiss="alert">×</a> \
<h4 class="alert-heading">Do you really want to delete it?</h4> \
<p>Remove a book is permanent, you won\'t be able to get it back</p> \
<a class="btn btn-danger" href="/delete/{{.Id}}/">Remove it</a> \
<a class="btn btn-danger" href="/delete/{{.ID}}/">Remove it</a> \
<a class="btn" href="#" data-dismiss="alert">Cancel</a> \
</div>';
}
@ -25,7 +25,7 @@ function delBook(){
<div class="row">
{{if .Cover}}
<div class="span4">
<img src="/cover/{{.Id}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="pull-right" />
<img src="/cover/{{.ID}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="pull-right" />
</div>
{{end}}
@ -45,15 +45,15 @@ function delBook(){
<div class="span3">
<div class="row">
<div class="btn-group pull-right">
<a href="/download/{{.Id}}/{{.Title}}.epub" class="btn btn-large btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.Id}}" class="btn btn-large btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
<a href="/download/{{.ID}}/{{.Title}}.epub" class="btn btn-large btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.ID}}" class="btn btn-large btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
</div>
</div>
{{if eq $role "admin" "moderator"}}
<div class="row"><p></p></div>
<div class="row">
<div class="btn-group pull-right">
<a href="/edit/{{.Id}}" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
<a href="/edit/{{.ID}}" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
<a href="#" onClick="delBook();" class="btn btn-danger"><i class="icon-trash"></i> Delete</a>
</div>
</div>

View file

@ -4,12 +4,12 @@
<div class="row">
{{if .Cover}}
<div class="span4">
<img src="/cover/{{.Id}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="pull-right" />
<img src="/cover/{{.ID}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="pull-right" />
</div>
{{end}}
<div class="span8">
<form class="form-horizontal" method="POST" action="/save/{{.Id}}">
<form class="form-horizontal" method="POST" action="/save/{{.ID}}">
<fieldset>
<div class="control-group">
<label class="control-label" for="title">Title</label>
@ -68,7 +68,7 @@
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save</button>
<a href="/book/{{.Id}}" class="btn">Cancel</a>
<a href="/book/{{.ID}}" class="btn">Cancel</a>
</div>
</fieldset>
</form>

View file

@ -25,8 +25,8 @@
{{range .}}
<li class="span2">
<div class="thumbnail centered" style="border:none;">
<a href="/book/{{.Id}}">
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.Id}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
<a href="/book/{{.ID}}">
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
<p><strong>{{.Title}}</strong></p>
</a>
</div>
@ -43,8 +43,8 @@
{{range .}}
<li class="span2">
<div class="thumbnail centered" style="border:none;">
<a href="/book/{{.Id}}">
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.Id}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
<a href="/book/{{.ID}}">
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
<p><strong>{{.Title}}</strong></p>
</a>
</div>
@ -61,8 +61,8 @@
{{range .}}
<li class="span2">
<div class="thumbnail centered" style="border:none;">
<a href="/book/{{.Id}}">
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.Id}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
<a href="/book/{{.ID}}">
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
<p><strong>{{.Title}}</strong></p>
</a>
</div>

View file

@ -6,8 +6,8 @@
{{if .Books}}
<div class="centered btn-group">
<a href="/store/{{range .Books}}{{.B.Id}}/{{end}}" class="btn btn-large btn-success"><i class="icon-ok"></i> Save All</a>
<a href="/delete/{{range .Books}}{{.B.Id}}/{{end}}" class="btn btn-large btn-danger"><i class="icon-remove"></i> Delete All</a>
<a href="/store/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-large btn-success"><i class="icon-ok"></i> Save All</a>
<a href="/delete/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-large btn-danger"><i class="icon-remove"></i> Delete All</a>
</div>
{{end}}
<p class="centered">Found {{.Found}} books.<br /></p>
@ -30,7 +30,7 @@
{{with .B}}
<div class="row">
<div class="span1">
<p class="pull-right">{{if .Cover}}<img src="/cover/{{.Id}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}</p>
<p class="pull-right">{{if .Cover}}<img src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}</p>
</div>
<div class="span9">
<p><a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a> <small>({{$titleFound}})</small><br />
@ -45,14 +45,14 @@
</div>
<div class="span2">
<div class="row btn-group pull-right">
<a href="/store/{{.Id}}/" class="btn btn-success"><i class="icon-ok"></i> Save</a>
<a href="/edit/{{.Id}}" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
<a href="/delete/{{.Id}}/" class="btn btn-danger"><i class="icon-remove"></i> Delete</a>
<a href="/store/{{.ID}}/" class="btn btn-success"><i class="icon-ok"></i> Save</a>
<a href="/edit/{{.ID}}" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
<a href="/delete/{{.ID}}/" class="btn btn-danger"><i class="icon-remove"></i> Delete</a>
</div>
<div class="row"><p></p></div>
<div class="row btn-group pull-right">
<a href="/download/{{.Id}}/{{.Title}}.epub" class="btn btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.Id}}" class="btn btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
<a href="/download/{{.ID}}/{{.Title}}.epub" class="btn btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.ID}}" class="btn btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
</div>
</div>
</div>
@ -72,8 +72,8 @@
</ul>
{{if .Books}}
<div class="centered btn-group">
<a href="/store/{{range .Books}}{{.B.Id}}/{{end}}" class="btn btn-large btn-success"><i class="icon-ok"></i> Save All</a>
<a href="/delete/{{range .Books}}{{.B.Id}}/{{end}}" class="btn btn-large btn-danger"><i class="icon-remove"></i> Delete All</a>
<a href="/store/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-large btn-success"><i class="icon-ok"></i> Save All</a>
<a href="/delete/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-large btn-danger"><i class="icon-remove"></i> Delete All</a>
</div>
{{end}}

View file

@ -21,22 +21,22 @@
{{range .}}
<div class="row">
<div class="span1">
<p class="pull-right"><a href="/book/{{.Id}}">{{if .Cover}}<img class="img-rounded" src="/cover/{{.Id}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}</a></p>
<p class="pull-right"><a href="/book/{{.ID}}">{{if .Cover}}<img class="img-rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}</a></p>
</div>
<div class="span10 well">
<div class="row">
<div class="span7">
<p>
<span class="muted">[{{if .Lang}}{{.Lang}}{{end}}]</span>
<a href="/book/{{.Id}}"><strong>{{.Title}}</strong></a>
<a href="/book/{{.ID}}"><strong>{{.Title}}</strong></a>
<span class="muted">{{if .Publisher}}{{.Publisher}}{{end}}</span><br />
{{range .Authors}}{{.}}, {{end}}
</p>
</div>
<div class="span3">
<div class="btn-group pull-right">
<a href="/download/{{.Id}}/{{.Title}}.epub" class="btn btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.Id}}" class="btn btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
<a href="/download/{{.ID}}/{{.Title}}.epub" class="btn btn-inverse"><i class="icon-download-alt icon-white"></i> download</a>
<a href="/read/{{.ID}}" class="btn btn-warning"><i class="icon-eye-open icon-white"></i> read it!</a>
</div>
</div>
</div>

View file

@ -58,7 +58,7 @@
{{range .Books}}
<entry>
<title>{{html .Title}}</title>
<id>{{$baseurl}}/book/{{.Id}}</id>
<id>{{$baseurl}}/book/{{.ID}}</id>
<updated>{{$updated}}</updated>
{{range .Authors}}
@ -89,11 +89,11 @@
{{end}}
<summary>{{html .Description}}</summary>
<link type="image/jpeg" href="/cover/{{.Id}}/big/cover.jpg" rel="http://opds-spec.org/image"/>
<link type="image/jpg" href="/cover/{{.Id}}/small/thumbnail.jpg" rel="http://opds-spec.org/image/thumbnail" />
<link type="image/jpeg" href="/cover/{{.ID}}/big/cover.jpg" rel="http://opds-spec.org/image"/>
<link type="image/jpg" href="/cover/{{.ID}}/small/thumbnail.jpg" rel="http://opds-spec.org/image/thumbnail" />
<link rel="http://opds-spec.org/acquisition"
href="/download/{{.Id}}/{{urlquery .Title}}.epub"
href="/download/{{.ID}}/{{urlquery .Title}}.epub"
type="application/epub+zip" />
</entry>
{{end}}

View file

@ -16,11 +16,11 @@
<item>
<title>{{.Title}} - {{index .Authors 0}}</title>
<description>{{.Description}}</description>
<link>{{$baseURL}}/book/{{.Id}}</link>
<link>{{$baseURL}}/book/{{.ID}}</link>
{{if .Isbn}}
<guid isPermaLink="false">ISBN: {{.Isbn}}</guid>
{{end}}
<enclosure url="{{$baseURL}}/download/{{.Id}}/{{.Title}}.epub" length="{{.FileSize}}" type="application/epub+zip" />
<enclosure url="{{$baseURL}}/download/{{.ID}}/{{.Title}}.epub" length="{{.FileSize}}" type="application/epub+zip" />
{{range .Authors}}
{{if .}}
<category>{{.}}</category>