Move route to translate page
This commit is contained in:
@@ -248,100 +248,6 @@ module.exports = function (options) {
|
||||
})
|
||||
})
|
||||
|
||||
router.route('/:id/translations/:translationArtifactVersionId')
|
||||
.get(function(request, response, next) {
|
||||
db.TranslationArtifactVersion.findByPk(request.params.translationArtifactVersionId, {
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationArtifactVersion.ArtifactVersion,
|
||||
include: [
|
||||
{
|
||||
association: db.ArtifactVersion.Artifact,
|
||||
include: [
|
||||
{
|
||||
association: db.Artifact.Owner,
|
||||
// required: false,
|
||||
include: [
|
||||
{
|
||||
association: db.Owner.OwnerEntities,
|
||||
// required: true,
|
||||
include: [
|
||||
{
|
||||
association: db.OwnerEntity.Entity,
|
||||
// required: false,
|
||||
include: [
|
||||
{
|
||||
association: db.Entity.EntityUsers,
|
||||
required: false,
|
||||
where: {
|
||||
userId: request.user.id
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
association: db.ArtifactVersion.Chapters
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.ForkedFrom
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.TranslationChapters,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationChapter.Chapter
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.Owner,
|
||||
// required: false,
|
||||
include: [
|
||||
{
|
||||
association: db.Owner.OwnerEntities,
|
||||
// required: true,
|
||||
include: [
|
||||
{
|
||||
association: db.OwnerEntity.Entity,
|
||||
// required: false,
|
||||
include: [
|
||||
{
|
||||
association: db.Entity.EntityUsers,
|
||||
required: false,
|
||||
where: {
|
||||
userId: request.user.id
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}).then(translationArtifactVersion => {
|
||||
if (translationArtifactVersion) {
|
||||
response.display("translation-artifact-version", {
|
||||
user: request.user,
|
||||
pageTitle: "Translation Artifact - Mantra",
|
||||
translationArtifactVersion: translationArtifactVersion,
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}).catch(error => {
|
||||
next(error)
|
||||
})
|
||||
})
|
||||
|
||||
router.route('/:id/translations/add')
|
||||
.get(function(request, response, next) {
|
||||
db.ArtifactVersion.findByPk(request.params.id, {
|
||||
@@ -459,7 +365,7 @@ module.exports = function (options) {
|
||||
})
|
||||
|
||||
if (translationArtifactVersion) {
|
||||
return response.redirect(`/v/${artifactVersion.id}/translations/${translationArtifactVersion.id}`)
|
||||
return response.redirect(`/translate/${translationArtifactVersion.id}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user