Some UX rework...
This commit is contained in:
@@ -130,13 +130,18 @@ module.exports = function (options) {
|
||||
}).then(chunks => {
|
||||
if (chunks.length > 0) {
|
||||
const chunk = chunks.find(chunk => chunk.index == Number(request.params.chunkIndex))
|
||||
response.display("translate-chunk", {
|
||||
user: request.user,
|
||||
pageTitle: `Translate ${chunk.chapter.entryVersion.entry.name}`,
|
||||
chunk: chunk,
|
||||
previousChunk: chunks.find(chunk => chunk.index == previousIndex),
|
||||
nextChunk: chunks.find(chunk => chunk.index == nextIndex)
|
||||
})
|
||||
if (chunk) {
|
||||
response.display("translate-chunk", {
|
||||
user: request.user,
|
||||
pageTitle: `Translate ${chunk.chapter.entryVersion.entry.name}`,
|
||||
chunk: chunk,
|
||||
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 {
|
||||
next()
|
||||
}
|
||||
@@ -194,7 +199,7 @@ module.exports = function (options) {
|
||||
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 {
|
||||
next()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ extend templates/layout.pug
|
||||
block content
|
||||
.container
|
||||
.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...
|
||||
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