2022-01-05 03:04:43 +02:00
|
|
|
extend templates/layout.pug
|
|
|
|
|
|
|
|
|
|
block content
|
2022-01-09 01:44:02 +02:00
|
|
|
-
|
|
|
|
|
const isOwnedByUser = artifactVersion.artifact.owner.ownerEntities.some(ownerEntity => {
|
|
|
|
|
return ownerEntity.entity.entityUsers.some(entityUser => {
|
|
|
|
|
return entityUser.userId == user?.id
|
|
|
|
|
})
|
|
|
|
|
})
|
2022-01-05 03:04:43 +02:00
|
|
|
.container
|
|
|
|
|
.center
|
|
|
|
|
h1 #{artifactVersion.artifact.name}
|
2022-06-17 22:55:52 +02:00
|
|
|
if artifactVersion.artifact.visibility == "private"
|
2022-01-15 00:59:30 +02:00
|
|
|
i.right.medium.material-icons lock
|
|
|
|
|
|
2022-01-05 03:04:43 +02:00
|
|
|
h2 #{artifactVersion.tag}
|
2022-01-09 01:44:02 +02:00
|
|
|
p.flow-text
|
|
|
|
|
each ownerEntity, index in artifactVersion.artifact.owner.ownerEntities
|
|
|
|
|
small
|
|
|
|
|
if index > 0
|
|
|
|
|
span and
|
|
|
|
|
span.chip #{ownerEntity.entity.name}
|
|
|
|
|
if !isOwnedByUser
|
|
|
|
|
.row
|
|
|
|
|
.col.s12
|
|
|
|
|
a.btn.black(href=`/fork/e/${artifactVersion.id}`) fork
|
2022-01-06 19:44:39 +02:00
|
|
|
//- .row
|
2022-01-05 03:04:43 +02:00
|
|
|
.col.s12
|
|
|
|
|
a.btn.black(href=`/v/${artifactVersion.id}/campaign/create`) funding campaign
|
|
|
|
|
|
2022-01-16 04:10:24 +02:00
|
|
|
.row
|
|
|
|
|
.col.s12
|
|
|
|
|
if artifactVersion.artifactVersionApproval
|
|
|
|
|
p.flow-text Approval:
|
|
|
|
|
a(href=`/v/${artifactVersion.id}/approval`) #{artifactVersion.artifactVersionApproval.name}
|
|
|
|
|
else
|
|
|
|
|
p.flow-text No digital rights approval information has been provided for this content.
|
|
|
|
|
if isOwnedByUser
|
|
|
|
|
a.btn.black(href=`/v/${artifactVersion.id}/approval/add`) add approval information
|
2022-01-09 01:44:02 +02:00
|
|
|
|
|
|
|
|
if isOwnedByUser
|
|
|
|
|
.divider
|
2022-06-19 03:00:48 +02:00
|
|
|
.row
|
|
|
|
|
.col.s12
|
|
|
|
|
p.flow-text
|
|
|
|
|
-
|
|
|
|
|
const wordCount = artifactVersion.chapters.reduce((totalWordCount, chapter) => totalWordCount+chapter.wordCount, 0)
|
|
|
|
|
span.chip #{wordCount.toLocaleString()} words
|
2022-01-09 01:44:02 +02:00
|
|
|
.row
|
2022-06-19 02:17:55 +02:00
|
|
|
.col.s12
|
|
|
|
|
a.btn.black(href=`/v/${artifactVersion.id}/chapters/add`) add chapter
|
|
|
|
|
.col.s12
|
|
|
|
|
a.btn.black(href=`/v/${artifactVersion.id}/chapters/upload`) upload chapter(s)
|
2022-01-09 01:44:02 +02:00
|
|
|
|
|
|
|
|
if artifactVersion.chapters.length == 0
|
|
|
|
|
p.flow-text No chapters added
|
|
|
|
|
else
|
|
|
|
|
.row
|
2022-01-15 00:59:30 +02:00
|
|
|
each chapter in artifactVersion.chapters.sort((a, b) => a.index - b.index)
|
2022-01-09 01:44:02 +02:00
|
|
|
.col.s12
|
|
|
|
|
a(href=`/v/${artifactVersion.id}/chapters/${chapter.id}`)
|
|
|
|
|
.card-panel
|
|
|
|
|
p.flow-text= chapter.name
|
2022-01-05 03:04:43 +02:00
|
|
|
|
|
|
|
|
.divider
|
|
|
|
|
.row
|
2022-01-09 01:44:02 +02:00
|
|
|
|
|
|
|
|
if isOwnedByUser
|
|
|
|
|
a.btn.black(href=`/v/${artifactVersion.id}/translations/add`) add translation
|
2022-01-05 03:04:43 +02:00
|
|
|
|
|
|
|
|
if artifactVersion.translationArtifactVersions.length == 0
|
2022-01-08 00:59:36 +02:00
|
|
|
p.flow-text No translations added
|
2022-01-05 03:04:43 +02:00
|
|
|
else
|
|
|
|
|
.row
|
|
|
|
|
each translationArtifact in artifactVersion.translationArtifactVersions
|
|
|
|
|
.col.s12
|
2022-01-09 02:33:41 +02:00
|
|
|
a(href=`/translate/${translationArtifact.id}`)
|
2022-01-05 03:04:43 +02:00
|
|
|
.card-panel
|
|
|
|
|
p.flow-text= translationArtifact.name
|