Add importing spreadsheet ability

This commit is contained in:
kngako
2023-01-06 02:34:01 +02:00
parent 53f6dce1ef
commit 2887197c4d
5 changed files with 703 additions and 300 deletions

View File

@@ -29,7 +29,15 @@ block content
each val, key in query
if key != "sheets"
input(type="hidden", name=key, value=val)
button.btn.black(type="submit") export to spreadsheets
button.btn.black(type="submit")
i.material-icons.left file_download
span export to spreadsheets
.row
.col.s12
a.btn.black(href=`/projects/${project.id}/import`)
i.material-icons.left file_upload
span import spreadsheets
.divider
table.highlight

View File

@@ -0,0 +1,31 @@
extend templates/layout.pug
block content
-
const isOwnedByUser = project.owner.ownerEntities.some(ownerEntity => {
return ownerEntity.entity.entityUsers.some(entityUser => {
return entityUser.userId == user?.id
})
})
.container
.center
h1
small import
span= project.name
small translations
p.flow-text= project.description
.row
.col.s12
form.row(action=`/projects/${project.id}/import`, method="post", encType="multipart/form-data")
//- .col.s12.input-field
textarea#textarea.materialize-textarea(name="text")
label(for="textarea") Entire chapter text (markdown)
.file-field.input-field.col.s12
.btn
span File
input#file-input(type="file", name="translations")
.file-path-wrapper
input.file-path.validate(type="text", placeholder="Import translations")
.col.s12
button.btn.black(type="submit") import translations