Replace entry with artifact and add entity
This commit is contained in:
41
server/views/artifact-version.pug
Normal file
41
server/views/artifact-version.pug
Normal file
@@ -0,0 +1,41 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 #{artifactVersion.artifact.name}
|
||||
h2 #{artifactVersion.tag}
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/fork/e/${artifactVersion.id}`) fork
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/v/${artifactVersion.id}/campaign/create`) funding campaign
|
||||
.divider
|
||||
.row
|
||||
a.btn.black(href=`/v/${artifactVersion.id}/chapters/add`) add chapter
|
||||
|
||||
if artifactVersion.chapters.length == 0
|
||||
p.flow-text No chapters added
|
||||
else
|
||||
.row
|
||||
each chapter in artifactVersion.chapters
|
||||
.col.s12
|
||||
a(href=`/v/${artifactVersion.id}/chapters/${chapter.id}`)
|
||||
.card-panel
|
||||
p.flow-text= chapter.name
|
||||
|
||||
.divider
|
||||
.row
|
||||
a.btn.black(href=`/v/${artifactVersion.id}/translations/add`) add translation
|
||||
|
||||
if artifactVersion.translationArtifactVersions.length == 0
|
||||
p.flow-text No chapters added
|
||||
else
|
||||
.row
|
||||
each translationArtifact in artifactVersion.translationArtifactVersions
|
||||
.col.s12
|
||||
a(href=`/v/${artifactVersion.id}/translations/${translationArtifact.id}`)
|
||||
.card-panel
|
||||
p.flow-text= translationArtifact.name
|
||||
20
server/views/artifact.pug
Normal file
20
server/views/artifact.pug
Normal file
@@ -0,0 +1,20 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1= artifact.name
|
||||
|
||||
.divider
|
||||
.row
|
||||
a.btn.black(href=`/library/${artifact.id}/version/add`) add version
|
||||
|
||||
if artifact.artifactVersions.length == 0
|
||||
p.flow-text No available versions
|
||||
else
|
||||
.row
|
||||
each artifactVersion in artifact.artifactVersions
|
||||
.col.s12
|
||||
a(href=`/library/${artifactVersion.artifactId}/v/${artifactVersion.id}`)
|
||||
.card-panel
|
||||
p.flow-text= artifactVersion.tag
|
||||
@@ -16,11 +16,11 @@ block content
|
||||
.col.s12.input-field
|
||||
input(id=project.id+"-satoshis",type="number", name="satoshis", placeholder="100000 satoshis", step=1, min=1, max=2100000000000000, required)
|
||||
label(for=project.id+"-satoshis") Default satoshi's goal for the #{project.name} translations
|
||||
if translationEntryVersions
|
||||
each translationEntryVersion in translationEntryVersions
|
||||
input(type="hidden", name="translationEntryVersions", value=translationEntryVersion.id)
|
||||
if translationArtifactVersions
|
||||
each translationArtifactVersion in translationArtifactVersions
|
||||
input(type="hidden", name="translationArtifactVersions", value=translationArtifactVersion.id)
|
||||
.col.s12.input-field
|
||||
input(id=translationEntryVersion.id+"-satoshis",type="number", name="satoshis", placeholder="100000 satoshis", step=1, min=1, max=2100000000000000, required)
|
||||
label(for=translationEntryVersion.id+"-satoshis") Satoshi's required for the #{translationEntryVersion.name} translation
|
||||
input(id=translationArtifactVersion.id+"-satoshis",type="number", name="satoshis", placeholder="100000 satoshis", step=1, min=1, max=2100000000000000, required)
|
||||
label(for=translationArtifactVersion.id+"-satoshis") Satoshi's required for the #{translationArtifactVersion.name} translation
|
||||
.col.s12
|
||||
button.btn.black(type="submit") create campaign
|
||||
@@ -3,16 +3,16 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 Chapter in #{entryVersion.name}
|
||||
h1 Chapter in #{artifactVersion.name}
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
form.row(action=`/v/${entryVersion.id}/chapters/add`, method="post")
|
||||
form.row(action=`/v/${artifactVersion.id}/chapters/add`, method="post")
|
||||
.col.s12.input-field
|
||||
textarea#textarea.materialize-textarea(name="text")
|
||||
label(for="textarea") Entire chapter text (markdown)
|
||||
.col.s12.input-field
|
||||
input#index(type="number", name="index", value=entryVersion.chapters.length+1)
|
||||
input#index(type="number", name="index", value=artifactVersion.chapters.length+1)
|
||||
label(for="index") Chapter Number
|
||||
.col.s12
|
||||
button.btn.black(type="submit") add chapter
|
||||
@@ -6,7 +6,7 @@ block content
|
||||
|
||||
//- h1= chapter.name
|
||||
|
||||
a.btn.black(href=`/v/${chapter.entryVersionId}`) go to entry
|
||||
a.btn.black(href=`/v/${chapter.artifactVersionId}`) go to artifact
|
||||
|
||||
.row
|
||||
each chunk in chapter.chunks
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 #{entryVersion.entry.name}
|
||||
h2 #{entryVersion.tag}
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/fork/e/${entryVersion.id}`) fork
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/v/${entryVersion.id}/campaign/create`) funding campaign
|
||||
.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
|
||||
@@ -1,20 +0,0 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1= entry.name
|
||||
|
||||
.divider
|
||||
.row
|
||||
a.btn.black(href=`/library/${entry.id}/version/add`) add version
|
||||
|
||||
if entry.entryVersions.length == 0
|
||||
p.flow-text No available versions
|
||||
else
|
||||
.row
|
||||
each entryVersion in entry.entryVersions
|
||||
.col.s12
|
||||
a(href=`/library/${entryVersion.entryId}/v/${entryVersion.id}`)
|
||||
.card-panel
|
||||
p.flow-text= entryVersion.tag
|
||||
@@ -3,11 +3,11 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 Fork of #{entryVersion.entry.name}
|
||||
h1 Fork of #{artifactVersion.artifact.name}
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
form.row(action=`/fork/e/${entryVersion.id}`, method="post")
|
||||
form.row(action=`/fork/e/${artifactVersion.id}`, method="post")
|
||||
|
||||
.col.s12.input-field
|
||||
i.material-icons.prefix record_voice_over
|
||||
@@ -9,14 +9,14 @@ block content
|
||||
.col.s12
|
||||
form.row(action="/library/add", method="post")
|
||||
.col.s12.input-field
|
||||
input#name(type="text", name="name", value=entry.name)
|
||||
label(for="name") Entry Name
|
||||
input#name(type="text", name="name", value=artifact.name)
|
||||
label(for="name") Artifact Name
|
||||
.col.s12.input-field
|
||||
input#url(type="text", name="url", value=entry.url)
|
||||
label(for="url") Entry Url
|
||||
if entry.id == null
|
||||
input#url(type="text", name="url", value=artifact.url)
|
||||
label(for="url") Artifact Url
|
||||
if artifact.id == null
|
||||
.col.s12.input-field
|
||||
input#version(type="text", name="version", value=entry.version)
|
||||
input#version(type="text", name="version", value=artifact.version)
|
||||
label(for="version") First Version Number
|
||||
.col.s12
|
||||
button.btn.black(type="submit") add entry
|
||||
button.btn.black(type="submit") add artifact
|
||||
@@ -5,13 +5,13 @@ block content
|
||||
.center
|
||||
h1 Library
|
||||
|
||||
a.btn.black(href="/library/add") add entry
|
||||
a.btn.black(href="/library/add") add artifact
|
||||
if entries.length == 0
|
||||
p.flow-text No Literature currently on the system
|
||||
else
|
||||
.row
|
||||
each entry in entries
|
||||
each artifact in entries
|
||||
.col.s12
|
||||
a(href=`/library/${entry.id}`)
|
||||
a(href=`/library/${artifact.id}`)
|
||||
.card-panel
|
||||
p.flow-text= entry.name
|
||||
p.flow-text= artifact.name
|
||||
@@ -3,7 +3,7 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 Add Entry to Project
|
||||
h1 Add Artifact to Project
|
||||
|
||||
table
|
||||
thead
|
||||
@@ -12,11 +12,11 @@ block content
|
||||
th Version
|
||||
th
|
||||
tbody
|
||||
each entry in entries
|
||||
each artifact in entries
|
||||
tr
|
||||
td= entry.name
|
||||
td= entry.entryVersions[0].tag
|
||||
td= artifact.name
|
||||
td= artifact.artifactVersions[0].tag
|
||||
td
|
||||
form(action=`/projects/${project.id}/add-entry`, method="post")
|
||||
input(type="hidden", name="entryVersionId", value=entry.entryVersions[0].id)
|
||||
form(action=`/projects/${project.id}/add-artifact`, method="post")
|
||||
input(type="hidden", name="artifactVersionId", value=artifact.artifactVersions[0].id)
|
||||
button.btn.black(type="submit") add to project
|
||||
@@ -12,11 +12,11 @@ block content
|
||||
th Version
|
||||
th
|
||||
tbody
|
||||
each translationEntryVersion in translationEntryVersions
|
||||
each translationArtifactVersion in translationArtifactVersions
|
||||
tr
|
||||
td #{translationEntryVersion.entryVersion.entry.name} - #{translationEntryVersion.name}
|
||||
td= translationEntryVersion.entryVersion.tag
|
||||
td #{translationArtifactVersion.artifactVersion.artifact.name} - #{translationArtifactVersion.name}
|
||||
td= translationArtifactVersion.artifactVersion.tag
|
||||
td
|
||||
form(action=`/projects/${project.id}/add-translation`, method="post")
|
||||
input(type="hidden", name="translationEntryVersionId", value=translationEntryVersion.id)
|
||||
input(type="hidden", name="translationArtifactVersionId", value=translationArtifactVersion.id)
|
||||
button.btn.black(type="submit") add to project
|
||||
@@ -17,17 +17,17 @@ block content
|
||||
|
||||
.divider
|
||||
h2 Entries
|
||||
each projectEntryVersion in project.projectEntryVersions
|
||||
p.flow-text= projectEntryVersion.entryVersion.entry.name
|
||||
each projectArtifactVersion in project.projectArtifactVersions
|
||||
p.flow-text= projectArtifactVersion.artifactVersion.artifact.name
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/projects/${project.id}/add-entry`) add from library
|
||||
a.btn.black(href=`/projects/${project.id}/add-artifact`) add from library
|
||||
.divider
|
||||
h2 Translation
|
||||
each projectTranslationEntryVersion in project.projectTranslationEntryVersions
|
||||
p.flow-text #{projectTranslationEntryVersion.translationEntryVersion.name} - #{projectTranslationEntryVersion.translationEntryVersion.entryVersion.entry.name}
|
||||
each projectTranslationArtifactVersion in project.projectTranslationArtifactVersions
|
||||
p.flow-text #{projectTranslationArtifactVersion.translationArtifactVersion.name} - #{projectTranslationArtifactVersion.translationArtifactVersion.artifactVersion.artifact.name}
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/projects/${project.id}/add-translation`) add translation
|
||||
//- TODO: Show project translation entry versions
|
||||
//- TODO: Show project entry versions
|
||||
//- TODO: Show project translation artifact versions
|
||||
//- TODO: Show project artifact versions
|
||||
@@ -3,8 +3,8 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1= chapter.entryVersion.translationEntryVersions[0].name
|
||||
h2= chapter.entryVersion.entry.name
|
||||
h1= chapter.artifactVersion.translationArtifactVersions[0].name
|
||||
h2= chapter.artifactVersion.artifact.name
|
||||
|
||||
//- TODO: List chunks in the chapter
|
||||
.row
|
||||
@@ -12,8 +12,8 @@ block content
|
||||
table
|
||||
thead
|
||||
tr
|
||||
th #{chapter.entryVersion.entry.dialect.name}
|
||||
th #{chapter.entryVersion.translationEntryVersions[0].name}
|
||||
th #{chapter.artifactVersion.artifact.dialect.name}
|
||||
th #{chapter.artifactVersion.translationArtifactVersions[0].name}
|
||||
th
|
||||
|
||||
tbody
|
||||
@@ -31,6 +31,6 @@ block content
|
||||
if chunk.translated
|
||||
span nothing
|
||||
else if chunk.translation
|
||||
a.btn.blue(href=`/translate/${chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chapter.id}/t/${chunk.index}`) edit
|
||||
a.btn.blue(href=`/translate/${chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${chapter.id}/t/${chunk.index}`) edit
|
||||
else
|
||||
a.btn.black(href=`/translate/${chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chapter.id}/t/${chunk.index}`) translate
|
||||
a.btn.black(href=`/translate/${chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${chapter.id}/t/${chunk.index}`) translate
|
||||
@@ -4,10 +4,10 @@ block content
|
||||
.container
|
||||
.center
|
||||
h1 Translate into
|
||||
a(href=`/translate/${chunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chunk.chapter.id}`) #{chunk.chapter.entryVersion.translationEntryVersions[0].name}
|
||||
a(href=`/translate/${chunk.chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${chunk.chapter.id}`) #{chunk.chapter.artifactVersion.translationArtifactVersions[0].name}
|
||||
|
||||
//- TODO: Show previous...
|
||||
form.row(action=`/translate/${chunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chunk.chapter.id}/t/${chunk.index}`, method="post")
|
||||
form.row(action=`/translate/${chunk.chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${chunk.chapter.id}/t/${chunk.index}`, method="post")
|
||||
.col.s12.m6.input-field
|
||||
textarea#original-text.materialize-textarea(name="originalText", readonly)= chunk.text
|
||||
label(for="original-text") Original Text
|
||||
@@ -33,8 +33,8 @@ block content
|
||||
table
|
||||
//- thead
|
||||
tr
|
||||
th #{chunk.chapter.entry.dialect.name}
|
||||
th #{chunk.chapter.entry.translationEntryVersions[0].name}
|
||||
th #{chunk.chapter.artifact.dialect.name}
|
||||
th #{chunk.chapter.artifact.translationArtifactVersions[0].name}
|
||||
th
|
||||
tbody
|
||||
tr
|
||||
@@ -50,17 +50,17 @@ block content
|
||||
if previousChunk.translated
|
||||
span nothing
|
||||
else if previousChunk.translation
|
||||
a.btn.blue(href=`/translate/${previousChunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${previousChunk.chapter.id}/t/${previousChunk.index}`) edit
|
||||
a.btn.blue(href=`/translate/${previousChunk.chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${previousChunk.chapter.id}/t/${previousChunk.index}`) edit
|
||||
else
|
||||
a.btn.black(href=`/translate/${previousChunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${previousChunk.chapter.id}/t/${previousChunk.index}`) previous translation
|
||||
a.btn.black(href=`/translate/${previousChunk.chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${previousChunk.chapter.id}/t/${previousChunk.index}`) previous translation
|
||||
|
||||
if nextChunk
|
||||
.col.s12#next-translation
|
||||
table
|
||||
//- thead
|
||||
tr
|
||||
th #{chunk.chapter.entry.dialect.name}
|
||||
th #{chunk.chapter.entry.translationEntryVersions[0].name}
|
||||
th #{chunk.chapter.artifact.dialect.name}
|
||||
th #{chunk.chapter.artifact.translationArtifactVersions[0].name}
|
||||
th
|
||||
tbody
|
||||
tr
|
||||
@@ -76,9 +76,9 @@ block content
|
||||
if nextChunk.translated
|
||||
span nothing
|
||||
else if nextChunk.translation
|
||||
a.btn.blue(href=`/translate/${nextChunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${nextChunk.chapter.id}/t/${nextChunk.index}`) edit
|
||||
a.btn.blue(href=`/translate/${nextChunk.chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${nextChunk.chapter.id}/t/${nextChunk.index}`) edit
|
||||
else
|
||||
a.btn.black(href=`/translate/${nextChunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${nextChunk.chapter.id}/t/${nextChunk.index}`) next translation
|
||||
a.btn.black(href=`/translate/${nextChunk.chapter.artifactVersion.translationArtifactVersions[0].id}/chapter/${nextChunk.chapter.id}/t/${nextChunk.index}`) next translation
|
||||
|
||||
|
||||
block additionalScripts
|
||||
|
||||
32
server/views/translation-artifact-version.pug
Normal file
32
server/views/translation-artifact-version.pug
Normal file
@@ -0,0 +1,32 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1= translationArtifactVersion.name
|
||||
h2= translationArtifactVersion.artifactVersion.artifact.name
|
||||
|
||||
if translationArtifactVersion.forkedFrom
|
||||
p.flow-text is a
|
||||
a(href=`/v/${translationArtifactVersion.forkedFrom.artifactVersionId}/translations/${translationArtifactVersion.forkedFrom.id}`) fork
|
||||
|
||||
//- TODO: Condition to show translate button
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/translate/${translationArtifactVersion.id}`) Translate
|
||||
//- TODO: Condition to show fork button
|
||||
.row
|
||||
.col.s12
|
||||
form(action=`/fork/t/${translationArtifactVersion.id}`, method="post")
|
||||
button.btn.black(type="submit") fork
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
form(action=`/translate/${translationArtifactVersion.id}/back`, method="post")
|
||||
button.btn.black(type="submit") back translate
|
||||
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/translate/${translationArtifactVersion.id}/campaign`) funding campaign
|
||||
//- TODO: Give summary of chapters...
|
||||
@@ -1,32 +0,0 @@
|
||||
extend templates/layout.pug
|
||||
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1= translationEntryVersion.name
|
||||
h2= translationEntryVersion.entryVersion.entry.name
|
||||
|
||||
if translationEntryVersion.forkedFrom
|
||||
p.flow-text is a
|
||||
a(href=`/v/${translationEntryVersion.forkedFrom.entryVersionId}/translations/${translationEntryVersion.forkedFrom.id}`) fork
|
||||
|
||||
//- TODO: Condition to show translate button
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/translate/${translationEntryVersion.id}`) Translate
|
||||
//- TODO: Condition to show fork button
|
||||
.row
|
||||
.col.s12
|
||||
form(action=`/fork/t/${translationEntryVersion.id}`, method="post")
|
||||
button.btn.black(type="submit") fork
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
form(action=`/translate/${translationEntryVersion.id}/back`, method="post")
|
||||
button.btn.black(type="submit") back translate
|
||||
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/translate/${translationEntryVersion.id}/campaign`) funding campaign
|
||||
//- TODO: Give summary of chapters...
|
||||
@@ -3,11 +3,11 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.center
|
||||
h1 Translation of #{entryVersion.name}
|
||||
h1 Translation of #{artifactVersion.name}
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
form.row(action=`/v/${entryVersion.id}/translations/add`, method="post")
|
||||
form.row(action=`/v/${artifactVersion.id}/translations/add`, method="post")
|
||||
|
||||
.col.s12.input-field
|
||||
i.material-icons.prefix record_voice_over
|
||||
|
||||
Reference in New Issue
Block a user