Add the avility to edit metadata and delete books after submission

This commit is contained in:
Las Zenow 2018-04-07 22:58:59 +00:00
parent de58f0251e
commit 8d126fbe7a
7 changed files with 93 additions and 48 deletions

View file

@ -1,5 +1,6 @@
{{template "header.html" .S}}
{{$submissionID := .SubmissionID}}
{{with .Book}}
<div class="row">
{{if .Cover}}
@ -9,7 +10,12 @@
{{end}}
<div class="span8">
<form class="form-horizontal" method="POST" action="/save/{{.ID}}">
<form class="form-horizontal" method="POST"
{{if $submissionID}}
action="/submission/{{$submissionID}}/save/{{.ID}}">
{{else}}
action="/save/{{.ID}}">
{{end}}
<fieldset>
<div class="control-group">
<label class="control-label" for="title">Title</label>

View file

@ -1,10 +1,16 @@
{{template "header.html" .S}}
<div class="row">
<h4>The status of your submission:</h4>
<h4>Review your submission:</h4>
<ul>
<li>Check if the book is already in the library, please remove the books that are already in the library in a better or similar edition/quality. You can click on the title or the authors to search for similar books in the library.</li>
<li>Edit if needed the title, authors, publisher, ...</li>
</ul>
<p>Thank you for your submission.</p>
</div>
{{$role := .S.Role}}
{{$submissionID := .SubmissionID}}
{{range .Submissions}}
<div class="row">
<div class="row">
@ -19,19 +25,8 @@
{{end}}
{{.Status}}</span></p>
</div>
{{with .Book}}
{{if and .ID (not .Active)}}
<div class="span2">
{{if eq $role "admin" "moderator"}}
<div class="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>
</div>
{{end}}
</div>
{{end}}
</div>
{{with .Book}}
{{if .ID}}
<div class="span1">
@ -42,13 +37,27 @@
<div class="span7">
<p>
<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 .Authors}}{{.}}, {{end}}
<a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a><br />
{{if .Authors}}<strong>Authors:</strong> {{range .Authors}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}<br />{{end}}
{{if .Publisher}}<strong>Publisher:</strong> <a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a><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}}
{{.Description}}
</p>
</div>
<div class="span3">
<div class="btn-group pull-right">
{{if and .ID (not .Active)}}
<div class="row btn-group pull-right">
{{if eq $role "admin" "moderator"}}
<a href="/store/{{.ID}}/" class="btn btn-success"><i class="icon-ok"></i> Save</a>
{{end}}
<a href="/submission/{{$submissionID}}/edit/{{.ID}}" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
<a href="/submission/{{$submissionID}}/delete/{{.ID}}/" class="btn btn-danger"><i class="icon-remove"></i> Delete</a>
</div>
<div class="row"><p></p></div>
{{end}}
<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>
</div>

View file

@ -1,12 +1,5 @@
{{template "header.html" .S}}
{{if .SubmissionID}}
<div class="alert alert-success">
<button class="close" data-dismiss="alert">×</button>
<strong>Upload successful!</strong> Thank you for your contribution (<a href="/submission/{{.SubmissionID}}">Review the status of your upload</a>)
</div>
{{end}}
<p>Upload your epubs to help the library.</p>
<form class="well form-inline" method="POST" enctype="multipart/form-data">