Files
mantra.press/server/views/project-tracker.pug

93 lines
4.9 KiB
Plaintext
Raw Normal View History

2022-02-18 01:28:23 +02:00
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
2022-06-19 03:38:27 +02:00
p.flow-text
-
const wordCount = translationChapters.reduce((totalWordCount, translationChapter) => totalWordCount+translationChapter.chapter.wordCount, 0)
span.chip #{wordCount.toLocaleString()} words
2022-02-18 01:28:23 +02:00
if isOwnedByUser
.row
.col.s12
2022-12-04 12:55:53 +02:00
a.btn.black(href=`/projects/${project.id}/trail`) audit trail
2022-02-18 01:28:23 +02:00
2022-06-22 04:16:01 +02:00
.row
.col.s12
form(action=urlEndpoint, method="get")
input(type="hidden", name="sheets", value="true")
each val, key in query
if key != "sheets"
input(type="hidden", name=key, value=val)
2023-01-06 02:34:01 +02:00
button.btn.black(type="submit")
i.material-icons.left file_download
span export to spreadsheets
.row
.col.s12
a.btn.black(href=`/projects/${project.id}/import`)
i.material-icons.left file_upload
span import spreadsheets
.row
.col.s12
a.btn.black(href=`/projects/${project.id}/languages/add`)
i.material-icons.left record_voice_over
span add language
2022-02-18 01:28:23 +02:00
.divider
2022-06-19 03:38:27 +02:00
table.highlight
2022-02-18 01:28:23 +02:00
thead
tr
2022-06-19 22:12:45 +02:00
th
p
label
input#overview-checkbox(type="checkbox")
span
2022-06-19 23:31:16 +02:00
th Name
2022-06-19 22:12:45 +02:00
th
a.dropdown-trigger language (#{project.get("languageCount")}) ▼
2022-02-18 01:28:23 +02:00
th Artifact
th Chapter
2022-06-19 22:12:45 +02:00
th
a.dropdown-trigger translator ▼
th
a.dropdown-trigger proof reader ▼
th
a.dropdown-trigger editor ▼
2022-02-18 01:28:23 +02:00
tbody
each translationChapter in translationChapters.sort((a, b) => a.index - b.index)
2022-06-22 02:25:56 +02:00
-
const onclickResponse = `window.location='/translate/${translationChapter.translationArtifactVersion.id}/chapter/${translationChapter.id}'`
tr
2022-06-19 03:38:27 +02:00
//- TODO: link to the translationChapter...
2022-06-19 22:12:45 +02:00
td
p
label
2022-06-22 02:25:56 +02:00
//- TODO: Make this a issueId...
input(name="selectedTranslationChapters", type="checkbox", value=translationChapter.id)
2022-06-19 22:12:45 +02:00
span
2022-06-22 02:25:56 +02:00
td(onclick=onclickResponse)
span.truncate(title=translationChapter.chapter.name)= translationChapter.chapter.name
td(onclick=onclickResponse)
2022-12-04 12:55:53 +02:00
a(href=`/projects/${project.id}?dialectId=${translationChapter.translationArtifactVersion.dialect.id}`)= translationChapter.translationArtifactVersion.dialect.name
2022-06-22 02:25:56 +02:00
-
const artifactName = `${translationChapter.translationArtifactVersion.artifactVersion.artifact.name} - ${translationChapter.translationArtifactVersion.artifactVersion.tag}`
td(onclick=onclickResponse)
span.truncate(title=artifactName)= artifactName
td(onclick=onclickResponse)= translationChapter.index
td(onclick=onclickResponse)
each translationChapterTranslator in translationChapter.translationChapterTranslators
2022-12-04 12:55:53 +02:00
a(href=`/projects/${project.id}?translatorId=${translationChapterTranslator.translatorId}`)
2022-06-22 02:55:31 +02:00
span.initial-icon(style=`background: ${stringToColour(translationChapterTranslator.translatorId)};`, title=translatorDisplayName(translationChapterTranslator))= translatorDisplayName(translationChapterTranslator).split(" ").map(l => l.at(0)).join("")
2022-06-22 02:25:56 +02:00
td(onclick=onclickResponse)
td(onclick=onclickResponse)