Export spreadsheet
This commit is contained in:
@@ -780,24 +780,24 @@ module.exports = function (options) {
|
||||
association: db.Artifact.Dialect
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
association: db.ArtifactVersion.Chapters,
|
||||
include: [
|
||||
{
|
||||
association: db.Chapter.Chunks,
|
||||
include: [
|
||||
{
|
||||
association: db.Chunk.Translation
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.Dialect
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.TranslationChapters,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationChapter.TranslationChunks,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationChunk.Translation
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}).then(translationArtifactVersions => {
|
||||
@@ -853,14 +853,14 @@ module.exports = function (options) {
|
||||
.string(translationArtifactVersion.id)
|
||||
|
||||
var cellIndex = 6
|
||||
for (const i in translationArtifactVersion.artifactVersion.chapters) {
|
||||
const chapter = translationArtifactVersion.artifactVersion.chapters[i]
|
||||
const chunks = chapter.chunks.sort((a,b) => a.index - b.index)
|
||||
for (const j in chunks) {
|
||||
const chunk = chunks[j]
|
||||
for (const i in translationArtifactVersion.translationChapters) {
|
||||
const translationChapter = translationArtifactVersion.translationChapters[i]
|
||||
const translationChunks = translationChapter.translationChunks.sort((a,b) => a.index - b.index)
|
||||
for (const j in translationChunks) {
|
||||
const translationChunk = translationChunks[j]
|
||||
|
||||
worksheet.cell(cellIndex,2)
|
||||
.string(chunk.text)
|
||||
.string(translationChunk.text)
|
||||
.style({
|
||||
alignment: {
|
||||
wrapText: true,
|
||||
@@ -876,22 +876,22 @@ module.exports = function (options) {
|
||||
}
|
||||
})
|
||||
|
||||
if (chunk.translation) {
|
||||
translationCell.string(chunk.translation.text)
|
||||
if (translationChunk.translation) {
|
||||
translationCell.string(translationChunk.translation.text)
|
||||
}
|
||||
|
||||
const textLength = chunk.text.length
|
||||
const textLength = translationChunk.text.length
|
||||
worksheet.row(cellIndex).setHeight(
|
||||
Math.ceil(Math.max(textLength/cellWidth, 1)*cellHeight)
|
||||
)
|
||||
|
||||
// Meta data...
|
||||
// ID for chunk
|
||||
// ID for translationChunk
|
||||
worksheet.cell(cellIndex,4)
|
||||
.string(chunk.id)
|
||||
.string(translationChunk.id)
|
||||
// ID for translation
|
||||
worksheet.cell(cellIndex,5)
|
||||
.string(chunk.translation?.id ?? "")
|
||||
.string(translationChunk.translation?.id ?? "")
|
||||
|
||||
cellIndex++
|
||||
}
|
||||
|
||||
@@ -13,9 +13,10 @@ block content
|
||||
|
||||
p.flow-text= project.description
|
||||
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/projects/${project.id}/campaign`) funding campaign
|
||||
if isOwnedByUser
|
||||
.row
|
||||
.col.s12
|
||||
a.btn.black(href=`/projects/${project.id}/campaign`) funding campaign
|
||||
.row
|
||||
.col.s12
|
||||
form(action=`/projects/${project.id}/spreadsheet`, method="post")
|
||||
|
||||
Reference in New Issue
Block a user