Adds upload target selection. Currently there's "document" and "limbo", while "document-extId" is not yet ready.
This commit is contained in:
parent
bef0d0e536
commit
3d3a5585b0
7 changed files with 15 additions and 13 deletions
|
@ -57,7 +57,7 @@ class FilemureApp(repository: SqliteRepository) {
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = "unauthorized",
|
title = "unauthorized",
|
||||||
isTarget = false,
|
target = "",
|
||||||
content = Unauthorized()
|
content = Unauthorized()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -27,7 +27,7 @@ class DocumentController(val modifiers: TemplateModifiers, val repository: Sqlit
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = document.title,
|
title = document.title,
|
||||||
isTarget = true,
|
target = "document-${document.extId}",
|
||||||
content = Document(
|
content = Document(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
extId = document.extId.value,
|
extId = document.extId.value,
|
||||||
|
@ -81,7 +81,8 @@ class DocumentController(val modifiers: TemplateModifiers, val repository: Sqlit
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = "new document",
|
title = "new document",
|
||||||
isTarget = true,
|
// TODO enable target for new documents in form
|
||||||
|
target = "",
|
||||||
content = DocumentCreateForm(
|
content = DocumentCreateForm(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = title,
|
title = title,
|
||||||
|
@ -170,7 +171,7 @@ class DocumentController(val modifiers: TemplateModifiers, val repository: Sqlit
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = document.title,
|
title = document.title,
|
||||||
isTarget = false,
|
target = "",
|
||||||
content = DocumentEditForm(
|
content = DocumentEditForm(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
extId = extId,
|
extId = extId,
|
||||||
|
|
|
@ -5,8 +5,6 @@ import net.h34t.filemure.*
|
||||||
import net.h34t.filemure.repository.SqliteRepository
|
import net.h34t.filemure.repository.SqliteRepository
|
||||||
import net.h34t.filemure.tpl.Frame
|
import net.h34t.filemure.tpl.Frame
|
||||||
import net.h34t.filemure.tpl.Limbo
|
import net.h34t.filemure.tpl.Limbo
|
||||||
import java.time.format.DateTimeFormatter
|
|
||||||
import java.time.format.FormatStyle
|
|
||||||
|
|
||||||
class LimboController(val modifiers: TemplateModifiers, val repository: SqliteRepository) {
|
class LimboController(val modifiers: TemplateModifiers, val repository: SqliteRepository) {
|
||||||
|
|
||||||
|
@ -17,7 +15,10 @@ class LimboController(val modifiers: TemplateModifiers, val repository: SqliteRe
|
||||||
|
|
||||||
ctx.tempolin(
|
ctx.tempolin(
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers, title = "Filemure Limbo", isTarget = true, content = Limbo(
|
modifiers = modifiers,
|
||||||
|
title = "Filemure Limbo",
|
||||||
|
target = "limbo",
|
||||||
|
content = Limbo(
|
||||||
modifiers = modifiers, limboFileCount = files.size.toString(), file = {
|
modifiers = modifiers, limboFileCount = files.size.toString(), file = {
|
||||||
files.map { f ->
|
files.map { f ->
|
||||||
FileBlock(
|
FileBlock(
|
||||||
|
|
|
@ -13,7 +13,7 @@ class LoginController(val modifiers: TemplateModifiers, val repository: SqliteRe
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = "Hello to Filemure",
|
title = "Hello to Filemure",
|
||||||
isTarget = false,
|
target = "",
|
||||||
content = Login(
|
content = Login(
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -22,7 +22,7 @@ class OverviewController(val modifiers: TemplateModifiers, val repository: Sqlit
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = "Overview",
|
title = "Overview",
|
||||||
isTarget = true,
|
target = "document",
|
||||||
content = Overview(
|
content = Overview(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
limboFileCount = limboFileCount.toString(),
|
limboFileCount = limboFileCount.toString(),
|
||||||
|
@ -59,7 +59,7 @@ class OverviewController(val modifiers: TemplateModifiers, val repository: Sqlit
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = "Overview",
|
title = "Overview",
|
||||||
isTarget = true,
|
target = "document",
|
||||||
content = OverviewDocuments(
|
content = OverviewDocuments(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
category = "$year-$month",
|
category = "$year-$month",
|
||||||
|
|
|
@ -22,7 +22,7 @@ class SearchController(val modifiers: TemplateModifiers, val repository: SqliteR
|
||||||
Frame(
|
Frame(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
title = "Overview",
|
title = "Overview",
|
||||||
isTarget = true,
|
target = "document",
|
||||||
content = Search(
|
content = Search(
|
||||||
modifiers = modifiers,
|
modifiers = modifiers,
|
||||||
search = q ?: "",
|
search = q ?: "",
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
<script src="/filemure.js"></script>
|
<script src="/filemure.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{if $isTarget}
|
{if $target}
|
||||||
<div class="dropzone"></div>
|
<div class="dropzone" data-target="{*$target}"></div>
|
||||||
<dialog id="upload_progress_dialog">
|
<dialog id="upload_progress_dialog">
|
||||||
<progress id="upload_progress" max="100"></progress>
|
<progress id="upload_progress" max="100"></progress>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
Loading…
Reference in a new issue