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(
|
||||
modifiers = modifiers,
|
||||
title = "unauthorized",
|
||||
isTarget = false,
|
||||
target = "",
|
||||
content = Unauthorized()
|
||||
)
|
||||
)
|
||||
|
|
|
@ -27,7 +27,7 @@ class DocumentController(val modifiers: TemplateModifiers, val repository: Sqlit
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = document.title,
|
||||
isTarget = true,
|
||||
target = "document-${document.extId}",
|
||||
content = Document(
|
||||
modifiers = modifiers,
|
||||
extId = document.extId.value,
|
||||
|
@ -81,7 +81,8 @@ class DocumentController(val modifiers: TemplateModifiers, val repository: Sqlit
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = "new document",
|
||||
isTarget = true,
|
||||
// TODO enable target for new documents in form
|
||||
target = "",
|
||||
content = DocumentCreateForm(
|
||||
modifiers = modifiers,
|
||||
title = title,
|
||||
|
@ -170,7 +171,7 @@ class DocumentController(val modifiers: TemplateModifiers, val repository: Sqlit
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = document.title,
|
||||
isTarget = false,
|
||||
target = "",
|
||||
content = DocumentEditForm(
|
||||
modifiers = modifiers,
|
||||
extId = extId,
|
||||
|
|
|
@ -5,8 +5,6 @@ import net.h34t.filemure.*
|
|||
import net.h34t.filemure.repository.SqliteRepository
|
||||
import net.h34t.filemure.tpl.Frame
|
||||
import net.h34t.filemure.tpl.Limbo
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.format.FormatStyle
|
||||
|
||||
class LimboController(val modifiers: TemplateModifiers, val repository: SqliteRepository) {
|
||||
|
||||
|
@ -17,7 +15,10 @@ class LimboController(val modifiers: TemplateModifiers, val repository: SqliteRe
|
|||
|
||||
ctx.tempolin(
|
||||
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 = {
|
||||
files.map { f ->
|
||||
FileBlock(
|
||||
|
|
|
@ -13,7 +13,7 @@ class LoginController(val modifiers: TemplateModifiers, val repository: SqliteRe
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = "Hello to Filemure",
|
||||
isTarget = false,
|
||||
target = "",
|
||||
content = Login(
|
||||
|
||||
)
|
||||
|
|
|
@ -22,7 +22,7 @@ class OverviewController(val modifiers: TemplateModifiers, val repository: Sqlit
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = "Overview",
|
||||
isTarget = true,
|
||||
target = "document",
|
||||
content = Overview(
|
||||
modifiers = modifiers,
|
||||
limboFileCount = limboFileCount.toString(),
|
||||
|
@ -59,7 +59,7 @@ class OverviewController(val modifiers: TemplateModifiers, val repository: Sqlit
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = "Overview",
|
||||
isTarget = true,
|
||||
target = "document",
|
||||
content = OverviewDocuments(
|
||||
modifiers = modifiers,
|
||||
category = "$year-$month",
|
||||
|
|
|
@ -22,7 +22,7 @@ class SearchController(val modifiers: TemplateModifiers, val repository: SqliteR
|
|||
Frame(
|
||||
modifiers = modifiers,
|
||||
title = "Overview",
|
||||
isTarget = true,
|
||||
target = "document",
|
||||
content = Search(
|
||||
modifiers = modifiers,
|
||||
search = q ?: "",
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<script src="/filemure.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
{if $isTarget}
|
||||
<div class="dropzone"></div>
|
||||
{if $target}
|
||||
<div class="dropzone" data-target="{*$target}"></div>
|
||||
<dialog id="upload_progress_dialog">
|
||||
<progress id="upload_progress" max="100"></progress>
|
||||
</dialog>
|
||||
|
|
Loading…
Reference in a new issue