Some UX rework...
This commit is contained in:
@@ -130,13 +130,18 @@ module.exports = function (options) {
|
|||||||
}).then(chunks => {
|
}).then(chunks => {
|
||||||
if (chunks.length > 0) {
|
if (chunks.length > 0) {
|
||||||
const chunk = chunks.find(chunk => chunk.index == Number(request.params.chunkIndex))
|
const chunk = chunks.find(chunk => chunk.index == Number(request.params.chunkIndex))
|
||||||
response.display("translate-chunk", {
|
if (chunk) {
|
||||||
user: request.user,
|
response.display("translate-chunk", {
|
||||||
pageTitle: `Translate ${chunk.chapter.entryVersion.entry.name}`,
|
user: request.user,
|
||||||
chunk: chunk,
|
pageTitle: `Translate ${chunk.chapter.entryVersion.entry.name}`,
|
||||||
previousChunk: chunks.find(chunk => chunk.index == previousIndex),
|
chunk: chunk,
|
||||||
nextChunk: chunks.find(chunk => chunk.index == nextIndex)
|
previousChunk: chunks.find(chunk => chunk.index == previousIndex),
|
||||||
})
|
nextChunk: chunks.find(chunk => chunk.index == nextIndex)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
response.redirect(`/translate/${request.params.id}/chapter/${request.params.chapterId}`)
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
@@ -194,7 +199,7 @@ module.exports = function (options) {
|
|||||||
translationEntryVersionId: request.params.id
|
translationEntryVersionId: request.params.id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
response.redirect(`/translate/${request.params.id}/chapter/${request.params.chapterId}/t/${request.params.chunkIndex}`)
|
response.redirect(`/translate/${request.params.id}/chapter/${request.params.chapterId}/t/${Number(request.params.chunkIndex)+1}`)
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ extend templates/layout.pug
|
|||||||
block content
|
block content
|
||||||
.container
|
.container
|
||||||
.center
|
.center
|
||||||
h1 Translate into #{chunk.chapter.entryVersion.translationEntryVersions[0].name}
|
h1 Translate into
|
||||||
|
a(href=`/translate/${chunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chunk.chapter.id}`) #{chunk.chapter.entryVersion.translationEntryVersions[0].name}
|
||||||
|
|
||||||
//- TODO: Show previous...
|
//- TODO: Show previous...
|
||||||
form.row(action=`/translate/${chunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chunk.chapter.id}/t/${chunk.index}`, method="post")
|
form.row(action=`/translate/${chunk.chapter.entryVersion.translationEntryVersions[0].id}/chapter/${chunk.chapter.id}/t/${chunk.index}`, method="post")
|
||||||
|
|||||||
Reference in New Issue
Block a user