74 lines
3.2 KiB
Plaintext
74 lines
3.2 KiB
Plaintext
extend templates/layout.pug
|
|
|
|
block content
|
|
-
|
|
const isOwnedByUser = translationArtifactVersion.owner.ownerEntities.some(ownerEntity => {
|
|
return ownerEntity.entity.entityUsers.some(entityUser => {
|
|
return entityUser.userId == user?.id
|
|
})
|
|
})
|
|
const ownerForTranslationIsOwnerForArtifact = false
|
|
|
|
.container
|
|
.center
|
|
h1= translationArtifactVersion.name
|
|
if !ownerForTranslationIsOwnerForArtifact
|
|
p.flow-text
|
|
each ownerEntity, index in translationArtifactVersion.owner.ownerEntities
|
|
small
|
|
if index > 0
|
|
span and
|
|
span.chip #{ownerEntity.entity.name}
|
|
h2= translationArtifactVersion.artifactVersion.artifact.name
|
|
p.flow-text
|
|
each ownerEntity, index in translationArtifactVersion.artifactVersion.artifact.owner.ownerEntities
|
|
small
|
|
if index > 0
|
|
span and
|
|
span.chip #{ownerEntity.entity.name}
|
|
|
|
if translationArtifactVersion.forkedFrom
|
|
p.flow-text is a
|
|
a(href=`/translate/${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
|
|
if !isOwnedByUser
|
|
.row
|
|
.col.s12
|
|
form(action=`/fork/t/${translationArtifactVersion.id}`, method="post")
|
|
button.btn.black(type="submit") fork
|
|
|
|
.row
|
|
.col.s12
|
|
p.flow-text
|
|
a.btn-flat.waves-effect Editor ▼
|
|
if translationArtifactVersion.translationArtifactVersionEditor
|
|
span= translationArtifactVersion.translationArtifactVersionEditor.id
|
|
else
|
|
span No editors assigned yet
|
|
|
|
if isOwnedByUser
|
|
//- TODO: Check required conditions to start back translation...
|
|
.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}/campaigns`) funding campaign
|
|
.row
|
|
.col.s12
|
|
a.btn.black(href=`/translate/${translationArtifactVersion.id}/pledges`) pledge
|
|
//- TODO: Give summary of chapters...
|
|
|
|
h2 Chapters
|
|
each translationChapter in translationArtifactVersion.translationChapters.sort((a,b) => a.index - b.index)
|
|
p.flow-text
|
|
small translate
|
|
br
|
|
a(href=`/translate/${translationArtifactVersion.id}/chapter/${translationChapter.id}`)= translationChapter.chapter.name |