@fiduswriter/frontend 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +66 -0
- package/dist/admin_console/index.d.ts +8 -0
- package/dist/admin_console/index.d.ts.map +1 -0
- package/dist/admin_console/index.js +54 -0
- package/dist/admin_console/index.js.map +1 -0
- package/dist/api/index.d.ts +193 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +6 -0
- package/dist/api/index.js.map +1 -0
- package/dist/app/index.d.ts +74 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +471 -0
- package/dist/app/index.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +3 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/templates.d.ts +3 -0
- package/dist/common/templates.d.ts.map +1 -0
- package/dist/common/templates.js +42 -0
- package/dist/common/templates.js.map +1 -0
- package/dist/common/user_util.d.ts +6 -0
- package/dist/common/user_util.d.ts.map +1 -0
- package/dist/common/user_util.js +16 -0
- package/dist/common/user_util.js.map +1 -0
- package/dist/document_templates/actions.d.ts +11 -0
- package/dist/document_templates/actions.d.ts.map +1 -0
- package/dist/document_templates/actions.js +141 -0
- package/dist/document_templates/actions.js.map +1 -0
- package/dist/document_templates/editor.d.ts +28 -0
- package/dist/document_templates/editor.d.ts.map +1 -0
- package/dist/document_templates/editor.js +139 -0
- package/dist/document_templates/editor.js.map +1 -0
- package/dist/document_templates/index.d.ts +3 -0
- package/dist/document_templates/index.d.ts.map +1 -0
- package/dist/document_templates/index.js +3 -0
- package/dist/document_templates/index.js.map +1 -0
- package/dist/document_templates/menu.d.ts +7 -0
- package/dist/document_templates/menu.d.ts.map +1 -0
- package/dist/document_templates/menu.js +62 -0
- package/dist/document_templates/menu.js.map +1 -0
- package/dist/document_templates/overview.d.ts +52 -0
- package/dist/document_templates/overview.d.ts.map +1 -0
- package/dist/document_templates/overview.js +274 -0
- package/dist/document_templates/overview.js.map +1 -0
- package/dist/document_templates/templates.d.ts +3 -0
- package/dist/document_templates/templates.d.ts.map +1 -0
- package/dist/document_templates/templates.js +9 -0
- package/dist/document_templates/templates.js.map +1 -0
- package/dist/documents/importer/docx/import.d.ts +5 -0
- package/dist/documents/importer/docx/import.d.ts.map +1 -0
- package/dist/documents/importer/docx/import.js +15 -0
- package/dist/documents/importer/docx/import.js.map +1 -0
- package/dist/documents/importer/docx/index.d.ts +2 -0
- package/dist/documents/importer/docx/index.d.ts.map +1 -0
- package/dist/documents/importer/docx/index.js +2 -0
- package/dist/documents/importer/docx/index.js.map +1 -0
- package/dist/documents/importer/native/file.d.ts +7 -0
- package/dist/documents/importer/native/file.d.ts.map +1 -0
- package/dist/documents/importer/native/file.js +60 -0
- package/dist/documents/importer/native/file.js.map +1 -0
- package/dist/documents/importer/native/import.d.ts +41 -0
- package/dist/documents/importer/native/import.d.ts.map +1 -0
- package/dist/documents/importer/native/import.js +126 -0
- package/dist/documents/importer/native/import.js.map +1 -0
- package/dist/documents/importer/native/index.d.ts +3 -0
- package/dist/documents/importer/native/index.d.ts.map +1 -0
- package/dist/documents/importer/native/index.js +3 -0
- package/dist/documents/importer/native/index.js.map +1 -0
- package/dist/documents/importer/odt/import.d.ts +5 -0
- package/dist/documents/importer/odt/import.d.ts.map +1 -0
- package/dist/documents/importer/odt/import.js +16 -0
- package/dist/documents/importer/odt/import.js.map +1 -0
- package/dist/documents/importer/odt/index.d.ts +2 -0
- package/dist/documents/importer/odt/index.d.ts.map +1 -0
- package/dist/documents/importer/odt/index.js +2 -0
- package/dist/documents/importer/odt/index.js.map +1 -0
- package/dist/documents/importer/pandoc/import.d.ts +5 -0
- package/dist/documents/importer/pandoc/import.d.ts.map +1 -0
- package/dist/documents/importer/pandoc/import.js +37 -0
- package/dist/documents/importer/pandoc/import.js.map +1 -0
- package/dist/documents/importer/pandoc/index.d.ts +2 -0
- package/dist/documents/importer/pandoc/index.d.ts.map +1 -0
- package/dist/documents/importer/pandoc/index.js +2 -0
- package/dist/documents/importer/pandoc/index.js.map +1 -0
- package/dist/documents/importer/register.d.ts +4 -0
- package/dist/documents/importer/register.d.ts.map +1 -0
- package/dist/documents/importer/register.js +4 -0
- package/dist/documents/importer/register.js.map +1 -0
- package/dist/documents/overview/actions.d.ts +32 -0
- package/dist/documents/overview/actions.d.ts.map +1 -0
- package/dist/documents/overview/actions.js +725 -0
- package/dist/documents/overview/actions.js.map +1 -0
- package/dist/documents/overview/index.d.ts +98 -0
- package/dist/documents/overview/index.d.ts.map +1 -0
- package/dist/documents/overview/index.js +814 -0
- package/dist/documents/overview/index.js.map +1 -0
- package/dist/documents/overview/menu.d.ts +28 -0
- package/dist/documents/overview/menu.d.ts.map +1 -0
- package/dist/documents/overview/menu.js +222 -0
- package/dist/documents/overview/menu.js.map +1 -0
- package/dist/documents/overview/templates.d.ts +31 -0
- package/dist/documents/overview/templates.d.ts.map +1 -0
- package/dist/documents/overview/templates.js +39 -0
- package/dist/documents/overview/templates.js.map +1 -0
- package/dist/documents/revisions/index.d.ts +14 -0
- package/dist/documents/revisions/index.d.ts.map +1 -0
- package/dist/documents/revisions/index.js +143 -0
- package/dist/documents/revisions/index.js.map +1 -0
- package/dist/documents/revisions/templates.d.ts +4 -0
- package/dist/documents/revisions/templates.d.ts.map +1 -0
- package/dist/documents/revisions/templates.js +36 -0
- package/dist/documents/revisions/templates.js.map +1 -0
- package/dist/documents/tools.d.ts +16 -0
- package/dist/documents/tools.d.ts.map +1 -0
- package/dist/documents/tools.js +69 -0
- package/dist/documents/tools.js.map +1 -0
- package/dist/error_hook/index.d.ts +19 -0
- package/dist/error_hook/index.d.ts.map +1 -0
- package/dist/error_hook/index.js +75 -0
- package/dist/error_hook/index.js.map +1 -0
- package/dist/feedback/index.d.ts +12 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +125 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/indexed_db/index.d.ts +24 -0
- package/dist/indexed_db/index.d.ts.map +1 -0
- package/dist/indexed_db/index.js +175 -0
- package/dist/indexed_db/index.js.map +1 -0
- package/dist/maintenance/index.d.ts +19 -0
- package/dist/maintenance/index.d.ts.map +1 -0
- package/dist/maintenance/index.js +223 -0
- package/dist/maintenance/index.js.map +1 -0
- package/dist/menu/index.d.ts +25 -0
- package/dist/menu/index.d.ts.map +1 -0
- package/dist/menu/index.js +229 -0
- package/dist/menu/index.js.map +1 -0
- package/dist/menu/templates.d.ts +6 -0
- package/dist/menu/templates.d.ts.map +1 -0
- package/dist/menu/templates.js +10 -0
- package/dist/menu/templates.js.map +1 -0
- package/dist/pages/404.d.ts +9 -0
- package/dist/pages/404.d.ts.map +1 -0
- package/dist/pages/404.js +12 -0
- package/dist/pages/404.js.map +1 -0
- package/dist/pages/flatpage.d.ts +12 -0
- package/dist/pages/flatpage.d.ts.map +1 -0
- package/dist/pages/flatpage.js +39 -0
- package/dist/pages/flatpage.js.map +1 -0
- package/dist/pages/offline.d.ts +10 -0
- package/dist/pages/offline.d.ts.map +1 -0
- package/dist/pages/offline.js +27 -0
- package/dist/pages/offline.js.map +1 -0
- package/dist/pages/setup.d.ts +10 -0
- package/dist/pages/setup.d.ts.map +1 -0
- package/dist/pages/setup.js +22 -0
- package/dist/pages/setup.js.map +1 -0
- package/dist/plugins/menu/index.d.ts +3 -0
- package/dist/plugins/menu/index.d.ts.map +1 -0
- package/dist/plugins/menu/index.js +2 -0
- package/dist/plugins/menu/index.js.map +1 -0
- package/dist/prelogin/index.d.ts +51 -0
- package/dist/prelogin/index.d.ts.map +1 -0
- package/dist/prelogin/index.js +131 -0
- package/dist/prelogin/index.js.map +1 -0
- package/dist/prelogin/templates.d.ts +20 -0
- package/dist/prelogin/templates.d.ts.map +1 -0
- package/dist/prelogin/templates.js +50 -0
- package/dist/prelogin/templates.js.map +1 -0
- package/dist/state_plugins/contributor_input/add_button.d.ts +22 -0
- package/dist/state_plugins/contributor_input/add_button.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/add_button.js +106 -0
- package/dist/state_plugins/contributor_input/add_button.js.map +1 -0
- package/dist/state_plugins/contributor_input/helpers.d.ts +3 -0
- package/dist/state_plugins/contributor_input/helpers.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/helpers.js +23 -0
- package/dist/state_plugins/contributor_input/helpers.js.map +1 -0
- package/dist/state_plugins/contributor_input/index.d.ts +4 -0
- package/dist/state_plugins/contributor_input/index.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/index.js +4 -0
- package/dist/state_plugins/contributor_input/index.js.map +1 -0
- package/dist/state_plugins/contributor_input/node_view.d.ts +20 -0
- package/dist/state_plugins/contributor_input/node_view.d.ts.map +1 -0
- package/dist/state_plugins/contributor_input/node_view.js +85 -0
- package/dist/state_plugins/contributor_input/node_view.js.map +1 -0
- package/dist/state_plugins/index.d.ts +3 -0
- package/dist/state_plugins/index.d.ts.map +1 -0
- package/dist/state_plugins/index.js +3 -0
- package/dist/state_plugins/index.js.map +1 -0
- package/dist/state_plugins/tag_input/helpers.d.ts +5 -0
- package/dist/state_plugins/tag_input/helpers.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/helpers.js +55 -0
- package/dist/state_plugins/tag_input/helpers.js.map +1 -0
- package/dist/state_plugins/tag_input/index.d.ts +5 -0
- package/dist/state_plugins/tag_input/index.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/index.js +5 -0
- package/dist/state_plugins/tag_input/index.js.map +1 -0
- package/dist/state_plugins/tag_input/node_view.d.ts +19 -0
- package/dist/state_plugins/tag_input/node_view.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/node_view.js +85 -0
- package/dist/state_plugins/tag_input/node_view.js.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor.d.ts +4 -0
- package/dist/state_plugins/tag_input/tag_editor.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor.js +160 -0
- package/dist/state_plugins/tag_input/tag_editor.js.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.d.ts +5 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.d.ts.map +1 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.js +64 -0
- package/dist/state_plugins/tag_input/tag_editor_plugins.js.map +1 -0
- package/dist/types.d.ts +53 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/user/auth/email_confirm.d.ts +23 -0
- package/dist/user/auth/email_confirm.d.ts.map +1 -0
- package/dist/user/auth/email_confirm.js +123 -0
- package/dist/user/auth/email_confirm.js.map +1 -0
- package/dist/user/auth/email_confirm_templates.d.ts +12 -0
- package/dist/user/auth/email_confirm_templates.d.ts.map +1 -0
- package/dist/user/auth/email_confirm_templates.js +30 -0
- package/dist/user/auth/email_confirm_templates.js.map +1 -0
- package/dist/user/auth/login.d.ts +13 -0
- package/dist/user/auth/login.d.ts.map +1 -0
- package/dist/user/auth/login.js +186 -0
- package/dist/user/auth/login.js.map +1 -0
- package/dist/user/auth/password_reset_change.d.ts +11 -0
- package/dist/user/auth/password_reset_change.d.ts.map +1 -0
- package/dist/user/auth/password_reset_change.js +101 -0
- package/dist/user/auth/password_reset_change.js.map +1 -0
- package/dist/user/auth/password_reset_request.d.ts +10 -0
- package/dist/user/auth/password_reset_request.d.ts.map +1 -0
- package/dist/user/auth/password_reset_request.js +82 -0
- package/dist/user/auth/password_reset_request.js.map +1 -0
- package/dist/user/auth/signup.d.ts +9 -0
- package/dist/user/auth/signup.d.ts.map +1 -0
- package/dist/user/auth/signup.js +148 -0
- package/dist/user/auth/signup.js.map +1 -0
- package/dist/user/auth/two_factor.d.ts +10 -0
- package/dist/user/auth/two_factor.d.ts.map +1 -0
- package/dist/user/auth/two_factor.js +201 -0
- package/dist/user/auth/two_factor.js.map +1 -0
- package/dist/user/contacts/add_dialog.d.ts +7 -0
- package/dist/user/contacts/add_dialog.d.ts.map +1 -0
- package/dist/user/contacts/add_dialog.js +84 -0
- package/dist/user/contacts/add_dialog.js.map +1 -0
- package/dist/user/contacts/delete_dialog.d.ts +6 -0
- package/dist/user/contacts/delete_dialog.d.ts.map +1 -0
- package/dist/user/contacts/delete_dialog.js +38 -0
- package/dist/user/contacts/delete_dialog.js.map +1 -0
- package/dist/user/contacts/index.d.ts +35 -0
- package/dist/user/contacts/index.d.ts.map +1 -0
- package/dist/user/contacts/index.js +234 -0
- package/dist/user/contacts/index.js.map +1 -0
- package/dist/user/contacts/invite.d.ts +9 -0
- package/dist/user/contacts/invite.d.ts.map +1 -0
- package/dist/user/contacts/invite.js +21 -0
- package/dist/user/contacts/invite.js.map +1 -0
- package/dist/user/contacts/menu.d.ts +7 -0
- package/dist/user/contacts/menu.d.ts.map +1 -0
- package/dist/user/contacts/menu.js +62 -0
- package/dist/user/contacts/menu.js.map +1 -0
- package/dist/user/contacts/respond_invite.d.ts +9 -0
- package/dist/user/contacts/respond_invite.d.ts.map +1 -0
- package/dist/user/contacts/respond_invite.js +65 -0
- package/dist/user/contacts/respond_invite.js.map +1 -0
- package/dist/user/contacts/templates.d.ts +7 -0
- package/dist/user/contacts/templates.d.ts.map +1 -0
- package/dist/user/contacts/templates.js +24 -0
- package/dist/user/contacts/templates.js.map +1 -0
- package/dist/user/profile/delete_user.d.ts +8 -0
- package/dist/user/profile/delete_user.d.ts.map +1 -0
- package/dist/user/profile/delete_user.js +56 -0
- package/dist/user/profile/delete_user.js.map +1 -0
- package/dist/user/profile/dialogs.d.ts +10 -0
- package/dist/user/profile/dialogs.d.ts.map +1 -0
- package/dist/user/profile/dialogs.js +311 -0
- package/dist/user/profile/dialogs.js.map +1 -0
- package/dist/user/profile/index.d.ts +27 -0
- package/dist/user/profile/index.d.ts.map +1 -0
- package/dist/user/profile/index.js +254 -0
- package/dist/user/profile/index.js.map +1 -0
- package/dist/user/profile/templates.d.ts +22 -0
- package/dist/user/profile/templates.d.ts.map +1 -0
- package/dist/user/profile/templates.js +261 -0
- package/dist/user/profile/templates.js.map +1 -0
- package/dist/workers/adjust_doc_to_template.d.ts +11 -0
- package/dist/workers/adjust_doc_to_template.d.ts.map +1 -0
- package/dist/workers/adjust_doc_to_template.js +26 -0
- package/dist/workers/adjust_doc_to_template.js.map +1 -0
- package/package.json +225 -0
- package/src/admin_console/index.ts +84 -0
- package/src/api/index.ts +149 -0
- package/src/app/index.ts +605 -0
- package/src/common/index.ts +2 -0
- package/src/common/templates.ts +49 -0
- package/src/common/user_util.ts +16 -0
- package/src/document_templates/actions.ts +179 -0
- package/src/document_templates/editor.ts +177 -0
- package/src/document_templates/index.ts +2 -0
- package/src/document_templates/menu.ts +74 -0
- package/src/document_templates/overview.ts +335 -0
- package/src/document_templates/templates.ts +9 -0
- package/src/documents/importer/docx/import.ts +25 -0
- package/src/documents/importer/docx/index.ts +1 -0
- package/src/documents/importer/native/file.ts +112 -0
- package/src/documents/importer/native/import.ts +219 -0
- package/src/documents/importer/native/index.ts +2 -0
- package/src/documents/importer/odt/import.ts +26 -0
- package/src/documents/importer/odt/index.ts +1 -0
- package/src/documents/importer/pandoc/import.ts +57 -0
- package/src/documents/importer/pandoc/index.ts +1 -0
- package/src/documents/importer/register.ts +8 -0
- package/src/documents/overview/actions.ts +1031 -0
- package/src/documents/overview/index.ts +1006 -0
- package/src/documents/overview/menu.ts +311 -0
- package/src/documents/overview/templates.ts +64 -0
- package/src/documents/revisions/index.ts +183 -0
- package/src/documents/revisions/templates.ts +42 -0
- package/src/documents/tools.ts +107 -0
- package/src/error_hook/index.ts +129 -0
- package/src/feedback/index.ts +185 -0
- package/src/global.d.ts +22 -0
- package/src/index.ts +95 -0
- package/src/indexed_db/index.ts +217 -0
- package/src/maintenance/index.ts +258 -0
- package/src/menu/index.ts +267 -0
- package/src/menu/templates.ts +21 -0
- package/src/pages/404.ts +13 -0
- package/src/pages/flatpage.ts +43 -0
- package/src/pages/offline.ts +39 -0
- package/src/pages/setup.ts +34 -0
- package/src/plugins/menu/index.ts +3 -0
- package/src/prelogin/index.ts +175 -0
- package/src/prelogin/templates.ts +86 -0
- package/src/types.ts +63 -0
- package/src/user/auth/email_confirm.ts +153 -0
- package/src/user/auth/email_confirm_templates.ts +76 -0
- package/src/user/auth/login.ts +221 -0
- package/src/user/auth/password_reset_change.ts +120 -0
- package/src/user/auth/password_reset_request.ts +107 -0
- package/src/user/auth/signup.ts +182 -0
- package/src/user/auth/two_factor.ts +244 -0
- package/src/user/contacts/add_dialog.ts +104 -0
- package/src/user/contacts/delete_dialog.ts +40 -0
- package/src/user/contacts/index.ts +289 -0
- package/src/user/contacts/invite.ts +24 -0
- package/src/user/contacts/menu.ts +70 -0
- package/src/user/contacts/respond_invite.ts +76 -0
- package/src/user/contacts/templates.ts +29 -0
- package/src/user/profile/delete_user.ts +71 -0
- package/src/user/profile/dialogs.ts +363 -0
- package/src/user/profile/index.ts +359 -0
- package/src/user/profile/templates.ts +299 -0
- package/src/workers/adjust_doc_to_template.ts +41 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import {DocumentAccessRightsDialog} from "@fiduswriter/editor/documents/access_rights/index"
|
|
2
|
+
import {FileDialog, NewFolderDialog, addAlert} from "fwtoolkit"
|
|
3
|
+
|
|
4
|
+
import type {DocumentOverview} from "./index.js"
|
|
5
|
+
|
|
6
|
+
interface BulkMenuItem {
|
|
7
|
+
title: string
|
|
8
|
+
tooltip: string
|
|
9
|
+
action: (overview: DocumentOverview) => void
|
|
10
|
+
disabled: (overview: DocumentOverview) => boolean
|
|
11
|
+
order: number
|
|
12
|
+
id?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface MenuItem {
|
|
16
|
+
type: string
|
|
17
|
+
id?: string
|
|
18
|
+
title: string
|
|
19
|
+
keys?: string
|
|
20
|
+
action?: (overview: DocumentOverview) => void
|
|
21
|
+
icon?: string
|
|
22
|
+
input?: (overview: DocumentOverview, text: string) => void
|
|
23
|
+
order: number
|
|
24
|
+
content?: Array<Record<string, unknown>>
|
|
25
|
+
disabled?: (overview: DocumentOverview) => boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface MenuModel {
|
|
29
|
+
content: (MenuItem | BulkMenuItem)[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const bulkMenuModel = (): MenuModel => ({
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
title: gettext("Move selected"),
|
|
36
|
+
tooltip: gettext("Move the documents that have been selected."),
|
|
37
|
+
action: overview => {
|
|
38
|
+
const ids = overview.getSelected()
|
|
39
|
+
const docs = ids.map(id =>
|
|
40
|
+
overview.documentList.find(doc => doc.id === id)
|
|
41
|
+
)
|
|
42
|
+
if (docs.length) {
|
|
43
|
+
const dialog = new FileDialog({
|
|
44
|
+
title:
|
|
45
|
+
docs.length > 1
|
|
46
|
+
? gettext("Move documents")
|
|
47
|
+
: gettext("Move document"),
|
|
48
|
+
movingFiles: docs,
|
|
49
|
+
allFiles: overview.documentList,
|
|
50
|
+
moveUrl: "/api/document/move/",
|
|
51
|
+
successMessage: gettext("Document has been moved"),
|
|
52
|
+
errorMessage: gettext("Could not move document"),
|
|
53
|
+
succcessCallback: (_file: Record<string, unknown>, _path: string) => {
|
|
54
|
+
overview.initTable()
|
|
55
|
+
}
|
|
56
|
+
} as any)
|
|
57
|
+
dialog.init()
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
disabled: overview =>
|
|
61
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
62
|
+
order: 1
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: gettext("Share selected"),
|
|
66
|
+
tooltip: gettext("Share the documents that have been selected."),
|
|
67
|
+
action: overview => {
|
|
68
|
+
const ids = overview.getSelected()
|
|
69
|
+
const ownIds = ids.filter(
|
|
70
|
+
id =>
|
|
71
|
+
overview.documentList.find(doc => doc.id === id)
|
|
72
|
+
?.is_owner
|
|
73
|
+
)
|
|
74
|
+
if (ownIds.length !== ids.length) {
|
|
75
|
+
addAlert(
|
|
76
|
+
"error",
|
|
77
|
+
gettext("You cannot share documents of other users")
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
if (ownIds.length) {
|
|
81
|
+
const e2ee = ownIds.some(
|
|
82
|
+
id =>
|
|
83
|
+
overview.documentList.find(doc => doc.id === id)
|
|
84
|
+
?.e2ee
|
|
85
|
+
)
|
|
86
|
+
const dialog = new DocumentAccessRightsDialog(
|
|
87
|
+
ids,
|
|
88
|
+
overview.contacts as any,
|
|
89
|
+
((memberDetails: Record<string, unknown>) =>
|
|
90
|
+
overview.contacts.push(memberDetails as any)) as any,
|
|
91
|
+
e2ee,
|
|
92
|
+
"",
|
|
93
|
+
null as any,
|
|
94
|
+
overview.app.settings
|
|
95
|
+
)
|
|
96
|
+
dialog.init()
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
disabled: overview =>
|
|
100
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
101
|
+
order: 1
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: gettext("Copy selected"),
|
|
105
|
+
tooltip: gettext("Copy the documents that have been selected."),
|
|
106
|
+
action: overview => {
|
|
107
|
+
const ids = overview.getSelected()
|
|
108
|
+
if (ids.length) {
|
|
109
|
+
overview.mod.actions!.copyFiles(ids)
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
disabled: overview =>
|
|
113
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
114
|
+
order: 2
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
title: gettext("Export selected as Epub"),
|
|
118
|
+
tooltip: gettext(
|
|
119
|
+
"Export the documents that have been selected as Epub files."
|
|
120
|
+
),
|
|
121
|
+
action: overview => {
|
|
122
|
+
const ids = overview.getSelected()
|
|
123
|
+
if (ids.length) {
|
|
124
|
+
overview.mod.actions!.downloadEpubFiles(ids)
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
disabled: overview =>
|
|
128
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
129
|
+
order: 3
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: gettext("Export selected as HTML"),
|
|
133
|
+
tooltip: gettext(
|
|
134
|
+
"Export the documents that have been selected as HTML files."
|
|
135
|
+
),
|
|
136
|
+
action: overview => {
|
|
137
|
+
const ids = overview.getSelected()
|
|
138
|
+
if (ids.length) {
|
|
139
|
+
overview.mod.actions!.downloadHTMLFiles(ids)
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
disabled: overview =>
|
|
143
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
144
|
+
order: 4
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
title: gettext("Export selected as LaTeX"),
|
|
148
|
+
tooltip: gettext(
|
|
149
|
+
"Export the documents that have been selected as LaTeX files."
|
|
150
|
+
),
|
|
151
|
+
action: overview => {
|
|
152
|
+
const ids = overview.getSelected()
|
|
153
|
+
if (ids.length) {
|
|
154
|
+
overview.mod.actions!.downloadLatexFiles(ids)
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
disabled: overview =>
|
|
158
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
159
|
+
order: 5
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
title: gettext("Export selected as JATS"),
|
|
163
|
+
tooltip: gettext(
|
|
164
|
+
"Export the documents that have been selected as JATS files."
|
|
165
|
+
),
|
|
166
|
+
action: overview => {
|
|
167
|
+
const ids = overview.getSelected()
|
|
168
|
+
if (ids.length) {
|
|
169
|
+
overview.mod.actions!.downloadJATSFiles(ids)
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
disabled: overview =>
|
|
173
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
174
|
+
order: 6
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
title: gettext("Export selected as BITS"),
|
|
178
|
+
tooltip: gettext(
|
|
179
|
+
"Export the documents that have been selected as BITS files."
|
|
180
|
+
),
|
|
181
|
+
action: overview => {
|
|
182
|
+
const ids = overview.getSelected()
|
|
183
|
+
if (ids.length) {
|
|
184
|
+
overview.mod.actions!.downloadBITSFiles(ids)
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
disabled: overview =>
|
|
188
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
189
|
+
order: 7
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
title: gettext("Export selected as FIDUS"),
|
|
193
|
+
tooltip: gettext(
|
|
194
|
+
"Export the documents that have been selected as FIDUS files including their templates."
|
|
195
|
+
),
|
|
196
|
+
action: overview => {
|
|
197
|
+
const ids = overview.getSelected()
|
|
198
|
+
if (ids.length) {
|
|
199
|
+
overview.mod.actions!.downloadNativeFiles(ids)
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
disabled: overview =>
|
|
203
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
204
|
+
order: 8
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
title: gettext("Export selected as Slim FIDUS"),
|
|
208
|
+
tooltip: gettext(
|
|
209
|
+
"Export the documents that have been selected as FIDUS files without their templates."
|
|
210
|
+
),
|
|
211
|
+
action: overview => {
|
|
212
|
+
const ids = overview.getSelected()
|
|
213
|
+
if (ids.length) {
|
|
214
|
+
overview.mod.actions!.downloadSlimNativeFiles(ids)
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
disabled: overview =>
|
|
218
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
219
|
+
order: 9
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
title: gettext("Delete selected"),
|
|
223
|
+
tooltip: gettext("Delete the documents that have been selected."),
|
|
224
|
+
action: overview => {
|
|
225
|
+
const ids = overview.getSelected()
|
|
226
|
+
const ownIds = ids.filter(
|
|
227
|
+
id =>
|
|
228
|
+
overview.documentList.find(doc => doc.id === id)
|
|
229
|
+
?.is_owner
|
|
230
|
+
)
|
|
231
|
+
if (ownIds.length !== ids.length) {
|
|
232
|
+
addAlert(
|
|
233
|
+
"error",
|
|
234
|
+
gettext("You cannot delete documents of other users")
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
if (ownIds.length) {
|
|
238
|
+
overview.mod.actions!.deleteDocumentDialog(
|
|
239
|
+
ownIds,
|
|
240
|
+
overview.app
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
disabled: overview =>
|
|
245
|
+
!overview.getSelected().length || overview.app.isOffline(),
|
|
246
|
+
order: 10
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
let currentlySearching = false
|
|
252
|
+
|
|
253
|
+
export const menuModel = (): MenuModel => ({
|
|
254
|
+
content: [
|
|
255
|
+
{
|
|
256
|
+
type: "text",
|
|
257
|
+
id: "new_document",
|
|
258
|
+
title: gettext("Create new document"),
|
|
259
|
+
keys: "Alt-n",
|
|
260
|
+
action: overview => overview.goToNewDocument("new"),
|
|
261
|
+
order: 1
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
type: "text",
|
|
265
|
+
title: gettext("Create new folder"),
|
|
266
|
+
keys: "Alt-f",
|
|
267
|
+
action: overview => {
|
|
268
|
+
const dialog = new NewFolderDialog((folderName: string) => {
|
|
269
|
+
overview.path = overview.path + folderName + "/"
|
|
270
|
+
window.history.pushState(
|
|
271
|
+
{},
|
|
272
|
+
"",
|
|
273
|
+
"/documents" + overview.path
|
|
274
|
+
)
|
|
275
|
+
overview.initTable()
|
|
276
|
+
})
|
|
277
|
+
dialog.open()
|
|
278
|
+
},
|
|
279
|
+
order: 2
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
type: "text",
|
|
283
|
+
id: "import_document",
|
|
284
|
+
title: gettext("Import document"),
|
|
285
|
+
keys: "Alt-i",
|
|
286
|
+
action: overview => overview.mod.actions!.importDocument(),
|
|
287
|
+
order: 3
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
type: "search",
|
|
291
|
+
icon: "search",
|
|
292
|
+
title: gettext("Search documents"),
|
|
293
|
+
keys: "Alt-s",
|
|
294
|
+
input: (overview, text) => {
|
|
295
|
+
if (text.length && !currentlySearching) {
|
|
296
|
+
overview.initTable(true)
|
|
297
|
+
currentlySearching = true
|
|
298
|
+
overview.table!.on("datatable.init", () =>
|
|
299
|
+
overview.table!.search(text)
|
|
300
|
+
)
|
|
301
|
+
} else if (!text.length && currentlySearching) {
|
|
302
|
+
overview.initTable(false)
|
|
303
|
+
currentlySearching = false
|
|
304
|
+
} else if (text.length) {
|
|
305
|
+
overview.table!.search(text)
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
order: 5
|
|
309
|
+
}
|
|
310
|
+
]
|
|
311
|
+
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {DialogTabs, escapeText, localizeDate} from "fwtoolkit"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Template for the unified document import dialog.
|
|
5
|
+
*/
|
|
6
|
+
export const importDocumentTemplate = ({
|
|
7
|
+
templateSelector = "",
|
|
8
|
+
e2eeHtml = "",
|
|
9
|
+
supportedFormatsText = ""
|
|
10
|
+
}: {
|
|
11
|
+
templateSelector?: string
|
|
12
|
+
e2eeHtml?: string
|
|
13
|
+
supportedFormatsText?: string
|
|
14
|
+
}): string =>
|
|
15
|
+
`<form>
|
|
16
|
+
${templateSelector}
|
|
17
|
+
<div class="fw-select-container">
|
|
18
|
+
<div class="fw-select-head">
|
|
19
|
+
<button type="button" class="fw-button fw-light fw-large" id="import-doc-btn">
|
|
20
|
+
${gettext("Select a file")}
|
|
21
|
+
</button>
|
|
22
|
+
<label id="import-doc-name" class="ajax-upload-label"></label>
|
|
23
|
+
</div>
|
|
24
|
+
<input id="doc-uploader" type="file" accept=".fidus,.docx,.odt,.json,.zip" style="display: none;">
|
|
25
|
+
</div>
|
|
26
|
+
${e2eeHtml}
|
|
27
|
+
</form>
|
|
28
|
+
<div class="fw-note-el">${supportedFormatsText}</div>`
|
|
29
|
+
|
|
30
|
+
export const deleteFolderCell = ({subdir, ids}: {subdir: string; ids: number[]}): string =>
|
|
31
|
+
`<span class="delete-folder fw-link-text" data-ids="${ids.join(",")}"
|
|
32
|
+
data-title="${escapeText(subdir)}">
|
|
33
|
+
'<i class="fa-solid fa-trash-alt"></i>
|
|
34
|
+
</span>`
|
|
35
|
+
|
|
36
|
+
export const dateCell = ({date}: {date: number}): {data: string; text: string} => ({
|
|
37
|
+
data: localizeDate(date * 1000, "sortable-date"),
|
|
38
|
+
text: localizeDate(date * 1000, "minutes")
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
interface DialogPart {
|
|
42
|
+
title: string
|
|
43
|
+
description: string
|
|
44
|
+
template: (params: {doc: Record<string, unknown>}) => string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const documentDialogTemplate = ({
|
|
48
|
+
doc,
|
|
49
|
+
dialogParts
|
|
50
|
+
}: {
|
|
51
|
+
doc: Record<string, unknown>
|
|
52
|
+
dialogParts: DialogPart[]
|
|
53
|
+
}): string => {
|
|
54
|
+
const tabs = dialogParts.map((part, index) => ({
|
|
55
|
+
id: `docOptionTab${index}`,
|
|
56
|
+
title: part.title,
|
|
57
|
+
description: part.description,
|
|
58
|
+
template: () => part.template({doc})
|
|
59
|
+
}))
|
|
60
|
+
const dialogTabs = new DialogTabs(tabs as any, {
|
|
61
|
+
containerId: "documentoptions-tab"
|
|
62
|
+
})
|
|
63
|
+
return `<div id="document-dialog">${dialogTabs.render()}</div>`
|
|
64
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import download from "downloadjs"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Dialog,
|
|
5
|
+
addAlert,
|
|
6
|
+
cancelPromise,
|
|
7
|
+
deactivateWait,
|
|
8
|
+
escapeText,
|
|
9
|
+
findTarget,
|
|
10
|
+
get,
|
|
11
|
+
longFilePath,
|
|
12
|
+
post,
|
|
13
|
+
shortFileTitle
|
|
14
|
+
} from "fwtoolkit"
|
|
15
|
+
|
|
16
|
+
import {FidusFileImporter} from "../importer/native/file.js"
|
|
17
|
+
import {documentrevisionsTemplate} from "./templates.js"
|
|
18
|
+
|
|
19
|
+
export class DocumentRevisionsDialog {
|
|
20
|
+
documentId: number
|
|
21
|
+
documentList: Array<Record<string, unknown>>
|
|
22
|
+
user: Record<string, unknown>
|
|
23
|
+
dialog: any
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
documentId: number,
|
|
27
|
+
documentList: Array<Record<string, unknown>>,
|
|
28
|
+
user: Record<string, unknown>
|
|
29
|
+
) {
|
|
30
|
+
this.documentId = documentId
|
|
31
|
+
this.documentList = documentList
|
|
32
|
+
this.user = user
|
|
33
|
+
this.dialog = false
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
init(): Promise<any> {
|
|
37
|
+
const doc = this.documentList.find(doc => doc.id === this.documentId)
|
|
38
|
+
if (!doc) {
|
|
39
|
+
return Promise.reject(new Error("Document not found"))
|
|
40
|
+
}
|
|
41
|
+
this.dialog = new Dialog({
|
|
42
|
+
title: `${gettext("Saved revisions of")} ${escapeText(shortFileTitle(doc.title as string, doc.path as string))}`,
|
|
43
|
+
id: "revisions-dialog",
|
|
44
|
+
width: 620,
|
|
45
|
+
height: 480,
|
|
46
|
+
buttons: [{type: "close"}],
|
|
47
|
+
body: documentrevisionsTemplate({doc})
|
|
48
|
+
} as any)
|
|
49
|
+
this.dialog.open()
|
|
50
|
+
return this.bind()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
bind(): Promise<any> {
|
|
54
|
+
const dialogEl = this.dialog.dialogEl
|
|
55
|
+
|
|
56
|
+
return new Promise(resolve => {
|
|
57
|
+
dialogEl.addEventListener("click", (event: Event) => {
|
|
58
|
+
const el: Record<string, any> = {}
|
|
59
|
+
let revisionId: number
|
|
60
|
+
let revisionFilename: string
|
|
61
|
+
switch (true) {
|
|
62
|
+
case findTarget(event, ".download-revision", el):
|
|
63
|
+
revisionId = Number.parseInt(el.target.dataset.id)
|
|
64
|
+
revisionFilename = el.target.dataset.filename
|
|
65
|
+
this.download(revisionId, revisionFilename)
|
|
66
|
+
break
|
|
67
|
+
case findTarget(event, ".recreate-revision", el):
|
|
68
|
+
revisionId = Number.parseInt(el.target.dataset.id)
|
|
69
|
+
resolve(
|
|
70
|
+
this.recreate(revisionId, this.user)
|
|
71
|
+
)
|
|
72
|
+
break
|
|
73
|
+
case findTarget(event, ".delete-revision", el):
|
|
74
|
+
revisionId = Number.parseInt(el.target.dataset.id)
|
|
75
|
+
resolve(this.delete(revisionId))
|
|
76
|
+
break
|
|
77
|
+
default:
|
|
78
|
+
break
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
recreate(id: number, user: Record<string, unknown>): Promise<any> {
|
|
85
|
+
const doc = this.documentList.find(doc => doc.id === this.documentId)
|
|
86
|
+
if (!doc) {
|
|
87
|
+
return Promise.reject(new Error("Document not found"))
|
|
88
|
+
}
|
|
89
|
+
return get(`/api/document/get_revision/${id}/`)
|
|
90
|
+
.then(response => response.blob())
|
|
91
|
+
.then(blob => {
|
|
92
|
+
const importer = new FidusFileImporter(
|
|
93
|
+
blob,
|
|
94
|
+
user,
|
|
95
|
+
longFilePath(
|
|
96
|
+
doc.title as string,
|
|
97
|
+
doc.path as string,
|
|
98
|
+
`${gettext("Revision of")} `
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
return (importer as any).init()
|
|
102
|
+
})
|
|
103
|
+
.then(({ok, statusText, doc: newDoc}: any) => {
|
|
104
|
+
deactivateWait()
|
|
105
|
+
if (ok) {
|
|
106
|
+
addAlert("info", statusText)
|
|
107
|
+
return {
|
|
108
|
+
action: "added-document",
|
|
109
|
+
doc: newDoc
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
addAlert("error", statusText)
|
|
113
|
+
return Promise.reject(new Error(statusText))
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
download(id: number, filename: string): void {
|
|
119
|
+
get(`/api/document/get_revision/${id}/`)
|
|
120
|
+
.then(response => response.blob())
|
|
121
|
+
.then(blob => download(blob, filename, "application/fidus+zip"))
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
delete(id: number): Promise<any> {
|
|
125
|
+
const buttons: Array<Record<string, unknown>> = []
|
|
126
|
+
const returnPromise = new Promise((resolve, _reject) => {
|
|
127
|
+
buttons.push({
|
|
128
|
+
text: gettext("Delete"),
|
|
129
|
+
classes: "fw-dark",
|
|
130
|
+
click: () => {
|
|
131
|
+
const revisionsConfirmDeleteDialog = buttons_container.dialog
|
|
132
|
+
revisionsConfirmDeleteDialog.close()
|
|
133
|
+
resolve(this.deleteRevision(id))
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
buttons.push({
|
|
137
|
+
type: "cancel",
|
|
138
|
+
click: () => {
|
|
139
|
+
const revisionsConfirmDeleteDialog = buttons_container.dialog
|
|
140
|
+
revisionsConfirmDeleteDialog.close()
|
|
141
|
+
resolve(cancelPromise())
|
|
142
|
+
}
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
const revisionsConfirmDeleteDialog = new Dialog({
|
|
147
|
+
id: "confirmdeletion",
|
|
148
|
+
title: gettext("Confirm deletion"),
|
|
149
|
+
icon: "exclamation-triangle",
|
|
150
|
+
body: `${gettext("Do you really want to delete the revision?")}`,
|
|
151
|
+
height: 80,
|
|
152
|
+
buttons
|
|
153
|
+
} as any)
|
|
154
|
+
|
|
155
|
+
const buttons_container = {dialog: revisionsConfirmDeleteDialog}
|
|
156
|
+
|
|
157
|
+
revisionsConfirmDeleteDialog.open()
|
|
158
|
+
|
|
159
|
+
return returnPromise
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
deleteRevision(id: number): Promise<any> {
|
|
163
|
+
return post("/api/document/delete_revision/", {id})
|
|
164
|
+
.then(() => {
|
|
165
|
+
const thisTr = document.querySelector(`tr.revision-${id}`) as HTMLElement
|
|
166
|
+
const documentId = thisTr.dataset.document
|
|
167
|
+
const doc = this.documentList.find(
|
|
168
|
+
d => d.id === Number.parseInt(documentId!)
|
|
169
|
+
)
|
|
170
|
+
thisTr.parentElement!.removeChild(thisTr)
|
|
171
|
+
addAlert("success", gettext("Revision deleted"))
|
|
172
|
+
return Promise.resolve({
|
|
173
|
+
action: "deleted-revision",
|
|
174
|
+
id,
|
|
175
|
+
doc
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
.catch(() => {
|
|
179
|
+
addAlert("error", gettext("Could not delete revision."))
|
|
180
|
+
return Promise.reject(new Error("Could not delete revision."))
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {escapeText, localizeDate} from "fwtoolkit"
|
|
2
|
+
|
|
3
|
+
export const documentrevisionsTemplate = ({doc}: {doc: Record<string, unknown>}): string =>
|
|
4
|
+
`<table class="fw-data-table" style="width:342px;">
|
|
5
|
+
<thead class="fw-data-table-header">
|
|
6
|
+
<th width="80">${gettext("Time")}</th>
|
|
7
|
+
<th width="300">${gettext("Description")}</th>
|
|
8
|
+
<th width="50">${gettext("Recreate")}</th>
|
|
9
|
+
<th width="50">${gettext("Download")}</th>
|
|
10
|
+
${doc.is_owner ? `<th width="50">${gettext("Delete")}</th>` : ""}
|
|
11
|
+
</thead>
|
|
12
|
+
<tbody class="fw-data-table-body fw-middle">
|
|
13
|
+
${((doc.revisions as Array<Record<string, unknown>>) || [])
|
|
14
|
+
.slice()
|
|
15
|
+
.sort((a, b) => (a.date as number) > (b.date as number) ? 1 : -1)
|
|
16
|
+
.map(
|
|
17
|
+
(rev: Record<string, unknown>) =>
|
|
18
|
+
`<tr class="revision-${rev.pk}" data-document="${doc.id}">
|
|
19
|
+
<td width="80"><span class="fw-inline">
|
|
20
|
+
${localizeDate((rev.date as number) * 1000)}
|
|
21
|
+
</span></td>
|
|
22
|
+
<td width="300"><span class="fw-inline">${escapeText((rev.note as string) || "")}</span></td>
|
|
23
|
+
<td width="50"><span class="fw-inline recreate-revision" data-id="
|
|
24
|
+
${rev.pk}"><i class="fa-solid fa-download"></i></span></td>
|
|
25
|
+
<td width="50"><span class="fw-inline download-revision" data-id="
|
|
26
|
+
${rev.pk}" data-filename="${escapeText((rev.file_name as string) || "")}">
|
|
27
|
+
<i class="fa-solid fa-download"></i>
|
|
28
|
+
</span></td>
|
|
29
|
+
${
|
|
30
|
+
doc.is_owner
|
|
31
|
+
? `<td width="50">
|
|
32
|
+
<span class="fw-inline delete-revision" data-id="${rev.pk}">
|
|
33
|
+
<i class="fa-solid fa-trash"></i>
|
|
34
|
+
</span>
|
|
35
|
+
</td>`
|
|
36
|
+
: ""
|
|
37
|
+
}
|
|
38
|
+
</tr>`
|
|
39
|
+
)
|
|
40
|
+
.join("")}
|
|
41
|
+
</tbody>
|
|
42
|
+
</table>`
|