Enforce ownership
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const req = require('express/lib/request');
|
const { Op } = require('sequelize')
|
||||||
|
|
||||||
module.exports = function (options) {
|
module.exports = function (options) {
|
||||||
const db = options.db;
|
const db = options.db;
|
||||||
@@ -7,13 +7,77 @@ module.exports = function (options) {
|
|||||||
|
|
||||||
router.route('/')
|
router.route('/')
|
||||||
.get(function(request, response, next) {
|
.get(function(request, response, next) {
|
||||||
db.Artifact.findAll({
|
Promise.all([
|
||||||
|
db.Artifact.findAll({
|
||||||
}).then(artifacts => {
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Artifact.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
db.TranslationArtifactVersion.findAll({
|
||||||
|
where: {
|
||||||
|
forkedFromId: {
|
||||||
|
[Op.ne]: null,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.TranslationArtifactVersion.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
])
|
||||||
|
.then(results => {
|
||||||
response.display("library", {
|
response.display("library", {
|
||||||
user: request.user,
|
user: request.user,
|
||||||
pageTitle: "Library - Mantra",
|
pageTitle: "Library - Mantra",
|
||||||
artifacts: artifacts
|
artifacts: results[0],
|
||||||
|
translationArtifactVersions: results[1],
|
||||||
})
|
})
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
next(error)
|
next(error)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ module.exports = function (options) {
|
|||||||
]
|
]
|
||||||
}).then(translationArtifactVersion => {
|
}).then(translationArtifactVersion => {
|
||||||
if (translationArtifactVersion) {
|
if (translationArtifactVersion) {
|
||||||
|
// Show translation without artifactVersion
|
||||||
response.redirect(`/translate/${translationArtifactVersion.id}/chapter/${translationArtifactVersion.translationChapters[0].id}`)
|
response.redirect(`/translate/${translationArtifactVersion.id}/chapter/${translationArtifactVersion.translationChapters[0].id}`)
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
@@ -295,6 +296,31 @@ module.exports = function (options) {
|
|||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersion.BackTranslation,
|
association: db.TranslationArtifactVersion.BackTranslation,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
association: db.TranslationArtifactVersion.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}).then((translationArtifactVersion) => {
|
}).then((translationArtifactVersion) => {
|
||||||
if (translationArtifactVersion) {
|
if (translationArtifactVersion) {
|
||||||
@@ -370,25 +396,50 @@ module.exports = function (options) {
|
|||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersion.TranslationArtifactVersionCampaigns,
|
association: db.TranslationArtifactVersion.TranslationArtifactVersionCampaigns,
|
||||||
required: true,
|
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersionCampaign.Campaign,
|
association: db.TranslationArtifactVersionCampaign.Campaign,
|
||||||
required: true
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
association: db.TranslationArtifactVersion.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).then(translationArtifactVersion => {
|
}).then(translationArtifactVersion => {
|
||||||
if (translationArtifactVersion) {
|
if (translationArtifactVersion) {
|
||||||
if (translationArtifactVersion.translationArtifactVersionCampaigns.length == 1) {
|
if (translationArtifactVersion.translationArtifactVersionCampaigns.length == 0) {
|
||||||
|
response.redirect(`/translate/${request.params.id}/campaigns/create`)
|
||||||
|
} else if (translationArtifactVersion.translationArtifactVersionCampaigns.length == 1) {
|
||||||
response.redirect(`/campaigns/${translationArtifactVersion.translationArtifactVersionCampaigns[0].campaignId}`)
|
response.redirect(`/campaigns/${translationArtifactVersion.translationArtifactVersionCampaigns[0].campaignId}`)
|
||||||
} else {
|
} else {
|
||||||
// TODO: Display translation artifact campaign...
|
// TODO: Display translation artifact campaign...
|
||||||
next()
|
next()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
response.redirect(`/translate/${request.params.id}/campaigns/create`)
|
next()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -407,17 +458,41 @@ module.exports = function (options) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersion.TranslationArtifactVersionCampaigns,
|
association: db.TranslationArtifactVersion.TranslationArtifactVersionCampaigns,
|
||||||
required: false,
|
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersionCampaign.Campaign,
|
association: db.TranslationArtifactVersionCampaign.Campaign,
|
||||||
required: false
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
association: db.TranslationArtifactVersion.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}).then(translationArtifactVersion => {
|
}).then(translationArtifactVersion => {
|
||||||
if (translationArtifactVersion) {
|
if (translationArtifactVersion) {
|
||||||
|
// TODO: Check if campaign exits...
|
||||||
response.display("campaign-form", {
|
response.display("campaign-form", {
|
||||||
user: request.user,
|
user: request.user,
|
||||||
pageTitle: "Campaign - Mantra",
|
pageTitle: "Campaign - Mantra",
|
||||||
@@ -446,11 +521,34 @@ module.exports = function (options) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersion.TranslationArtifactVersionCampaigns,
|
association: db.TranslationArtifactVersion.TranslationArtifactVersionCampaigns,
|
||||||
required: false,
|
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.TranslationArtifactVersionCampaign.Campaign,
|
association: db.TranslationArtifactVersionCampaign.Campaign,
|
||||||
required: false
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
association: db.TranslationArtifactVersion.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,35 @@ module.exports = function (options) {
|
|||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.ArtifactVersion.Artifact,
|
association: db.ArtifactVersion.Artifact,
|
||||||
|
// required: true,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.Artifact.ArtifactApproval
|
association: db.Artifact.ArtifactApproval
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -50,9 +76,35 @@ module.exports = function (options) {
|
|||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.ArtifactVersion.Artifact,
|
association: db.ArtifactVersion.Artifact,
|
||||||
|
required: true,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.Artifact.ArtifactApproval
|
association: db.Artifact.ArtifactApproval,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
association: db.Artifact.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -80,9 +132,35 @@ module.exports = function (options) {
|
|||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.ArtifactVersion.Artifact,
|
association: db.ArtifactVersion.Artifact,
|
||||||
|
required: true,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.Artifact.ArtifactApproval
|
association: db.Artifact.ArtifactApproval,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
association: db.Artifact.Owner,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Owner.OwnerEntities,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.OwnerEntity.Entity,
|
||||||
|
required: true,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.Entity.EntityUsers,
|
||||||
|
required: true,
|
||||||
|
where: {
|
||||||
|
userId: request.user.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -178,7 +256,34 @@ module.exports = function (options) {
|
|||||||
association: db.TranslationArtifactVersion.ArtifactVersion,
|
association: db.TranslationArtifactVersion.ArtifactVersion,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
association: db.ArtifactVersion.Artifact
|
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.ArtifactVersion.Chapters
|
||||||
@@ -195,6 +300,31 @@ module.exports = function (options) {
|
|||||||
association: db.TranslationChapter.Chapter
|
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 => {
|
}).then(translationArtifactVersion => {
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ extend templates/layout.pug
|
|||||||
block content
|
block content
|
||||||
.container
|
.container
|
||||||
.center
|
.center
|
||||||
h1 Account
|
h1 Account
|
||||||
|
p.flow-text= user.individualEntityUser.entityUser.entity.name
|
||||||
@@ -1,34 +1,51 @@
|
|||||||
extend templates/layout.pug
|
extend templates/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
-
|
||||||
|
const isOwnedByUser = artifactVersion.artifact.owner.ownerEntities.some(ownerEntity => {
|
||||||
|
return ownerEntity.entity.entityUsers.some(entityUser => {
|
||||||
|
return entityUser.userId == user?.id
|
||||||
|
})
|
||||||
|
})
|
||||||
.container
|
.container
|
||||||
.center
|
.center
|
||||||
h1 #{artifactVersion.artifact.name}
|
h1 #{artifactVersion.artifact.name}
|
||||||
h2 #{artifactVersion.tag}
|
h2 #{artifactVersion.tag}
|
||||||
|
p.flow-text
|
||||||
.row
|
each ownerEntity, index in artifactVersion.artifact.owner.ownerEntities
|
||||||
.col.s12
|
small
|
||||||
a.btn.black(href=`/fork/e/${artifactVersion.id}`) fork
|
if index > 0
|
||||||
|
span and
|
||||||
|
span.chip #{ownerEntity.entity.name}
|
||||||
|
if !isOwnedByUser
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
a.btn.black(href=`/fork/e/${artifactVersion.id}`) fork
|
||||||
//- .row
|
//- .row
|
||||||
.col.s12
|
.col.s12
|
||||||
a.btn.black(href=`/v/${artifactVersion.id}/campaign/create`) funding campaign
|
a.btn.black(href=`/v/${artifactVersion.id}/campaign/create`) funding campaign
|
||||||
.divider
|
|
||||||
.row
|
|
||||||
a.btn.black(href=`/v/${artifactVersion.id}/chapters/add`) add chapter
|
|
||||||
|
|
||||||
if artifactVersion.chapters.length == 0
|
|
||||||
p.flow-text No chapters added
|
if isOwnedByUser
|
||||||
else
|
.divider
|
||||||
.row
|
.row
|
||||||
each chapter in artifactVersion.chapters
|
a.btn.black(href=`/v/${artifactVersion.id}/chapters/add`) add chapter
|
||||||
.col.s12
|
|
||||||
a(href=`/v/${artifactVersion.id}/chapters/${chapter.id}`)
|
if artifactVersion.chapters.length == 0
|
||||||
.card-panel
|
p.flow-text No chapters added
|
||||||
p.flow-text= chapter.name
|
else
|
||||||
|
.row
|
||||||
|
each chapter in artifactVersion.chapters
|
||||||
|
.col.s12
|
||||||
|
a(href=`/v/${artifactVersion.id}/chapters/${chapter.id}`)
|
||||||
|
.card-panel
|
||||||
|
p.flow-text= chapter.name
|
||||||
|
|
||||||
.divider
|
.divider
|
||||||
.row
|
.row
|
||||||
a.btn.black(href=`/v/${artifactVersion.id}/translations/add`) add translation
|
|
||||||
|
if isOwnedByUser
|
||||||
|
a.btn.black(href=`/v/${artifactVersion.id}/translations/add`) add translation
|
||||||
|
|
||||||
if artifactVersion.translationArtifactVersions.length == 0
|
if artifactVersion.translationArtifactVersions.length == 0
|
||||||
p.flow-text No translations added
|
p.flow-text No translations added
|
||||||
|
|||||||
@@ -14,4 +14,12 @@ block content
|
|||||||
.col.s12
|
.col.s12
|
||||||
a(href=`/library/${artifact.id}`)
|
a(href=`/library/${artifact.id}`)
|
||||||
.card-panel
|
.card-panel
|
||||||
p.flow-text= artifact.name
|
p.flow-text= artifact.name
|
||||||
|
|
||||||
|
.divider
|
||||||
|
h2 forks
|
||||||
|
if translationArtifactVersions.length > 0
|
||||||
|
each translationArtifactVersion in translationArtifactVersions
|
||||||
|
p.flow-text
|
||||||
|
a(href=`/v/${translationArtifactVersion.artifactVersionId}/translations/${translationArtifactVersion.id}`)= translationArtifactVersion.name
|
||||||
|
else
|
||||||
|
|||||||
@@ -1,10 +1,31 @@
|
|||||||
extend templates/layout.pug
|
extend templates/layout.pug
|
||||||
|
|
||||||
block content
|
block content
|
||||||
|
-
|
||||||
|
const isOwnedByUser = translationArtifactVersion.owner.ownerEntities.some(ownerEntity => {
|
||||||
|
return ownerEntity.entity.entityUsers.some(entityUser => {
|
||||||
|
return entityUser.userId == user?.id
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const ownerForTranslationIsOwnerForArtifact = false
|
||||||
|
|
||||||
.container
|
.container
|
||||||
.center
|
.center
|
||||||
h1= translationArtifactVersion.name
|
h1= translationArtifactVersion.name
|
||||||
|
if !ownerForTranslationIsOwnerForArtifact
|
||||||
|
p.flow-text
|
||||||
|
each ownerEntity, index in translationArtifactVersion.owner.ownerEntities
|
||||||
|
small
|
||||||
|
if index > 0
|
||||||
|
span and
|
||||||
|
span.chip #{ownerEntity.entity.name}
|
||||||
h2= translationArtifactVersion.artifactVersion.artifact.name
|
h2= translationArtifactVersion.artifactVersion.artifact.name
|
||||||
|
p.flow-text
|
||||||
|
each ownerEntity, index in translationArtifactVersion.artifactVersion.artifact.owner.ownerEntities
|
||||||
|
small
|
||||||
|
if index > 0
|
||||||
|
span and
|
||||||
|
span.chip #{ownerEntity.entity.name}
|
||||||
|
|
||||||
if translationArtifactVersion.forkedFrom
|
if translationArtifactVersion.forkedFrom
|
||||||
p.flow-text is a
|
p.flow-text is a
|
||||||
@@ -15,20 +36,22 @@ block content
|
|||||||
.col.s12
|
.col.s12
|
||||||
a.btn.black(href=`/translate/${translationArtifactVersion.id}`) Translate
|
a.btn.black(href=`/translate/${translationArtifactVersion.id}`) Translate
|
||||||
//- TODO: Condition to show fork button
|
//- TODO: Condition to show fork button
|
||||||
.row
|
if !isOwnedByUser
|
||||||
.col.s12
|
.row
|
||||||
form(action=`/fork/t/${translationArtifactVersion.id}`, method="post")
|
.col.s12
|
||||||
button.btn.black(type="submit") fork
|
form(action=`/fork/t/${translationArtifactVersion.id}`, method="post")
|
||||||
|
button.btn.black(type="submit") fork
|
||||||
|
|
||||||
.row
|
if isOwnedByUser
|
||||||
.col.s12
|
//- TODO: Check required conditions to start back translation...
|
||||||
form(action=`/translate/${translationArtifactVersion.id}/back`, method="post")
|
.row
|
||||||
button.btn.black(type="submit") back translate
|
.col.s12
|
||||||
|
form(action=`/translate/${translationArtifactVersion.id}/back`, method="post")
|
||||||
|
button.btn.black(type="submit") back translate
|
||||||
|
|
||||||
|
.row
|
||||||
.row
|
.col.s12
|
||||||
.col.s12
|
a.btn.black(href=`/translate/${translationArtifactVersion.id}/campaigns`) funding campaign
|
||||||
a.btn.black(href=`/translate/${translationArtifactVersion.id}/campaigns`) funding campaign
|
|
||||||
.row
|
.row
|
||||||
.col.s12
|
.col.s12
|
||||||
a.btn.black(href=`/translate/${translationArtifactVersion.id}/pledges`) pledge
|
a.btn.black(href=`/translate/${translationArtifactVersion.id}/pledges`) pledge
|
||||||
|
|||||||
Reference in New Issue
Block a user