Add versioning

This commit is contained in:
2021-12-25 01:35:32 +02:00
parent 1a539e673f
commit da9d91502c
14 changed files with 388 additions and 261 deletions

View File

@@ -3,16 +3,16 @@ extend templates/layout.pug
block content
.container
.center
h1 Chapter in #{entry.name}
h1 Chapter in #{entryVersion.name}
.row
.col.s12
form.row(action=`/library/${entry.id}/chapters/add`, method="post")
form.row(action=`/v/${entryVersion.id}/chapters/add`, method="post")
.col.s12.input-field
textarea#textarea.materialize-textarea(name="text")
label(for="textarea") Chapter Text
label(for="textarea") Entire chapter text (markdown)
.col.s12.input-field
input#index(type="number", name="index", value=entry.chapters.length+1)
input#index(type="number", name="index", value=entryVersion.chapters.length+1)
label(for="index") Chapter Number
.col.s12
button.btn.black(type="submit") add chapter

View File

@@ -6,7 +6,7 @@ block content
//- h1= chapter.name
a.btn.black(href=`/library/${chapter.entryId}`) go to entry
a.btn.black(href=`/v/${chapter.entryVersionId}`) go to entry
.row
each chunk in chapter.chunks

View File

@@ -0,0 +1,35 @@
extend templates/layout.pug
block content
.container
.center
h1 #{entryVersion.entry.name}
h2 #{entryVersion.tag}
.divider
.row
a.btn.black(href=`/v/${entryVersion.id}/chapters/add`) add chapter
if entryVersion.chapters.length == 0
p.flow-text No chapters added
else
.row
each chapter in entryVersion.chapters
.col.s12
a(href=`/v/${entryVersion.id}/chapters/${chapter.id}`)
.card-panel
p.flow-text= chapter.name
.divider
.row
a.btn.black(href=`/v/${entryVersion.id}/translations/add`) add translation
if entryVersion.translationEntryVersions.length == 0
p.flow-text No chapters added
else
.row
each translationEntry in entryVersion.translationEntryVersions
.col.s12
a(href=`/v/${entryVersion.id}/translations/${translationEntry.id}`)
.card-panel
p.flow-text= translationEntry.name

View File

@@ -7,28 +7,14 @@ block content
.divider
.row
a.btn.black(href=`/library/${entry.id}/chapters/add`) add chapter
a.btn.black(href=`/library/${entry.id}/version/add`) add version
if entry.chapters.length == 0
p.flow-text No chapters added
if entry.entryVersions.length == 0
p.flow-text No available versions
else
.row
each chapter in entry.chapters
each entryVersion in entry.entryVersions
.col.s12
a(href=`/library/${entry.id}/chapters/${chapter.id}`)
a(href=`/library/${entryVersion.entryId}/v/${entryVersion.id}`)
.card-panel
p.flow-text= chapter.name
.divider
.row
a.btn.black(href=`/library/${entry.id}/translations/add`) add translation
if entry.translationEntries.length == 0
p.flow-text No chapters added
else
.row
each translationEntry in entry.translationEntries
.col.s12
a(href=`/library/${entry.id}/translations/${translationEntry.id}`)
.card-panel
p.flow-text= translationEntry.name
p.flow-text= entryVersion.tag

View File

@@ -14,5 +14,9 @@ block content
.col.s12.input-field
input#url(type="text", name="url", value=entry.url)
label(for="url") Entry Url
if entry.id == null
.col.s12.input-field
input#version(type="text", name="version", value=entry.version)
label(for="version") First Version Number
.col.s12
button.btn.black(type="submit") add entry

View File

