Rename author to authors and subject to tags

This commit is contained in:
Las Zenow 2016-07-30 07:36:58 -04:00
parent e72de38725
commit 7f9c172853
17 changed files with 37 additions and 39 deletions

View file

@ -35,9 +35,9 @@ function delBook(){
<div class="row">
<div class="span5">
<dl class="dl-horizontal">
{{if .Author}}<dt>Author</dt> <dd>{{range .Author}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}</dd>{{end}}
{{if .Authors}}<dt>Authors</dt> <dd>{{range .Authors}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}</dd>{{end}}
{{if .Publisher}}<dt>Publisher</dt> <dd><a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a></dd>{{end}}
{{if .Subject}}<dt>Tags</dt> <dd>{{range .Subject}}<a href="/search/?q=subject:{{.}}">{{.}}</a>, {{end}}</dd>{{end}}
{{if .Tags}}<dt>Tags</dt> <dd>{{range .Tags}}<a href="/search/?q=tag:{{.}}">{{.}}</a>, {{end}}</dd>{{end}}
{{if .Isbn}}<dt>ISBN</dt> <dd>{{.Isbn}}</dd>{{end}}
{{if .Date}}<dt>Date</dt> <dd>{{.Date}}</dd>{{end}}
{{if .Lang}}<dt>Lang</dt> <dd><a href="/search/?q=lang:{{.Lang}}">{{.Lang}}</a> </dd>{{end}}

View file

@ -22,7 +22,7 @@
<div class="control-group">
<label class="control-label" for="author">Author</label>
<div class="controls">
{{range .Author}}
{{range .Authors}}
<input class="input-xlarge" type="text" id="author" value="{{.}}" name="author">
{{end}}
<input class="input-xlarge" type="text" id="author" placeholder="Add author" name="author">
@ -37,7 +37,7 @@
<div class="control-group">
<label class="control-label" for="tags">Tags</label>
<div class="controls">
<input class="input-xlarge" type="text" id="tags" value="{{range .Subject}}{{.}},{{end}}" name="subject" placeholder="Add tag and hit enter">
<input class="input-xlarge" type="text" id="tags" value="{{range .Tags}}{{.}},{{end}}" name="tags" placeholder="Add tag and hit enter">
</div>
</div>
<div class="control-group">

View file

@ -12,7 +12,7 @@
<p>There is other topics than <em>lang</em> that can be used:
<ul>
<li><a href="/search/?q=author:doctorow">author:doctorow</a></li>
<li><a href="/search/?q=subject:computers title:python">subject:computers title:python</a></li>
<li><a href="/search/?q=tag:computers title:python">tag:computers title:python</a></li>
</ul>
</p>

View file

@ -72,7 +72,7 @@
</ul>
<div class="row">
<p class="centered">{{range .Tags}}<a class="label" href="/search/?q=subject:{{.}}">{{.}}</a> {{end}}</p>
<p class="centered">{{range .Tags}}<a class="label" href="/search/?q=tag:{{.}}">{{.}}</a> {{end}}</p>
</div>
{{template "footer.html"}}

View file

@ -42,11 +42,11 @@
<entry>
<title>{{html .}}</title>
<link rel="http://opds-spec.org/facet"
href="/search/?q=subject:{{urlquery .}}&amp;fmt=opds"
href="/search/?q=tag:{{urlquery .}}&amp;fmt=opds"
title="{{html .}}"
type="application/atom+xml;profile=opds-catalog;kind=acquisition"/>
<updated>{{$updated}}</updated>
<id>{{$baseurl}}/search/?subject:{{urlquery .}}</id>
<id>{{$baseurl}}/search/?tag:{{urlquery .}}</id>
</entry>
{{end}}
</feed>

View file

@ -34,9 +34,9 @@
</div>
<div class="span9">
<p><a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a> <small>({{$titleFound}})</small><br />
{{if .Author}}<strong>Author:</strong> {{range .Author}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}} <small>({{$authorFound}})</small><br />{{end}}
{{if .Authors}}<strong>Authors:</strong> {{range .Authors}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}} <small>({{$authorFound}})</small><br />{{end}}
{{if .Publisher}}<strong>Publisher:</strong> <a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a><br />{{end}}
{{if .Subject}}<strong>Tags:</strong> {{range .Subject}}<a href="/search/?q=subject:{{.}}">{{.}}</a>, {{end}}<br />{{end}}
{{if .Tags}}<strong>Tags:</strong> {{range .Tags}}<a href="/search/?q=tag:{{.}}">{{.}}</a>, {{end}}<br />{{end}}
{{if .Isbn}}<strong>ISBN:</strong> {{.Isbn}}<br />{{end}}
{{if .Date}}<strong>Date:</strong> {{.Date}}<br />{{end}}
{{if .Lang}}<strong>Lang:</strong> <a href="/search/?q=lang:{{.Lang}}">{{.Lang}}</a> <br />{{end}}

View file

@ -30,7 +30,7 @@
<span class="muted">[{{if .Lang}}{{.Lang}}{{end}}]</span>
<a href="/book/{{.Id}}"><strong>{{.Title}}</strong></a>
<span class="muted">{{if .Publisher}}{{.Publisher}}{{end}}</span><br />
{{range .Author}}{{.}}, {{end}}
{{range .Authors}}{{.}}, {{end}}
</p>
</div>
<div class="span3">

View file

@ -61,7 +61,7 @@
<id>{{$baseurl}}/book/{{.Id}}</id>
<updated>{{$updated}}</updated>
{{range .Author}}
{{range .Authors}}
<author>
<name>{{html .}}</name>
</author>
@ -83,7 +83,7 @@
{{if .Lang}}
<dcterms:language>{{.Lang}}</dcterms:language>
{{end}}
{{range .Subject}}
{{range .Tags}}
<category term="{{html .}}"
label="{{html .}}"/>
{{end}}

View file

@ -14,14 +14,14 @@
{{$baseURL := .S.BaseURL}}
{{range .Books}}
<item>
<title>{{.Title}} - {{index .Author 0}}</title>
<title>{{.Title}} - {{index .Authors 0}}</title>
<description>{{.Description}}</description>
<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" />
{{range .Subject}}
{{range .Authors}}
{{if .}}
<category>{{.}}</category>
{{end}}