Add chapters
This commit is contained in:
18
server/views/chapter-form.pug
Normal file
18
server/views/chapter-form.pug
Normal file
@@ -0,0 +1,18 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 Chapter in #{entry.name}
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
form.row(action=`/library/${entry.id}/chapters/add`, method="post")
|
||||
.col.s12.input-field
|
||||
textarea#textarea.materialize-textarea(name="text")
|
||||
label(for="textarea") Chapter Text
|
||||
.col.s12.input-field
|
||||
input#index(type="number", name="index", value=entry.chapters.length+1)
|
||||
label(for="index") Chapter Number
|
||||
.col.s12
|
||||
button.btn.black(type="submit") add chapter
|
||||
13
server/views/chapter.pug
Normal file
13
server/views/chapter.pug
Normal file
@@ -0,0 +1,13 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
|
||||
|
||||
//- h1= chapter.name
|
||||
|
||||
a.btn.black(href=`/library/${chapter.entryId}`) go to entry
|
||||
|
||||
.row
|
||||
each chunk in chapter.chunks
|
||||
p.flow-text= chunk.text
|
||||
@@ -3,4 +3,16 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1= entry.name
|
||||
h1= entry.name
|
||||
|
||||
a.btn.black(href=`/library/${entry.id}/chapters/add`) add chapter
|
||||
|
||||
if entry.chapters.length == 0
|
||||
p.flow-text No chapters added
|
||||
else
|
||||
.row
|
||||
each chapter in entry.chapters
|
||||
.col.s12
|
||||
a(href=`/library/${entry.id}/chapters/${chapter.id}`)
|
||||
.card-panel
|
||||
p.flow-text= chapter.name
|
||||
Reference in New Issue
Block a user