Files
mantra.press/server/views/project-tracker.pug
2022-06-19 03:41:50 +02:00

48 lines
2.1 KiB
Plaintext

extend templates/layout.pug
block content
-
const isOwnedByUser = project.owner.ownerEntities.some(ownerEntity => {
return ownerEntity.entity.entityUsers.some(entityUser => {
return entityUser.userId == user?.id
})
})
.container
.center
h1= project.name
p.flow-text= project.description
p.flow-text
-
const wordCount = translationChapters.reduce((totalWordCount, translationChapter) => totalWordCount+translationChapter.chapter.wordCount, 0)
span.chip #{wordCount.toLocaleString()} words
if isOwnedByUser
.row
.col.s12
a.btn.black(href=`/projects/${project.id}/tracker/trail`) audit trail
.divider
table.highlight
thead
tr
th Title Text
th language
th Artifact
th Chapter
th translator
th proof reader
th editor
tbody
each translationChapter in translationChapters.sort((a, b) => a.index - b.index)
tr(onclick=`window.location='/projects/${project.id}/tracker/${translationChapter.id}'`)
//- TODO: link to the translationChapter...
td(title=translationChapter.chapter.name)= translationChapter.chapter.name
td
a(href=`/projects/${project.id}/tracker?dialectId=${translationChapter.translationArtifactVersion.dialect.id}`)= translationChapter.translationArtifactVersion.dialect.name
td #{translationChapter.translationArtifactVersion.artifactVersion.artifact.name} - #{translationChapter.translationArtifactVersion.artifactVersion.tag}
td= translationChapter.index
td
td
td