Port the web to bootstrap5
So it is responsive in phones.
This commit is contained in:
parent
8af2ad3758
commit
6a3da59c75
40 changed files with 1131 additions and 849 deletions
10
README.md
10
README.md
|
@ -77,14 +77,10 @@ https://gitlab.com/trantor/trantor/issues
|
|||
|
||||
All the matterial of this project is under WTFPL as described on the LICENSE
|
||||
file with the exception of:
|
||||
* css/bootstrap.min.css css/bootstra-responsive.min.css js/bootstrap.min.js
|
||||
img/glyphicons-halflings-white.png img/glyphicons-halflings.png
|
||||
From the bootstrap framework: http://twitter.github.com/bootstrap/
|
||||
* js/jquery.js
|
||||
From jquery library: http://jquery.com/
|
||||
* css/bootstrap.bundle.min.css css/bootstrap.bundle.min.css.map js/bootstrap.bundle.min.js
|
||||
js/bootstrap.bundle.min.js.map img/bootstrap-icons.svg
|
||||
From the bootstrap framework: https://getbootstrap.com/
|
||||
* img/bright_squares.png
|
||||
From subtlepatterns: http://subtlepatterns.com/bright-squares/
|
||||
* css/FredokaOne.ttf css/PTSerif.ttf
|
||||
From Google Web Fonts: http://www.google.com/webfonts
|
||||
* js/bootstrap-tokenfield.min.js dist/css/bootstrap-tokenfield.min.css
|
||||
From Bootstrap Tokenfield: https://github.com/sliptree/bootstrap-tokenfield
|
||||
|
|
9
css/bootstrap-responsive.min.css
vendored
9
css/bootstrap-responsive.min.css
vendored
File diff suppressed because one or more lines are too long
5
css/bootstrap-tokenfield.min.css
vendored
5
css/bootstrap-tokenfield.min.css
vendored
|
@ -1,5 +0,0 @@
|
|||
/*!
|
||||
* bootstrap-tokenfield
|
||||
* https://github.com/sliptree/bootstrap-tokenfield
|
||||
* Copyright 2013-2014 Sliptree and other contributors; Licensed MIT
|
||||
*/@-webkit-keyframes blink{0%{border-color:#ededed}100%{border-color:#b94a48}}@-moz-keyframes blink{0%{border-color:#ededed}100%{border-color:#b94a48}}@keyframes blink{0%{border-color:#ededed}100%{border-color:#b94a48}}.tokenfield{height:auto;min-height:34px;padding-bottom:0}.tokenfield.focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.tokenfield .token{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;display:inline-block;border:1px solid #d9d9d9;background-color:#ededed;white-space:nowrap;margin:-1px 5px 5px 0;height:22px;vertical-align:top;cursor:default}.tokenfield .token:hover{border-color:#b9b9b9}.tokenfield .token.active{border-color:#52a8ec;border-color:rgba(82,168,236,.8)}.tokenfield .token.duplicate{border-color:#ebccd1;-webkit-animation-name:blink;animation-name:blink;-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-direction:normal;animation-direction:normal;-webkit-animation-timing-function:ease;animation-timing-function:ease;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.tokenfield .token.invalid{background:0 0;border:1px solid transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;border-bottom:1px dotted #d9534f}.tokenfield .token.invalid.active{background:#ededed;border:1px solid #ededed;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.tokenfield .token .token-label{display:inline-block;overflow:hidden;text-overflow:ellipsis;padding-left:4px;vertical-align:top}.tokenfield .token .close{font-family:Arial;display:inline-block;line-height:100%;font-size:1.1em;line-height:1.49em;margin-left:5px;float:none;height:100%;vertical-align:top;padding-right:4px}.tokenfield .token-input{background:0 0;width:60px;min-width:60px;border:0;height:20px;padding:0;margin-bottom:6px;-webkit-box-shadow:none;box-shadow:none}.tokenfield .token-input:focus{border-color:transparent;outline:0;-webkit-box-shadow:none;box-shadow:none}.tokenfield.disabled{cursor:not-allowed;background-color:#eee}.tokenfield.disabled .token-input{cursor:not-allowed}.tokenfield.disabled .token:hover{cursor:not-allowed;border-color:#d9d9d9}.tokenfield.disabled .token:hover .close{cursor:not-allowed;opacity:.2;filter:alpha(opacity=20)}.has-warning .tokenfield.focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-error .tokenfield.focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-success .tokenfield.focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.tokenfield.input-sm,.input-group-sm .tokenfield{min-height:30px;padding-bottom:0}.input-group-sm .token,.tokenfield.input-sm .token{height:20px;margin-bottom:4px}.input-group-sm .token-input,.tokenfield.input-sm .token-input{height:18px;margin-bottom:5px}.tokenfield.input-lg,.input-group-lg .tokenfield{height:auto;min-height:45px;padding-bottom:4px}.input-group-lg .token,.tokenfield.input-lg .token{height:25px}.input-group-lg .token-label,.tokenfield.input-lg .token-label{line-height:23px}.input-group-lg .token .close,.tokenfield.input-lg .token .close{line-height:1.3em}.input-group-lg .token-input,.tokenfield.input-lg .token-input{height:23px;line-height:23px;margin-bottom:6px;vertical-align:top}.tokenfield.rtl{direction:rtl;text-align:right}.tokenfield.rtl .token{margin:-1px 0 5px 5px}.tokenfield.rtl .token .token-label{padding-left:0;padding-right:4px}
|
16
css/bootstrap.min.css
vendored
16
css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
1
css/bootstrap.min.css.map
Normal file
1
css/bootstrap.min.css.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -10,19 +10,15 @@
|
|||
font-weight: 400;
|
||||
src: local('PT Serif'), local('PTSerif-Regular'), url(/css/PTSerif.ttf) format('truetype');
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
h1, h2, h3, h4, h5, h6, .navbar-brand, .title {
|
||||
font-family: 'Fredoka One', cursive;
|
||||
}
|
||||
p, div {
|
||||
font-family: 'PT Serif', serif;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
body {
|
||||
background: url(/img/bright_squares.png) repeat 0 0;
|
||||
}
|
||||
.centered {
|
||||
text-align:center;
|
||||
}
|
||||
.down {
|
||||
vertical-align:text-bottom;
|
||||
}
|
||||
|
|
1
img/bootstrap-icons.svg
Normal file
1
img/bootstrap-icons.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 595 KiB |
7
js/bootstrap-tokenfield.min.js
vendored
7
js/bootstrap-tokenfield.min.js
vendored
File diff suppressed because one or more lines are too long
7
js/bootstrap.bundle.min.js
vendored
Normal file
7
js/bootstrap.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
js/bootstrap.bundle.min.js.map
Normal file
1
js/bootstrap.bundle.min.js.map
Normal file
File diff suppressed because one or more lines are too long
6
js/bootstrap.min.js
vendored
6
js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
2
js/jquery.js
vendored
2
js/jquery.js
vendored
File diff suppressed because one or more lines are too long
|
@ -27,7 +27,7 @@ func deleteHandler(h handler) {
|
|||
}
|
||||
book, err := h.db.GetBookID(id)
|
||||
if err != nil {
|
||||
h.sess.Notify("Book not found!", "The book with id '"+id+"' is not there", "error")
|
||||
h.sess.Notify("Book not found!", "The book with id '"+id+"' is not there", "danger")
|
||||
continue
|
||||
}
|
||||
err = h.db.UpdateSubmissionByBook(id, "Rejected", nil)
|
||||
|
@ -124,7 +124,7 @@ func saveHandler(h handler) {
|
|||
err := h.db.UpdateBook(id, book)
|
||||
if err != nil {
|
||||
log.Error("Updating book: ", err)
|
||||
h.sess.Notify("Can't modify book!", err.Error(), "error")
|
||||
h.sess.Notify("Can't modify book!", err.Error(), "danger")
|
||||
} else {
|
||||
h.sess.Notify("Book Modified!", "", "success")
|
||||
}
|
||||
|
|
20
lib/list.go
20
lib/list.go
|
@ -15,7 +15,7 @@ func listHandler(h handler) {
|
|||
list, err := h.db.GetBookList(listID)
|
||||
if err != nil {
|
||||
log.Error("Error loading list ", listID, ": ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not load the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not load the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func listPostHandler(h handler) {
|
|||
userLists, err := h.db.GetListsByUser(h.sess.User)
|
||||
if err != nil {
|
||||
log.Error("Error loading user (", h.sess.User, ") lists: ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not add book to the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not add book to the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ func listPostHandler(h handler) {
|
|||
err = h.db.NewBookList(listID, listTitle, h.sess.User, []string{})
|
||||
if err != nil {
|
||||
log.Error("Error creating list ", listTitle, " by user ", h.sess.User, ": ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not add book to the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not add book to the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ func listPostHandler(h handler) {
|
|||
err = h.db.AddBookToList(listID, bookID)
|
||||
if err != nil {
|
||||
log.Error("Error adding book ", bookID, " to list ", listTitle, "(", listID, "): ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not add book to the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not add book to the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -96,12 +96,12 @@ func listEditPostHandler(h handler) {
|
|||
list, err := h.db.GetBookList(listID)
|
||||
if err != nil || list == nil {
|
||||
log.Error("Error loading list ", listID, ": ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not save the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not save the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
if h.sess.User != list.User.Username {
|
||||
h.sess.Notify("You are not the owner of the list!", "You can't edit it", "error")
|
||||
h.sess.Notify("You are not the owner of the list!", "You can't edit it", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ func listEditPostHandler(h handler) {
|
|||
err = h.db.UpdateBookList(listID, title, description)
|
||||
if err != nil {
|
||||
log.Error("Error editing list ", list.Title, "(", listID, "): ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not edit the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not edit the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -126,12 +126,12 @@ func listRemoveHandler(h handler) {
|
|||
list, err := h.db.GetBookList(listID)
|
||||
if err != nil || list == nil {
|
||||
log.Error("Error loading list ", listID, ": ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not remove books from the list", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not remove books from the list", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
if h.sess.User != list.User.Username {
|
||||
h.sess.Notify("You are not the owner of the list!", "You can't remove books from it", "error")
|
||||
h.sess.Notify("You are not the owner of the list!", "You can't remove books from it", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ func listRemoveHandler(h handler) {
|
|||
err = h.db.DeleteBookFromList(listID, bookID)
|
||||
if err != nil {
|
||||
log.Error("Error remove book ", bookID, " from list ", listID, "): ", err)
|
||||
h.sess.Notify("Something went wrong!", "Could not remove book", "error")
|
||||
h.sess.Notify("Something went wrong!", "Could not remove book", "danger")
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ func submissionCommentHandler(h handler) {
|
|||
err := h.db.UpdateSubmissionComment(submissionID, bookID, comment)
|
||||
if err != nil {
|
||||
log.Error("Adding comment (submission: ", submissionID, ", book: ", bookID, ") <", comment, ">: ", err)
|
||||
h.sess.Notify("Error adding a comment!", "Can't add the comment rigt now. Try again later or report it to the site admins", "error")
|
||||
h.sess.Notify("Error adding a comment!", "Can't add the comment rigt now. Try again later or report it to the site admins", "danger")
|
||||
} else {
|
||||
h.sess.Notify("Comment added!", "", "success")
|
||||
}
|
||||
|
@ -131,17 +131,17 @@ func storeHandler(h handler) {
|
|||
}
|
||||
book, err := h.db.GetBookID(id)
|
||||
if err != nil {
|
||||
h.sess.Notify("Book not found!", "The book with id '"+id+"' is not there", "error")
|
||||
h.sess.Notify("Book not found!", "The book with id '"+id+"' is not there", "danger")
|
||||
continue
|
||||
}
|
||||
if err != nil {
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "error")
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "danger")
|
||||
log.Error("Error getting book for storing '", book.Title, "': ", err.Error())
|
||||
continue
|
||||
}
|
||||
err = h.db.ActiveBook(id)
|
||||
if err != nil {
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "error")
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "danger")
|
||||
log.Error("Error storing book '", book.Title, "': ", err.Error())
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ var tmpl_funcs = map[string]interface{}{
|
|||
"strings_join": stringsJoin,
|
||||
"download_url": downloadUrl,
|
||||
"size2mb": size2mb,
|
||||
"mul": mul,
|
||||
}
|
||||
|
||||
type Status struct {
|
||||
|
@ -114,6 +115,10 @@ func size2mb(size int) float32 {
|
|||
return float32(size) / (1024.0 * 1024.0)
|
||||
}
|
||||
|
||||
func mul(a, b int) int {
|
||||
return a * b
|
||||
}
|
||||
|
||||
type DevTemplateExecutor struct {
|
||||
assetsPath string
|
||||
tpe string
|
||||
|
|
|
@ -92,7 +92,7 @@ func uploadPostHandler(h handler) {
|
|||
const _2M int64 = (1 << 20) * 2
|
||||
|
||||
if h.ro {
|
||||
h.sess.Notify("Upload failed!", "The library is in Read Only mode, no books can be uploaded", "error")
|
||||
h.sess.Notify("Upload failed!", "The library is in Read Only mode, no books can be uploaded", "danger")
|
||||
uploadHandler(h)
|
||||
return
|
||||
}
|
||||
|
@ -109,13 +109,13 @@ func uploadPostHandler(h handler) {
|
|||
submission := database.Submission{
|
||||
SubmissionID: submissionID,
|
||||
Filename: f.Filename,
|
||||
Status: "Waiting to be processed",
|
||||
Status: "Waiting to be processed, reload the page in few minutes",
|
||||
}
|
||||
|
||||
file, err := f.Open()
|
||||
if err != nil {
|
||||
log.Error("Can not open uploaded file ", f.Filename, ": ", err)
|
||||
h.sess.Notify("Upload problem!", "There was a problem with book "+f.Filename, "error")
|
||||
h.sess.Notify("Upload problem!", "There was a problem with book "+f.Filename, "danger")
|
||||
submission.Status = "It was not possible to read the book"
|
||||
h.db.AddSubmission(submission, h.sess.User)
|
||||
continue
|
||||
|
|
22
lib/user.go
22
lib/user.go
|
@ -30,7 +30,7 @@ func loginPostHandler(h handler) {
|
|||
h.sess.Notify("Successful login!", "Welcome "+user, "success")
|
||||
} else {
|
||||
log.Warn("User ", user, " bad user or password")
|
||||
h.sess.Notify("Invalid login!", "user or password invalid", "error")
|
||||
h.sess.Notify("Invalid login!", "user or password invalid", "danger")
|
||||
}
|
||||
h.sess.Save(h.w, h.r)
|
||||
http.Redirect(h.w, h.r, h.r.Referer(), http.StatusFound)
|
||||
|
@ -40,16 +40,16 @@ func createUserHandler(h handler) {
|
|||
pass := h.r.FormValue("pass")
|
||||
confirmPass := h.r.FormValue("confirmPass")
|
||||
if pass != confirmPass {
|
||||
h.sess.Notify("Registration error!", "Passwords don't match", "error")
|
||||
h.sess.Notify("Registration error!", "Passwords don't match", "danger")
|
||||
} else if pass == "" {
|
||||
h.sess.Notify("Registration error!", "The password can't be empty", "error")
|
||||
h.sess.Notify("Registration error!", "The password can't be empty", "danger")
|
||||
} else {
|
||||
user := strings.TrimSpace(h.r.FormValue("user"))
|
||||
err := h.db.AddUser(user, pass)
|
||||
if err == nil {
|
||||
h.sess.Notify("Account created!", "Welcome "+user+". Now you can login", "success")
|
||||
} else {
|
||||
h.sess.Notify("Registration error!", err.Error(), "error")
|
||||
h.sess.Notify("Registration error!", err.Error(), "danger")
|
||||
}
|
||||
}
|
||||
h.sess.Save(h.w, h.r)
|
||||
|
@ -91,14 +91,14 @@ func settingsHandler(h handler) {
|
|||
pass2 := h.r.FormValue("password2")
|
||||
switch {
|
||||
case !h.db.ValidPassword(h.sess.User, current_pass):
|
||||
h.sess.Notify("Password error!", "The current password given don't match with the user password. Try again", "error")
|
||||
h.sess.Notify("Password error!", "The current password given don't match with the user password. Try again", "danger")
|
||||
case pass1 != pass2:
|
||||
h.sess.Notify("Passwords don't match!", "The new password and the confirmation password don't match. Try again", "error")
|
||||
h.sess.Notify("Passwords don't match!", "The new password and the confirmation password don't match. Try again", "danger")
|
||||
default:
|
||||
err := h.db.SetPassword(h.sess.User, pass1)
|
||||
if err != nil {
|
||||
log.Warn("Can't update password for user ", h.sess.User, ": ", err)
|
||||
h.sess.Notify("Password error!", "An error has ocurred updating the password in the database. Sorry.", "error")
|
||||
h.sess.Notify("Password error!", "An error has ocurred updating the password in the database. Sorry.", "danger")
|
||||
} else {
|
||||
h.sess.Notify("Password updated!", "Your new password is correctly set.", "success")
|
||||
}
|
||||
|
@ -167,14 +167,14 @@ func userAdminPostHandler(h handler) {
|
|||
if password != "" {
|
||||
err := h.db.SetPassword(username, password)
|
||||
if err != nil {
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "error")
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "danger")
|
||||
} else {
|
||||
h.sess.Notify("Password updated!", "", "success")
|
||||
}
|
||||
} else if role != "" {
|
||||
err := h.db.SetRole(username, role)
|
||||
if err != nil {
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "error")
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "danger")
|
||||
} else {
|
||||
h.sess.Notify("Role updated!", "", "success")
|
||||
}
|
||||
|
@ -194,11 +194,11 @@ func addUserHandler(h handler) {
|
|||
role := h.r.FormValue("role")
|
||||
err := h.db.AddUser(username, password)
|
||||
if err != nil {
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "error")
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "danger")
|
||||
} else {
|
||||
err := h.db.SetRole(username, role)
|
||||
if err != nil {
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "error")
|
||||
h.sess.Notify("An error ocurred!", err.Error(), "danger")
|
||||
} else {
|
||||
h.sess.Notify("User created!", "", "success")
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<div class="row">
|
||||
<div class="span10 offset1">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-10">
|
||||
<h4>Page not found</h4>
|
||||
<p>
|
||||
The requested page don't exist.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<h4>Donations</h4>
|
||||
|
||||
<p>If you feel like donate some bitcoins we'll gladly accept them. You can request one bitcoin key for you or use our public bitcoin key:</p>
|
||||
<p class="centered text-success">1JioYbSYDH4JQYbhF7tX2kGUVZc2vzvugx <br />
|
||||
<p class="text-center text-success">1JioYbSYDH4JQYbhF7tX2kGUVZc2vzvugx <br />
|
||||
<img src="/img/bitcoin.png" alt="1JioYbSYDH4JQYbhF7tX2kGUVZc2vzvugx" />
|
||||
</p>
|
||||
|
||||
|
|
|
@ -5,111 +5,165 @@
|
|||
{{with .Book}}
|
||||
<script>
|
||||
function delBook(){
|
||||
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" href="#" data-dismiss="alert">Cancel</a> \
|
||||
</div>';
|
||||
const div = document.getElementById('delete');
|
||||
div.classList.remove("visually-hidden");
|
||||
}
|
||||
function closeAlert() {
|
||||
const div = document.getElementById('delete');
|
||||
div.classList.add("visually-hidden");
|
||||
}
|
||||
</script>
|
||||
<div id="delete"></div>
|
||||
<div id="delete" class="alert alert-danger fade visually-hidden show" role="alert">
|
||||
<div class="row">
|
||||
<div class="col-11">
|
||||
<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" href="#" onClick="closeAlert();">Cancel</a>
|
||||
</div>
|
||||
<div class="col-1 justify-content-end">
|
||||
<button type="button" class="btn-close" onClick="closeAlert();"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<header class="row">
|
||||
<div class="span8 offset4">
|
||||
<header class="row justify-content-end">
|
||||
<h1>{{.Title}}
|
||||
{{if not .Active}}
|
||||
<span class="label label-warning">waiting for moderation</span>
|
||||
<span class="badge label-warning text-dark">waiting for moderation</span>
|
||||
{{end}}
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
<div class="row">
|
||||
{{if .Cover}}
|
||||
<div class="span4">
|
||||
<img src="/cover/{{.ID}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="pull-right" />
|
||||
{{if .Cover}}
|
||||
<div class="col-sm-4 text-center">
|
||||
<img src="/cover/{{.ID}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="float-sm-end img-fluid" />
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
<div class="span8">
|
||||
<div class="row"><p></p></div>
|
||||
<div class="row">
|
||||
<div class="span5">
|
||||
<dl class="dl-horizontal">
|
||||
{{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 .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 .FileSize}}<dt>Size</dt> <dd>{{printf "%.2f" (size2mb .FileSize)}} MB</dd>{{end}}
|
||||
{{if .Lang}}<dt>Lang</dt> <dd><a href="/search/?q=lang:{{.Lang}}">{{.Lang}}</a> </dd>{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="row">
|
||||
<div class="btn-group pull-right">
|
||||
<a href="{{download_url .}}" 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 class="col-sm-8">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<dl class="row">
|
||||
{{if .Authors}}
|
||||
<dt class="col-sm-3 text-sm-end">Authors</dt>
|
||||
<dd class="col-sm-9 text-start">{{range .Authors}}<a href="/search/?q=author:{{.}}">{{.}}</a>, {{end}}</dd>
|
||||
{{end}}
|
||||
{{if .Publisher}}
|
||||
<dt class="col-sm-3 text-sm-end">Publisher</dt>
|
||||
<dd class="col-sm-9 text-start"><a href="/search/?q=publisher:{{.Publisher}}">{{.Publisher}}</a></dd>
|
||||
{{end}}
|
||||
{{if .Tags}}
|
||||
<dt class="col-sm-3 text-sm-end">Tags</dt>
|
||||
<dd class="col-sm-9 text-start">{{range .Tags}}<a href="/search/?q=tag:{{.}}">{{.}}</a>, {{end}}</dd>
|
||||
{{end}}
|
||||
{{if .Isbn}}
|
||||
<dt class="col-sm-3 text-sm-end">ISBN</dt>
|
||||
<dd class="col-sm-9 text-start">{{.Isbn}}</dd>
|
||||
{{end}}
|
||||
{{if .Date}}
|
||||
<dt class="col-sm-3 text-sm-end">Date</dt>
|
||||
<dd class="col-sm-9 text-start">{{.Date}}</dd>
|
||||
{{end}}
|
||||
{{if .FileSize}}
|
||||
<dt class="col-sm-3 text-sm-end">Size</dt>
|
||||
<dd class="col-sm-9 text-start">{{printf "%.2f" (size2mb .FileSize)}} MB</dd>
|
||||
{{end}}
|
||||
{{if .Lang}}
|
||||
<dt class="col-sm-3 text-sm-end">Lang</dt>
|
||||
<dd class="col-sm-9 text-start"><a href="/search/?q=lang:{{.Lang}}">{{.Lang}}</a> </dd>
|
||||
{{end}}
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="{{download_url .}}" class="btn btn-dark btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#file-earmark-arrow-down"/>
|
||||
</svg>
|
||||
download
|
||||
</a>
|
||||
<a href="/read/{{.ID}}" class="btn btn-warning btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#eyeglasses"/>
|
||||
</svg>
|
||||
read it!
|
||||
</a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<small>Downloaded: {{$downloadCounter}} times</small>
|
||||
</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="#" onClick="delBook();" class="btn btn-danger"><i class="icon-trash"></i> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<small>Downloaded: {{$downloadCounter}} times</small>
|
||||
</div>
|
||||
{{if eq $role "admin" "moderator"}}
|
||||
<div class="row"><p></p></div>
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="/edit/{{.ID}}" class="btn btn-primary btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#pencil"/>
|
||||
</svg>
|
||||
edit
|
||||
</a>
|
||||
<a href="#" onClick="delBook();" class="btn btn-danger btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash"/>
|
||||
</svg>
|
||||
delete
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="row">
|
||||
<div class="span8">
|
||||
{{range .Description}}
|
||||
<p>{{.}}</p>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .Lists}}
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="span10 offset1">
|
||||
<h4>Book in lists:</h4>
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
{{range .Lists}}
|
||||
<li><a href="/list/{{.ListID}}">{{.Title}} ({{len .Books}})
|
||||
<span class="pull-right">By {{.User.Username}}</span></a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-10">
|
||||
<h4>Book in lists:</h4>
|
||||
<ul class="nav flex-column">
|
||||
{{range .Lists}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/list/{{.ListID}}">
|
||||
<div class="row">
|
||||
<div class="col">{{.Title}} ({{len .Books}})</div>
|
||||
<div class="col text-end">By {{.User.Username}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<br />
|
||||
{{end}}
|
||||
|
||||
<br />
|
||||
{{if .S.User}}
|
||||
<div class="row">
|
||||
<h5 class="offset1 span2">Add book to a list:</h5>
|
||||
<form class="form-inline" method="POST" action="/list/">
|
||||
<form method="POST" action="/list/">
|
||||
<div class="row g-3 align-items-start">
|
||||
<h6 class="col-sm-2 text-sm-end col-form-label">Add book to a list:</h6>
|
||||
<input type="hidden" id="book_id" name="book_id" value="{{.Book.ID}}">
|
||||
<div class="input-append">
|
||||
<input type="text" data-provide="typeahead" data-source='["{{strings_join .UserLists}}"]' data-items="4" id="list" name="list" autocomplete="off">
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
<div class="col-sm-5">
|
||||
<div class="input-group">
|
||||
<input class="form-control" list="bookListOptions" id="list" name="list" placeholder="Write a name of a list to create or add">
|
||||
<datalist id="bookListOptions">
|
||||
{{range .UserLists}}
|
||||
<option value="{{.}}">
|
||||
{{end}}
|
||||
</datalist>
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{end}}
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
|
@ -1,25 +1,39 @@
|
|||
{{range .}}
|
||||
<div class="row">
|
||||
<div class="span1">
|
||||
<p class="pull-right"><a href="/book/{{.ID}}" title="{{.Description}}">{{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}}" title="{{.Description}}"><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_url .}}" 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>
|
||||
</div>
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-1 d-flex align-items-center justify-content-center">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{if .Cover}}<img class="rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<div class="card-body">
|
||||
<p class="card-title">
|
||||
<span class="text-muted">[{{if .Lang}}{{.Lang}}{{end}}]</span>
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}"><strong>{{.Title}}</strong></a>
|
||||
<span class="text-muted">{{if .Publisher}}{{.Publisher}}{{end}}</span>
|
||||
</p>
|
||||
<div class="card-text row">
|
||||
<p class="col-9">{{range .Authors}}{{.}}, {{end}}</p>
|
||||
<div class="col-3">
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="{{download_url .}}" class="btn btn-dark btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#file-earmark-arrow-down"/>
|
||||
</svg>
|
||||
download
|
||||
</a>
|
||||
<a href="/read/{{.ID}}" class="btn btn-warning btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#eyeglasses"/>
|
||||
</svg>
|
||||
read it!
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
@ -2,35 +2,70 @@
|
|||
|
||||
<h4>Dashboard</h4>
|
||||
|
||||
<div class="row">
|
||||
<div class="span8 offset2">
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
{{if eq .S.Role "admin" "moderator"}}
|
||||
<li><a href="/submission/moderate/"><i class="icon-book"></i> Moderate submissions</a></li>
|
||||
{{if eq .S.Role "admin"}}
|
||||
<li><a href="/news/edit"><i class="icon-certificate"></i> Edit news</a></li>
|
||||
{{end}}
|
||||
<li class="divider"></li>
|
||||
{{end}}
|
||||
<li><a href="/submission/"><i class="icon-folder-open"></i> Submissions</a></li>
|
||||
<li><a href="/settings/"><i class="icon-wrench"></i> Settings</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/logout/"><i class="icon-off"></i> Log Out</a></li>
|
||||
</ul>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-8">
|
||||
<ul class="nav flex-column">
|
||||
{{if eq .S.Role "admin" "moderator"}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/submission/moderate/">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#journal-check"/>
|
||||
</svg>
|
||||
Moderate submissions
|
||||
</a>
|
||||
</li>
|
||||
{{if eq .S.Role "admin"}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/news/edit">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#newspaper"/>
|
||||
</svg>
|
||||
Edit news
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/submission/">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#journal-arrow-up"/>
|
||||
</svg>
|
||||
Submissions
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/settings/">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#gear"/>
|
||||
</svg>
|
||||
Settings
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/logout/">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#power"/>
|
||||
</svg>
|
||||
Log Out
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if .Lists}}
|
||||
<br />
|
||||
<h4>My book lists</h4>
|
||||
<div class="row">
|
||||
<div class="span8 offset2">
|
||||
<ul class="nav nav-tabs nav-stacked">
|
||||
{{range .Lists}}
|
||||
<li><a href="/list/{{.ListID}}">{{.Title}} ({{len .Books}})</a></li>
|
||||
{{end}}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-8">
|
||||
<ul class="nav flex-column">
|
||||
{{range .Lists}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/list/{{.ListID}}">{{.Title}} ({{len .Books}})</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -1,90 +1,113 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<!-- TODO: tokenfield -->
|
||||
|
||||
{{$submissionID := .SubmissionID}}
|
||||
{{with .Book}}
|
||||
<div class="row">
|
||||
{{if .Cover}}
|
||||
<div class="span4">
|
||||
<img src="/cover/{{.ID}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="pull-right" />
|
||||
</div>
|
||||
<div class="d-none d-sm-block col-sm-4">
|
||||
<img src="/cover/{{.ID}}/big/{{.Title}}.jpg" alt="{{.Title}}" class="img-fluid float-end" />
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="span8">
|
||||
<form class="form-horizontal" method="POST"
|
||||
{{if $submissionID}}
|
||||
<div class="col-sm-8">
|
||||
<form method="POST"
|
||||
{{if $submissionID}}
|
||||
action="/submission/{{$submissionID}}/save/{{.ID}}">
|
||||
{{else}}
|
||||
{{else}}
|
||||
action="/save/{{.ID}}">
|
||||
{{end}}
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="title">Title</label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge" type="text" id="title" value="{{.Title}}" name="title">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="author">Author</label>
|
||||
<div class="controls">
|
||||
{{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">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="publisher">Publisher</label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge" type="text" id="publisher" value="{{.Publisher}}" name="publisher">
|
||||
</div>
|
||||
</div>
|
||||
<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 .Tags}}{{.}},{{end}}" name="tags" placeholder="Add tag and hit enter">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="tags">ISBN</label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge" type="text" id="isbn" value="{{.Isbn}}" name="isbn">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="date">Date</label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge" type="text" id="date" value="{{.Date}}" name="date">
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="lang">Lang</label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge" type="text" id="langs" value="{{.Lang}}" name="lang">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="description">Description</label>
|
||||
<div class="controls">
|
||||
<textarea class="input-xlarge" id="description" rows="5" name="description">{{.Description}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="/book/{{.ID}}" class="btn">Cancel</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="title">Title</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" id="title" value="{{.Title}}" name="title">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="author">Author</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
{{range .Authors}}
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="author" value="{{.}}" name="author">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" id="author" placeholder="Add author" name="author">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="publisher">Publisher</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" id="publisher" value="{{.Publisher}}" name="publisher">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="tags">Tags</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" id="tags" value="{{range .Tags}}{{.}},{{end}}" name="tags" placeholder="Add tag and hit enter">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="tags">ISBN</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" id="isbn" value="{{.Isbn}}" name="isbn">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="date">Date</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" id="date" value="{{.Date}}" name="date">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="lang">Lang</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" type="text" id="langs" value="{{.Lang}}" name="lang">
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-sm-2 text-sm-end">
|
||||
<label class="col-form-label" for="description">Description</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="description" rows="5" name="description">{{.Description}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="/book/{{.ID}}" class="btn">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<script src="/js/bootstrap-tokenfield.min.js"></script>
|
||||
<script>
|
||||
$('#tags').tokenfield();
|
||||
</script>
|
||||
<!-- TODO: tokenfield -->
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
<h4>Add News:</h4>
|
||||
<form method="POST" action="/news/edit">
|
||||
<textarea class="field span10" name="text" rows="3"></textarea> <br />
|
||||
<button type="submit" class="btn">Add</button>
|
||||
<textarea class="col-12" name="text" rows="3"></textarea> <br />
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</form>
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
|
@ -1,21 +1,24 @@
|
|||
</div> <!-- container open in index.html -->
|
||||
<footer class="container footer">
|
||||
</div> <!-- container open in index.html -->
|
||||
</main>
|
||||
<footer>
|
||||
<div class="container">
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="span6">
|
||||
<div class="col">
|
||||
<p><small>Chief Librarian: Las Zenow <zenow@riseup.net><br />
|
||||
Fork the source code from <a href="https://gitlab.com/trantor">gitlab</a></small>.</p>
|
||||
</div>
|
||||
{{if not .IsOnion}}
|
||||
<div class="span6">
|
||||
<p class="pull-right"><small>This is a mirror of the <a href="https://www.torproject.org/">Tor</a> onion service:<br />
|
||||
<div class="col">
|
||||
<p class="d-flex justify-content-end"><small>This is a mirror of the <a href="https://www.torproject.org/">Tor</a> onion service:<br />
|
||||
<a href="http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion/">http://kx5thpx2olielkihfyo4jgjqfb7zx7wxr3sd4xzt26ochei4m6f7tayd.onion</a></small></p>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</footer>
|
||||
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,106 +1,155 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<link href="/img/favicon.ico" rel="icon" type="image/x-icon" />
|
||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="/css/bootstrap-responsive.min.css" rel="stylesheet">
|
||||
<link href="/css/bootstrap-tokenfield.min.css" rel="stylesheet">
|
||||
<link href="/css/custom.css" rel="stylesheet">
|
||||
<link rel="alternate" type="application/rss+xml" title="{{.Title}}" href="/search/?fmt=rss&q={{.Search}}" />
|
||||
|
||||
<title>{{.Title}}</title>
|
||||
<script src="/js/jquery.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<!-- login screen -->
|
||||
<form class="form-horizontal modal hide" id="login" method="POST" action="/login/" enctype="application/x-www-form-urlencoded">
|
||||
<div class="modal-header">
|
||||
<a type="button" class="close" data-dismiss="modal">×</a>
|
||||
<h3>Log In</h3>
|
||||
<small><a href="/login/">Or create an account -></a></small>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<div class="input-prepend">
|
||||
<div class="add-on"><i class="icon-user"></i></div>
|
||||
<input type="text" placeholder="Username" size="16" name="user" autofocus="autofocus">
|
||||
<div class="modal fade" id="loginModal" tabindex="-1" aria-labelledby="loginModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="loginModalLabel">Log In</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end">
|
||||
<small><a href="/login/">Or create an account -></a></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<div class="input-prepend">
|
||||
<div class="add-on"><i class="icon-lock"></i></div>
|
||||
<input type="password" placeholder="Password" size="16" name="pass">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<fieldset>
|
||||
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
|
||||
<input class="btn btn-primary" type="submit" name="submit" value="Log In"/>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
<form id="login" method="POST" action="/login/" enctype="application/x-www-form-urlencoded">
|
||||
<div class="modal-body">
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="user">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#person-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="text" class="form-control" placeholder="Username" name="user" autofocus="autofocus" aria-label="Username" aria-describedby="user">
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="pass">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#key-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="password" class="form-control" placeholder="Password" name="pass" aria-label="Password" aria-describedby="pass">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<input class="btn btn-primary" type="submit" name="submit" value="Log In"/>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- modal-content -->
|
||||
</div> <!-- modal-dialog -->
|
||||
</div> <!-- modal -->
|
||||
|
||||
<div class="navbar navbar-inverse">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="/">Imperial Library</a>
|
||||
<div class="nav-collapse">
|
||||
<ul class="nav">
|
||||
<li {{if .Home}}class="active"{{end}}><a href="/">Home</a></li>
|
||||
<li {{if .About}}class="active"{{end}}><a href="/about/">About</a></li>
|
||||
<li {{if .News}}class="active"{{end}}><a href="/news/">News</a></li>
|
||||
<li {{if .Upload}}class="active"{{end}}><a href="/upload/">Upload</a></li>
|
||||
<li><a href="/forum/">Forum</a></li>
|
||||
</ul>
|
||||
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">Imperial Library</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item"><a class="nav-link {{if .Home}}active{{end}}" href="/">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link {{if .About}}active{{end}}" href="/about/">About</a></li>
|
||||
<li class="nav-item"><a class="nav-link {{if .News}}active{{end}}" href="/news/">News</a></li>
|
||||
<li class="nav-item"><a class="nav-link {{if .Upload}}active{{end}}" href="/upload/">Upload</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/forum/">Forum</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav pull-right">
|
||||
<li class="divider-vertical"></li>
|
||||
{{if .User}}
|
||||
<li class="dropdown">
|
||||
<a href="/dashboard/" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="icon-user icon-white"></i> {{.User}}<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/dashboard/"><i class="icon-tasks"></i> Dashboard</a></li>
|
||||
{{if eq .Role "admin" "moderator"}}
|
||||
<li><a href="/submission/moderate/"><i class="icon-book"></i> Moderate submissions</a></li>
|
||||
{{if eq .Role "admin"}}
|
||||
<li><a href="/news/edit"><i class="icon-certificate"></i> Edit news</a></li>
|
||||
<li><a href="/admin/users/"><i class="icon-user"></i> Users admin</a></li>
|
||||
{{end}}
|
||||
<li class="divider"></li>
|
||||
{{end}}
|
||||
<li><a href="/submission/"><i class="icon-folder-open"></i> Submissions</a></li>
|
||||
<li><a href="/settings/"><i class="icon-wrench"></i> Settings</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/logout/"><i class="icon-off"></i> Log Out</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav justify-content-end">
|
||||
<li class="nav-item"><a class="nav-link {{if .Help}}active{{end}}" href="/help/">Help</a></li>
|
||||
</ul>
|
||||
<form class="d-flex" action="/search/">
|
||||
<input type="search" class="form-control" name="q" {{if .Search}}value="{{.Search}}"{{else}}placeholder="Search"{{end}} />
|
||||
</form>
|
||||
<ul class="navbar-nav">
|
||||
{{if .User}}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="/dashboard/" id="navbarScrollingDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{.User}}
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end" aria-labelledby="navbarScrollingDropdown">
|
||||
<li><a href="/dashboard/" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#card-list"/>
|
||||
</svg>
|
||||
Dashboard
|
||||
</a></li>
|
||||
{{if eq .Role "admin" "moderator"}}
|
||||
<li><a href="/submission/moderate/" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#journal-check"/>
|
||||
</svg>
|
||||
Moderate submissions
|
||||
</a></li>
|
||||
{{if eq .Role "admin"}}
|
||||
<li><a href="/news/edit" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#newspaper"/>
|
||||
</svg>
|
||||
Edit news
|
||||
</a></li>
|
||||
<li><a href="/admin/users/" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#people"/>
|
||||
</svg>
|
||||
Users admin
|
||||
</a></li>
|
||||
{{end}}
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
{{end}}
|
||||
<li><a href="/submission/" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#journal-arrow-up"/>
|
||||
</svg>
|
||||
Submissions
|
||||
</a></li>
|
||||
<li><a href="/settings/" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#gear"/>
|
||||
</svg>
|
||||
Settings
|
||||
</a></li>
|
||||
<li><hr class="dropdown-divider"></li>
|
||||
<li><a href="/logout/" class="dropdown-item">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#power"/>
|
||||
</svg>
|
||||
Log Out
|
||||
</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{{else}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="modal" href="/login/#login" data-bs-toggle="modal" data-bs-target="#loginModal">
|
||||
<small>Login/SignUp</small>
|
||||
</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<li><a data-toggle="modal" href="/login/#login"><i class="icon-user icon-white"></i> <small>Login/SignUp</small></a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
<form class="navbar-search pull-right" action="/search/">
|
||||
<input type="search" class="search-query span3" name="q" {{if .Search}}value="{{.Search}}"{{else}}placeholder="Search"{{end}} />
|
||||
</form>
|
||||
<ul class="nav pull-right">
|
||||
<li {{if .Help}}class="active"{{end}}><a href="/help/">Help</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
{{end}}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.nav-container-fluid-->
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<div class="container">
|
||||
<br />
|
||||
{{range .Notif}}
|
||||
<div class="alert alert-{{.Type}}">
|
||||
<button class="close" data-dismiss="alert">×</button>
|
||||
<strong>{{.Title}}</strong> {{.Msg}}
|
||||
<div class="alert alert-{{.Type}} alert-dismissible fade show" role="alert">
|
||||
<strong>{{.Title}}</strong> {{.Msg}}
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
@ -1,80 +1,43 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
{{range .News}}
|
||||
<div class="row">
|
||||
<div class="offset2 span8 alert alert-info">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-10 alert alert-info">
|
||||
<a href="/news/"><strong>News!</strong></a> {{.Text}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="row">
|
||||
<p class="centered">There are {{.Count}} books on the library.</p>
|
||||
<p class="text-center">There are {{.Count}} books on the library.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<h4>Last books added:
|
||||
<span class="pull-right">
|
||||
<small>(<a href="/search/?q=">more</a>)</small>
|
||||
<a href="/search/?fmt=rss&q="><img src="/img/feed.png"/></a>
|
||||
</span>
|
||||
</h4>
|
||||
<div class="col">
|
||||
<h4>Last books added:</h4>
|
||||
</div>
|
||||
<div class="col text-end title">
|
||||
<small>(<a href="/search/?q=">more</a>)</small>
|
||||
<a href="/search/?fmt=rss&q="><img src="/img/feed.png"/></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="row thumbnails">
|
||||
<div class="row">
|
||||
{{with .Books}}
|
||||
{{range .}}
|
||||
<li class="span2">
|
||||
<div class="thumbnail centered" style="border:none;">
|
||||
<div class="col-sm-2">
|
||||
<div class="thumbnail text-center" style="border:none;">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{if .Cover}}<div class="down"><img class="img-rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
|
||||
{{if .Cover}}<div class="down"><img class="rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" /></div>{{end}}
|
||||
<p><strong>{{.Title}}</strong></p>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<div class="row">
|
||||
<h4>Most visited books:</h4>
|
||||
</div>
|
||||
<ul class="row thumbnails">
|
||||
{{with .VisitedBooks}}
|
||||
{{range .}}
|
||||
<li class="span2">
|
||||
<div class="thumbnail centered" style="border:none;">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{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>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
<h4>Most downloaded books:</h4>
|
||||
</div>
|
||||
<ul class="row thumbnails">
|
||||
{{with .DownloadedBooks}}
|
||||
{{range .}}
|
||||
<li class="span2">
|
||||
<div class="thumbnail centered" style="border:none;">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{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>
|
||||
</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
-->
|
||||
|
||||
<div class="row">
|
||||
<p class="centered">{{range .Tags}}<a class="label" href="/search/?q=tag:{{.}}">{{.}}</a> {{end}}</p>
|
||||
<p class="text-center">{{range .Tags}}<a class="badge bg-secondary" href="/search/?q=tag:{{.}}">{{.}}</a> {{end}}</p>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<div class="row">
|
||||
<h4 class="span10">{{.List.Title}} <a href="/list/{{.List.ListID}}?fmt=rss"><img src="/img/feed.png"/></a></h4>
|
||||
<h4 class="col-sm-10">{{.List.Title}} <a href="/list/{{.List.ListID}}?fmt=rss"><img src="/img/feed.png"/></a></h4>
|
||||
|
||||
<p class="span2 pull-right">
|
||||
<p class="col-sm-2 text-end">
|
||||
{{if eq .S.User .List.User.Username}}
|
||||
<a href="/list/{{.List.ListID}}/edit" class="btn btn-primary"><i class="icon-pencil"></i> Edit</a>
|
||||
<a href="/list/{{.List.ListID}}/edit" class="btn btn-primary">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#pencil"/>
|
||||
</svg>
|
||||
Edit
|
||||
</a>
|
||||
{{else}}
|
||||
By {{.List.User.Username}}
|
||||
{{end}}
|
||||
|
|
|
@ -1,54 +1,56 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
{{with .List}}
|
||||
<form class="form-horizontal" method="POST" action="/list/{{.ListID}}">
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="title">Title</label>
|
||||
<div class="controls">
|
||||
<input class="input-xlarge" type="text" id="title" value="{{.Title}}" name="title">
|
||||
</div>
|
||||
<form method="POST" action="/list/{{.ListID}}">
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="title">Title</label>
|
||||
<input class="form-control" type="text" id="title" value="{{.Title}}" name="title">
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="description">Description</label>
|
||||
<div class="controls">
|
||||
<textarea class="input-xlarge" id="description" rows="5" name="description">{{range .Description}}{{.}}
|
||||
{{end}}</textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="description">Description</label>
|
||||
<textarea class="form-control" id="description" rows="5" name="description">{{range .Description}}{{.}}{{end}}</textarea>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="/list/{{.ListID}}" class="btn">Cancel</a>
|
||||
<div class="text-end">
|
||||
<button type="submit" class="btn btn-primary">Save</button>
|
||||
<a href="/list/{{.ListID}}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{{end}}
|
||||
|
||||
<br />
|
||||
|
||||
{{$listID := .List.ListID}}
|
||||
{{range .List.Books}}
|
||||
<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>
|
||||
</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>
|
||||
<span class="muted">{{if .Publisher}}{{.Publisher}}{{end}}</span><br />
|
||||
{{range .Authors}}{{.}}, {{end}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="pull-right">
|
||||
<a href="/list/{{$listID}}/remove/{{.ID}}" class="btn btn-danger"><i class="icon-remove"></i> remove</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-1 d-flex align-items-center justify-content-center">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{if .Cover}}<img class="rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<div class="card-body">
|
||||
<p class="card-title">
|
||||
<span class="text-muted">[{{if .Lang}}{{.Lang}}{{end}}]</span>
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}"><strong>{{.Title}}</strong></a>
|
||||
<span class="text-muted">{{if .Publisher}}{{.Publisher}}{{end}}</span>
|
||||
</p>
|
||||
<div class="card-text row">
|
||||
<p class="col-9">{{range .Authors}}{{.}}, {{end}}</p>
|
||||
<div class="col-3">
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="/list/{{$listID}}/remove/{{.ID}}" class="btn btn-danger">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash"/>
|
||||
</svg>
|
||||
remove
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -21,46 +21,67 @@ function checkPasswordMatch() {
|
|||
}
|
||||
</script>
|
||||
|
||||
<div class="offset1 span4">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-sm-4">
|
||||
<h3>Log In</h3>
|
||||
<form id="login" method="POST" action="/login/" enctype="application/x-www-form-urlencoded">
|
||||
<div class="input-prepend">
|
||||
<div class="add-on"><i class="icon-user"></i></div>
|
||||
<input type="text" placeholder="Username" size="16" name="user" autofocus="autofocus">
|
||||
</div>
|
||||
<div class="input-prepend">
|
||||
<div class="add-on"><i class="icon-lock"></i></div>
|
||||
<input type="password" placeholder="Password" size="16" name="pass">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" name="submit" value="Log In"/>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="user">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#person-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="text" class="form-control" placeholder="Username" name="user" autofocus="autofocus" aria-label="Username" aria-describedby="user">
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="pass">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#key-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="password" class="form-control" placeholder="Password" name="pass" aria-label="Password" aria-describedby="pass">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" name="submit" value="Log In"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="span2">
|
||||
<div class="col-sm-2">
|
||||
<br />
|
||||
<br />
|
||||
<h3 class="centered">Or</h3>
|
||||
<br />
|
||||
<br />
|
||||
</div>
|
||||
<div class="span4">
|
||||
<div class="col-sm-4">
|
||||
<h3>Create an Account</h3>
|
||||
<form id="login" method="POST" action="/create_user/" enctype="application/x-www-form-urlencoded">
|
||||
<div class="input-prepend">
|
||||
<div class="add-on"><i class="icon-user"></i></div>
|
||||
<input type="text" placeholder="Username" size="16" name="user">
|
||||
</div>
|
||||
<div class="input-prepend">
|
||||
<div class="add-on"><i class="icon-lock"></i></div>
|
||||
<input type="password" placeholder="Password" size="16" name="pass" id="pass">
|
||||
</div>
|
||||
<div class="control-group" id="passCheck">
|
||||
<div class="controls input-prepend">
|
||||
<div class="add-on"><i class="icon-lock"></i></div>
|
||||
<input type="password" placeholder="Confirm password" size="16" name="confirmPass" id="confirmPass">
|
||||
</div>
|
||||
<span id="passCheckHelp" class="help-inline"></span>
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" name="submit" value="Create"/>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="user">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#person-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="text" class="form-control" placeholder="Username" name="user" autofocus="autofocus" aria-label="Username" aria-describedby="user">
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="pass">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#key-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="password" class="form-control" placeholder="Password" name="pass" aria-label="Password" aria-describedby="pass" id="pass">
|
||||
</div>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="pass">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#key-fill"/>
|
||||
</svg>
|
||||
</span>
|
||||
<input type="password" class="form-control" placeholder="Confirm password" name="confirmPass" aria-label="Password" aria-describedby="confirmPass" id="confirmPass">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" name="submit" value="Create" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<h4>News:
|
||||
<a href="/news/?fmt=rss" class="pull-right"><img src="/img/feed.png"/></a>
|
||||
</h4>
|
||||
|
||||
<dl class="dl-horizontal">
|
||||
{{range .News}}
|
||||
<div class="well well-small">
|
||||
<dt>{{.Date}}</dt>
|
||||
<dd>{{.Text}}</dd>
|
||||
<div class="row">
|
||||
<h4 class="col">News:</h4>
|
||||
<a href="/news/?fmt=rss" class="col text-end"><img src="/img/feed.png"/></a>
|
||||
</div>
|
||||
|
||||
<dl>
|
||||
{{range .News}}
|
||||
<div class="row">
|
||||
<dt class="col-sm-2 text-sm-end">{{.Date}}</dt>
|
||||
<dd class="col-sm-10">{{.Text}}</dd>
|
||||
</div>
|
||||
{{end}}
|
||||
</dl>
|
||||
|
||||
|
|
|
@ -3,68 +3,80 @@
|
|||
|
||||
|
||||
<div class="row">
|
||||
<div class="span4">
|
||||
{{range .Chapters}}
|
||||
{{range .In}}
|
||||
<ul id="bookMenu" class="nav nav-list hidden-phone">
|
||||
{{end}}
|
||||
<li {{if .Active}}class="active"{{end}}><a href="{{.Link}}">{{.Label}}</a></li>
|
||||
{{range .Out}}
|
||||
</ul>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .Chapters}}
|
||||
</ul>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="span8">
|
||||
<script type="text/javascript">
|
||||
function resizeIframe() {
|
||||
var contentHeight = $("#bookContent").contents().find("html").height();
|
||||
$("#bookContent").height(ContentHeight);
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="pager">
|
||||
{{if .Prev}}
|
||||
<li class="previous">
|
||||
<a href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{if .Book.Active}}
|
||||
<li class="">
|
||||
<a href="{{.Back}}">Back</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<span class="label label-warning">waiting for moderation</span>
|
||||
{{end}}
|
||||
{{if .Next}}
|
||||
<li class="next">
|
||||
<a href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{if .Chapters}}
|
||||
<div class="col-md-4">
|
||||
<nav id="index" class="navbar navbar-expand-md navbar-light bg-light flex-column">
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-start">
|
||||
<a class="navbar-brand" href="#">Index</a>
|
||||
</div>
|
||||
<div class="d-block d-md-none col d-flex justify-content-end">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#indexContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse" id="indexContent">
|
||||
{{range .Chapters}}
|
||||
{{range .In}}
|
||||
<nav class="nav nav-pills flex-column">
|
||||
{{end}}
|
||||
<a class="nav-link ms-{{mul 2 .Depth}}{{if .Active}} active{{end}}" href="{{.Link}}">{{.Label}}</a>
|
||||
{{range .Out}}
|
||||
</nav>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<iframe id="bookContent" onload="resizeIframe();" style="width: 100%; height: 1080px; border: 0;" scrolling="auto" src="{{.Content}}" seamless="seamless" sandbox="allow-same-origin" frameborder=0></iframe>
|
||||
<div class="col">
|
||||
<script type="text/javascript">
|
||||
function resizeIframe() {
|
||||
var contentHeight = $("#bookContent").contents().find("html").height();
|
||||
$("#bookContent").height(ContentHeight);
|
||||
}
|
||||
</script>
|
||||
|
||||
<ul class="pager">
|
||||
{{if .Prev}}
|
||||
<li class="previous">
|
||||
<a href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li class="">
|
||||
<a href="{{.Back}}">Back</a>
|
||||
</li>
|
||||
{{if .Next}}
|
||||
<li class="next">
|
||||
<a href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{if not .Book.Active}}
|
||||
<div class="text-center">
|
||||
<p class="badge bg-warning">waiting for moderation</p>
|
||||
</div>
|
||||
{{end}}
|
||||
<nav class="d-flex justify-content-center" arial-label="Book navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {{if not .Prev}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{.Back}}">Back</a>
|
||||
</li>
|
||||
<li class="page-item {{if not .Next}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
<iframe id="bookContent" onload="resizeIframe();" style="width: 100%; height: 1080px; border: 0;" scrolling="auto" src="{{.Content}}" seamless="seamless" sandbox="allow-same-origin" frameborder=0></iframe>
|
||||
|
||||
<nav class="d-flex justify-content-center" arial-label="Book navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {{if not .Prev}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="{{.Back}}">Back</a>
|
||||
</li>
|
||||
<li class="page-item {{if not .Next}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -1,45 +1,50 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
|
||||
<ul class="pager">
|
||||
{{if .Prev}}
|
||||
<li class="previous">
|
||||
<a href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<div class="span1"></div>
|
||||
{{end}}
|
||||
<p class="centered span9">Found {{.Found}} books. Page {{.Page}} <a href="{{.S.FullURL}}&fmt=rss"><img src="/img/feed.png"/></a> <br />
|
||||
{{if .Next}}
|
||||
<li class="next">
|
||||
<a href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
<p class="text-center">Found {{.Found}} books <a href="{{.S.FullURL}}&fmt=rss"><img src="/img/feed.png"/></a> <br />
|
||||
<nav class="d-flex justify-content-center" arial-label="Book search page navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {{if not .Prev}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#">Page {{.Page}}</a>
|
||||
</li>
|
||||
<li class="page-item {{if not .Next}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
{{template "book_list.html" .Books}}
|
||||
|
||||
<ul class="pager">
|
||||
{{if .Prev}}
|
||||
<li class="previous">
|
||||
<a href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<div class="span1"></div>
|
||||
{{end}}
|
||||
<form class="form-inline span9 centered">
|
||||
<label>Books per page: </label>
|
||||
<div class="input-append" action="/search/">
|
||||
<input class="span1" name="num" type="text" value="{{.ItemsPage}}" />
|
||||
<button type="submit" class="btn">Ok</button>
|
||||
</div>
|
||||
<input class="hidden span1" name="q" type="text" value="{{.S.Search}}" />
|
||||
<nav class="d-flex justify-content-center" arial-label="Book search page navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {{if not .Prev}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#">Page {{.Page}}</a>
|
||||
</li>
|
||||
<li class="page-item {{if not .Next}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<form class="d-flex justify-content-center" action="/search/">
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-auto">
|
||||
<label for="inputNum" class="col-form-label">Books per page: </label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input name="num" size="3" type="text" value="{{.ItemsPage}}" id="inputNum" class="form-control" />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="submit" class="btn btn-primary">Ok</button>
|
||||
</div>
|
||||
</div>
|
||||
<input name="q" type="hidden" value="{{.S.Search}}" />
|
||||
</form>
|
||||
{{if .Next}}
|
||||
<li class="next">
|
||||
<a href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
|
@ -1,51 +1,36 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#passCheck").keyup(checkPasswordMatch);
|
||||
});
|
||||
|
||||
function checkPasswordMatch() {
|
||||
var password = $("#password1").val();
|
||||
var confirmPassword = $("#password2").val();
|
||||
var password = document.forms["passwordChange"]["password1"].value;
|
||||
var confirmPassword = document.forms["passwordChange"]["password2"].value;
|
||||
|
||||
if (password != confirmPassword) {
|
||||
$("#passCheck").removeClass("success");
|
||||
$("#passCheck").addClass("error");
|
||||
$("#passCheckHelp").html("Passwords don't match!");
|
||||
document.getElementById("password2").classList.remove("is-valid");
|
||||
document.getElementById("password2").classList.add("is-invalid");
|
||||
} else {
|
||||
$("#passCheck").removeClass("error");
|
||||
$("#passCheck").addClass("success");
|
||||
$("#passCheckHelp").html("");
|
||||
document.getElementById("password2").classList.remove("is-invalid");
|
||||
document.getElementById("password2").classList.add("is-valid");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<h2>Settings</h2>
|
||||
|
||||
<form class="form-horizontal" method="POST" action="/settings/">
|
||||
<form name="passwordChange" method="POST" action="/settings/">
|
||||
<legend>Change your pasword</legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="currpass">Current password:</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="currpass" id="currpass" /><br />
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="currpass">Current password:</label>
|
||||
<input class="form-control" type="password" name="currpass" id="currpass" /><br />
|
||||
</div>
|
||||
<div class="control-group" id="passCheck">
|
||||
<label class="control-label" for="password1">New password:</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password1" id="password1" />
|
||||
</div>
|
||||
<label class="control-label" for="password2">Confirm password:</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="password2" id="password2" />
|
||||
</div>
|
||||
<div id="passCheckHelp" class="controls text-error"></div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label" for="password1">New password:</label>
|
||||
<input class="form-control" type="password" name="password1" id="password1" onchange="checkPasswordMatch()" />
|
||||
<label class="form-label" for="password2">Confirm password:</label>
|
||||
<input class="form-control" type="password" name="password2" id="password2" onchange="checkPasswordMatch()" />
|
||||
<div class="invalid-feedback">Passwords don't match!</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn">Change password</button>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Change password</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<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>
|
||||
<li>Take into account that your submission might be waiting to process, reload this page in few minutes to see it already processed</li>
|
||||
</ul>
|
||||
<p>Thank you for your submission.</p>
|
||||
</div>
|
||||
|
@ -13,66 +14,97 @@
|
|||
{{$submissionID := .SubmissionID}}
|
||||
{{range .Submissions}}
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="span9">
|
||||
<p><b>{{.Filename}}</b>
|
||||
{{if not .Book}}
|
||||
<span class="label label-important">
|
||||
{{else if .Book.Active}}
|
||||
<span class="label label-success">
|
||||
{{else}}
|
||||
<span class="label label-warning">
|
||||
{{end}}
|
||||
{{.Status}}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
{{with .Book}}
|
||||
|
||||
{{if .}}
|
||||
<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>
|
||||
</div>
|
||||
<div class="span10 well">
|
||||
<div class="row">
|
||||
<div class="span7">
|
||||
<p>
|
||||
<span class="muted">[{{if .Lang}}{{.Lang}}{{end}}]</span>
|
||||
<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">
|
||||
{{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_url .}}" 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>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<p>
|
||||
<b>{{.Filename}}</b>
|
||||
{{if not .Book}}
|
||||
<span class="badge bg-danger">
|
||||
{{else if .Book.Active}}
|
||||
<span class="badge bg-success">
|
||||
{{else}}
|
||||
<span class="badge bg-warning">
|
||||
{{end}}
|
||||
{{.Status}}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{{if .Book}}
|
||||
<form class="row form-inline" method="POST" action="/submission/{{$submissionID}}/comment/{{.Book.ID}}">
|
||||
<textarea class="span11" id="comment" rows="2" name="comment" placeholder="Comments about this book submission. Is it a better version than an existing one in the library?">{{.Comment}}</textarea>
|
||||
<button type="submit" class="btn btn-primary">Send comment</button>
|
||||
</form>
|
||||
{{$comment := .Comment}}
|
||||
{{with .Book}}
|
||||
{{if .}}
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-1 d-flex align-items-center justify-content-center">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{if .Cover}}<img class="rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<div class="card-body">
|
||||
<p class="card-title">
|
||||
<a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a>
|
||||
</p>
|
||||
<div class="card-text row">
|
||||
<p class="col-md-8">
|
||||
{{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}}
|
||||
{{if .Lang}}<strong>Lang:</strong> <a href="/search/?q=lang:{{.Lang}}">{{.Lang}}</a> <br />{{end}}
|
||||
</p>
|
||||
<div class="col-md-4">
|
||||
{{if and .ID (not .Active)}}
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
{{if eq $role "admin" "moderator"}}
|
||||
<a href="/store/{{.ID}}/" class="btn btn-success">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#check"/>
|
||||
</svg>
|
||||
save
|
||||
</a>
|
||||
{{end}}
|
||||
<a href="/submission/{{$submissionID}}/edit/{{.ID}}" class="btn btn-primary">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#pencil"/>
|
||||
</svg>
|
||||
edit
|
||||
</a>
|
||||
<a href="/submission/{{$submissionID}}/delete/{{.ID}}/" class="btn btn-danger">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash"/>
|
||||
</svg>
|
||||
delete
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="{{download_url .}}" class="btn btn-dark btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#file-earmark-arrow-down"/>
|
||||
</svg>
|
||||
download
|
||||
</a>
|
||||
<a href="/read/{{.ID}}" class="btn btn-warning btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#eyeglasses"/>
|
||||
</svg>
|
||||
read it!
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>{{.Description}}</p>
|
||||
|
||||
{{if not .Active}}
|
||||
<form method="POST" action="/submission/{{$submissionID}}/comment/{{.ID}}">
|
||||
<textarea class="form-control" id="comment" rows="2" name="comment" placeholder="Comments about this book submission. Is it a better version than an existing one in the library?">{{$comment}}</textarea>
|
||||
<button type="submit" class="btn btn-primary">Update comment</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -1,89 +1,153 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<form class="centered" action="/submission/moderate/">
|
||||
<input type="search" class="search-query span8" name="q" {{if .Search}}value="{{.Search}}"{{else}}placeholder="Search"{{end}} />
|
||||
<form action="/submission/moderate/">
|
||||
<div class="row justify-content-center">
|
||||
<input type="search" class="col-sm-8" name="q" {{if .Search}}value="{{.Search}}"{{else}}placeholder="Search"{{end}} />
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
|
||||
{{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>
|
||||
<div class="btn-group">
|
||||
<a href="/store/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-lg btn-success">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#check-all"/>
|
||||
</svg>
|
||||
Save All
|
||||
</a>
|
||||
<a href="/delete/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-lg btn-danger">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash-fill"/>
|
||||
</svg>
|
||||
Delete All
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<p class="centered">Found {{.Found}} books.<br /></p>
|
||||
<ul class="pager">
|
||||
{{if .Prev}}
|
||||
<li class="previous">
|
||||
<a href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{if .Next}}
|
||||
<li class="next">
|
||||
<a href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<p class="text-center">Found {{.Found}} books.<br /></p>
|
||||
<nav class="d-flex justify-content-center" arial-label="Book moderate page navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {{if not .Prev}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#">Page {{.Page}}</a>
|
||||
</li>
|
||||
<li class="page-item {{if not .Next}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
{{range .Books}}
|
||||
{{$titleFound := .TitleFound}}
|
||||
{{$authorFound := .AuthorFound}}
|
||||
{{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>
|
||||
</div>
|
||||
<div class="span9">
|
||||
<p><a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a> <!--<small>({{$titleFound}})</small>--><br />
|
||||
{{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 .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}}
|
||||
{{.Description}}
|
||||
</p>
|
||||
</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>
|
||||
</div>
|
||||
<div class="row"><p></p></div>
|
||||
<div class="row btn-group pull-right">
|
||||
<a href="{{download_url .}}" 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 class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-1 d-flex align-items-center justify-content-center">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{if .Cover}}<img class="rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<div class="card-body">
|
||||
<p class="card-title">
|
||||
<a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a> <!--<small>({{$titleFound}})</small>-->
|
||||
</p>
|
||||
<div class="card-text row">
|
||||
<p class="col-md-8">
|
||||
{{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 .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}}
|
||||
</p>
|
||||
<div class="col-md-4">
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="/store/{{.ID}}/" class="btn btn-success">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#check"/>
|
||||
</svg>
|
||||
save
|
||||
</a>
|
||||
<a href="/edit/{{.ID}}" class="btn btn-primary">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#pencil"/>
|
||||
</svg>
|
||||
edit
|
||||
</a>
|
||||
<a href="/delete/{{.ID}}/" class="btn btn-danger">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash"/>
|
||||
</svg>
|
||||
delete
|
||||
</a>
|
||||
</div>
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="{{download_url .}}" class="btn btn-dark btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#file-earmark-arrow-down"/>
|
||||
</svg>
|
||||
download
|
||||
</a>
|
||||
<a href="/read/{{.ID}}" class="btn btn-warning btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#eyeglasses"/>
|
||||
</svg>
|
||||
read it!
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>{{.Description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .Comment}}
|
||||
<div class="row">
|
||||
<div class="span1">
|
||||
<div class="col-md-1">
|
||||
<b>Comment:</b>
|
||||
</div>
|
||||
<div class="span10 well">
|
||||
<div class="col-md-11">
|
||||
<p>{{.Comment}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
{{end}}
|
||||
{{end}}
|
||||
<ul class="pager">
|
||||
{{if .Prev}}
|
||||
<li class="previous">
|
||||
<a href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{if .Next}}
|
||||
<li class="next">
|
||||
<a href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<nav class="d-flex justify-content-center" arial-label="Book moderate page navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {{if not .Prev}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Prev}}">← Prev</a>
|
||||
</li>
|
||||
<li class="page-item disabled">
|
||||
<a class="page-link" href="#">Page {{.Page}}</a>
|
||||
</li>
|
||||
<li class="page-item {{if not .Next}}disabled{{end}}">
|
||||
<a class="page-link" href="{{.Next}}">Next →</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
{{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>
|
||||
<div class="btn-group">
|
||||
<a href="/store/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-lg btn-success">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#check-all"/>
|
||||
</svg>
|
||||
Save All
|
||||
</a>
|
||||
<a href="/delete/{{range .Books}}{{.B.ID}}/{{end}}" class="btn btn-lg btn-danger">
|
||||
<svg class="bi" width="1.5em" height="1.5em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash-fill"/>
|
||||
</svg>
|
||||
Delete All
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -7,70 +7,98 @@
|
|||
{{$role := .S.Role}}
|
||||
{{range .Submissions}}
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="span9">
|
||||
<p><b>{{.Filename}}</b>
|
||||
{{if not .Book}}
|
||||
<span class="label label-important">
|
||||
{{else if .Book.Active}}
|
||||
<span class="label label-success">
|
||||
{{else}}
|
||||
<span class="label label-warning">
|
||||
{{end}}
|
||||
{{.Status}}</span></p>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<h6 class="pull-right"><a href="/submission/{{.SubmissionID}}">Submission {{.SubmissionID}}</a></h6>
|
||||
</div>
|
||||
</div>
|
||||
{{$submissionID := .SubmissionID}}
|
||||
{{with .Book}}
|
||||
|
||||
{{if .}}
|
||||
<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>
|
||||
</div>
|
||||
<div class="span10 well">
|
||||
<div class="row">
|
||||
<div class="span7">
|
||||
<p>
|
||||
<span class="muted">[{{if .Lang}}{{.Lang}}{{end}}]</span>
|
||||
<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">
|
||||
{{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_url .}}" 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>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<p>
|
||||
<b>{{.Filename}}</b>
|
||||
{{if not .Book}}
|
||||
<span class="badge bg-danger">
|
||||
{{else if .Book.Active}}
|
||||
<span class="badge bg-success">
|
||||
{{else}}
|
||||
<span class="badge bg-warning">
|
||||
{{end}}
|
||||
{{.Status}}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{{if .Book}}
|
||||
<form class="row form-inline" method="POST" action="/submission/{{.SubmissionID}}/comment/{{.Book.ID}}">
|
||||
<textarea class="span11" id="comment" rows="2" name="comment" placeholder="Comments about this book submission. Is it a better version than an existing one in the library?">{{.Comment}}</textarea>
|
||||
<button type="submit" class="btn btn-primary">Send comment</button>
|
||||
</form>
|
||||
{{$comment := .Comment}}
|
||||
{{$submissionID := .SubmissionID}}
|
||||
{{with .Book}}
|
||||
{{if .}}
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-1 d-flex align-items-center justify-content-center">
|
||||
<a href="/book/{{.ID}}" title="{{.Description}}">
|
||||
{{if .Cover}}<img class="rounded" src="/cover/{{.ID}}/small/{{.Title}}.jpg" alt="{{.Title}}" />{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<div class="card-body">
|
||||
<p class="card-title">
|
||||
<a href="/search/?q=title:{{.Title}}"><strong>{{.Title}}</strong></a>
|
||||
</p>
|
||||
<div class="card-text row">
|
||||
<p class="col-md-8">
|
||||
{{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}}
|
||||
{{if .Lang}}<strong>Lang:</strong> <a href="/search/?q=lang:{{.Lang}}">{{.Lang}}</a> <br />{{end}}
|
||||
</p>
|
||||
<div class="col-md-4">
|
||||
{{if and .ID (not .Active)}}
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
{{if eq $role "admin" "moderator"}}
|
||||
<a href="/store/{{.ID}}/" class="btn btn-success">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#check"/>
|
||||
</svg>
|
||||
save
|
||||
</a>
|
||||
{{end}}
|
||||
<a href="/submission/{{$submissionID}}/edit/{{.ID}}" class="btn btn-primary">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#pencil"/>
|
||||
</svg>
|
||||
edit
|
||||
</a>
|
||||
<a href="/submission/{{$submissionID}}/delete/{{.ID}}/" class="btn btn-danger">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#trash"/>
|
||||
</svg>
|
||||
delete
|
||||
</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="btn-group d-flex justify-content-end">
|
||||
<a href="{{download_url .}}" class="btn btn-dark btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#file-earmark-arrow-down"/>
|
||||
</svg>
|
||||
download
|
||||
</a>
|
||||
<a href="/read/{{.ID}}" class="btn btn-warning btn-sm">
|
||||
<svg class="bi" width="1em" height="1em" fill="currentColor">
|
||||
<use xlink:href="/img/bootstrap-icons.svg#eyeglasses"/>
|
||||
</svg>
|
||||
read it!
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>{{.Description}}</p>
|
||||
|
||||
{{if not .Active}}
|
||||
<form method="POST" action="/submission/{{$submissionID}}/comment/{{.ID}}">
|
||||
<textarea class="form-control" id="comment" rows="2" name="comment" placeholder="Comments about this book submission. Is it a better version than an existing one in the library?">{{$comment}}</textarea>
|
||||
<button type="submit" class="btn btn-primary">Update comment</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -2,10 +2,14 @@
|
|||
|
||||
<p>Upload your epubs to help the library.</p>
|
||||
|
||||
<form class="well form-inline" method="POST" enctype="multipart/form-data">
|
||||
<input accept="application/epub+zip" type="file" name="epub" multiple="multiple" />
|
||||
<button type="submit" class="btn">Submit</button>
|
||||
</form>
|
||||
<div class="row justify-content-center">
|
||||
<form class="col-sm-11" method="POST" enctype="multipart/form-data">
|
||||
<div class="input-group mb-3">
|
||||
<input accept="application/epub+zip" type="file" name="epub" multiple="multiple" />
|
||||
<button type="submit" class="btn btn-outline-secondary">Upload</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p>The uploaded books will be reviewed by the librarians and included if they comply our quality standards. Do not upload epubs converted from PDFs or any book that is not pleasant to read.</p>
|
||||
|
||||
|
|
|
@ -1,8 +1,33 @@
|
|||
{{template "header.html" .S}}
|
||||
|
||||
<h4>Add user:</h4>
|
||||
<form class="row" method="POST" action="/admin/users/add/">
|
||||
<div class="col-6 col-md-3">
|
||||
<label class="col-form-label" for="username">Username</label>
|
||||
<input class="form-control" type="text" id="username" name="username">
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md-3">
|
||||
<label class="col-form-label" for="role">Role</label>
|
||||
<input class="form-control" type="text" id="role" name="role" value="moderator">
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md-3">
|
||||
<label class="col-form-label" for="password">Password</label>
|
||||
<input class="form-control" type="password" id="password" name="password">
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-md-3">
|
||||
<br />
|
||||
<button type="submit" class="btn btn-primary" id="submit">Create</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br />
|
||||
<h4>Users:</h4>
|
||||
|
||||
<table class="table table-hover">
|
||||
<div class="table-responsive-md">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>username</th>
|
||||
<th>role</th>
|
||||
|
@ -13,16 +38,24 @@
|
|||
{{range .Users}}
|
||||
<tr>
|
||||
<td>{{.Username}}</td>
|
||||
<td><form class="row form-inline" method="POST" action="/admin/users/">
|
||||
<td><form class="row" method="POST" action="/admin/users/">
|
||||
<input type="hidden" id="username" name="username" value="{{.Username}}">
|
||||
<div class="col">
|
||||
<input type="text" id="role" name="role" value="{{.Role}}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
<td><form class="row form-inline" method="POST" action="/admin/users/">
|
||||
<input type="hidden" id="username" name="username" value="{{.Username}}">
|
||||
<input type="password" id="password" name="password" placeholder="password">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
<div class="col">
|
||||
<input type="password" id="password" name="password" placeholder="password">
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</div>
|
||||
</form>
|
||||
</td>
|
||||
<td>{{.LastLogin.Format "2006-01-02"}}</td>
|
||||
|
@ -30,33 +63,6 @@
|
|||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>Add user:</h4>
|
||||
<form class="form-horizontal" method="POST" action="/admin/users/add/">
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="username">Username</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="username" name="username">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="role">Role</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="role" name="role" value="moderator">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="password">Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" id="password" name="password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .S}}
|
||||
|
|
Reference in a new issue