@@ -3,8 +3,8 @@ extend templates/layout.pug
block content
.container
.center
h1= chapter.entry.translationEntries[0].name
h2= chapter.entry.name
h1= chapter.entryVersion.translationEntryVersions[0].name
h2= chapter.entryVersion.entry.name
//- TODO: List chunks in the chapter
.row
@@ -12,8 +12,8 @@ block content
table
thead
tr
th #{chapter.entry.dialect.name}
th #{chapter.entry.translationEntries[0].name}
th #{chapter.entryVersion.entry.dialect.name}
th #{chapter.entryVersion.translationEntryVersions[0].name}
th
tbody
@@ -33,4 +33,4 @@ block content
else if chunk.translation
a.btn.blue review
else
a.btn.black(href=`/translate/${chapter.entry.translationEntries[0].id}/chapter/${chapter.id}/t/${chunk.index}`) translate
a.btn.black(href=`/translate/${chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chapter.id}/t/${chunk.index}`) translate

View File

@@ -3,10 +3,10 @@ extend templates/layout.pug
block content
.container
.center
h1 Translate into #{chunk.chapter.entry.translationEntries[0].name}
h1 Translate into #{chunk.chapter.entryVersion.translationEntryVersions[0].name}
//- TODO: Show previous...
form.row(action=`/translate/${chunk.chapter.entry.translationEntries[0].id}/chapter/${chunk.chapter.id}/t/${chunk.id}`)
form.row(action=`/translate/${chunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chunk.chapter.id}/t/${chunk.id}`)
.col.s12.m6.input-field
textarea#original-text.materialize-textarea(name="originalText")= chunk.text
label(for="original-text") Original Text
@@ -30,7 +30,7 @@ block content
//- thead
tr
th #{chunk.chapter.entry.dialect.name}
th #{chunk.chapter.entry.translationEntries[0].name}
th #{chunk.chapter.entry.translationEntryVersions[0].name}
th
tbody
tr
@@ -48,7 +48,7 @@ block content
else if previousChunk.translation
a.btn.blue review
else
a.btn.black(href=`/translate/${previousChunk.chapter.entry.translationEntries[0].id}/chapter/${previousChunk.chapter.id}/t/${previousChunk.index}`) previous translation
a.btn.black(href=`/translate/${previousChunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${previousChunk.chapter.id}/t/${previousChunk.index}`) previous translation
if nextChunk
.col.s12#next-translation
@@ -56,7 +56,7 @@ block content
//- thead
tr
th #{chunk.chapter.entry.dialect.name}
th #{chunk.chapter.entry.translationEntries[0].name}
th #{chunk.chapter.entry.translationEntryVersions[0].name}
th
tbody
tr
@@ -74,7 +74,7 @@ block content
else if nextChunk.translation
a.btn.blue review
else
a.btn.black(href=`/translate/${nextChunk.chapter.entry.translationEntries[0].id}/chapter/${nextChunk.chapter.id}/t/${nextChunk.index}`) next translation
a.btn.black(href=`/translate/${nextChunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${nextChunk.chapter.id}/t/${nextChunk.index}`) next translation
block additionalScripts

View File

@@ -0,0 +1,9 @@
extend templates/layout.pug
block content
.container
.center
h1= translationEntryVersion.name
h2= translationEntryVersion.entryVersion.entry.name
a.btn.black(href=`/translate/${translationEntryVersion.id}`) Translate

View File

@@ -1,9 +0,0 @@
extend templates/layout.pug
block content
.container
.center
h1= translationEntry.name
h2= translationEntry.entry.name
a.btn.black(href=`/translate/${translationEntry.id}`) Translate

View File

@@ -3,15 +3,15 @@ extend templates/layout.pug
block content
.container
.center
h1 Translation of #{entry.name}
h1 Translation of #{entryVersion.name}
.row
.col.s12
form.row(action=`/library/${entry.id}/translations/add`, method="post")
form.row(action=`/v/${entryVersion.id}/translations/add`, method="post")
.col.s12.input-field
i.material-icons.prefix record_voice_over
input#dialect-autocomplete.autocomplete(type="text", name="dialect", required)
input#dialect-autocomplete.autocomplete(type="text", name="dialect", required, autocomplete="off")
label(for="dialect-autocomplete") Dialect which this translation will be made in.
.col.s12
button.btn.black(type="submit") add translation