aboutsummaryrefslogtreecommitdiff
path: root/front-end/src/views/Blog/components/Content.vue
diff options
context:
space:
mode:
Diffstat (limited to 'front-end/src/views/Blog/components/Content.vue')
-rw-r--r--front-end/src/views/Blog/components/Content.vue84
1 files changed, 41 insertions, 43 deletions
diff --git a/front-end/src/views/Blog/components/Content.vue b/front-end/src/views/Blog/components/Content.vue
index 5e81629..568f2d1 100644
--- a/front-end/src/views/Blog/components/Content.vue
+++ b/front-end/src/views/Blog/components/Content.vue
@@ -1,43 +1,3 @@
-<template>
- <div id="content-editor" class="">
- <EditorTable title="Manage content" :show-edit="showEdit" :pagination="pagination" @open-new="openNew">
- <template #table>
- <ContentTable
- :items="items"
- @open-edit="openEdit"
- @copy-link="copyLink"
- @delete="onDelete"
- @download="onDownload"
- />
- </template>
- <template #editor>
- <div v-if="showProgress" class="max-w-xl mx-auto">
- <span id="ProgressLabel" class="sr-only">Loading</span>
-
- <span
- role="progressbar"
- aria-labelledby="ProgressLabel"
- :aria-valuenow="uploadProgress"
- class="relative block bg-gray-200 rounded-full dark:bg-dark-500"
- >
- <span class="absolute inset-0 flex items-center justify-center text-[10px]/4">
- <span class="font-bold text-white "> {{ loadingProgress }} </span>
- </span>
-
- <span class="block h-4 text-center rounded-full bg-primary-600" :style="progressWidth"></span>
- </span>
- </div>
- <ContentEditor
- @submit="onSubmit"
- @close="closeEdit"
- @delete="onDelete"
- />
- </template>
- </EditorTable>
- <a class="hidden" ref="downloadAnchor"></a>
- </div>
-</template>
-
<script setup lang="ts">
import { computed, shallowRef } from 'vue';
import { isEmpty } from 'lodash-es';
@@ -50,7 +10,6 @@ import EditorTable from './EditorTable.vue';
import ContentEditor from './Content/ContentEditor.vue';
import ContentTable from './Content/ContentTable.vue';
-
const store = useStore()
const { uploadProgress } = storeToRefs(store)
const { items, pagination } = store.content.createPages()
@@ -63,7 +22,6 @@ const loadingProgress = computed(() => `${uploadProgress.value}%`);
const progressWidth = computed(() => ({ width: `${uploadProgress.value}%` }));
const showProgress = computed(() => uploadProgress.value > 0 && uploadProgress.value < 100);
-
const openEdit = async (item: ContentMeta) => store.content.selectedId = item.id
const closeEdit = (update?: boolean) => {
@@ -173,4 +131,44 @@ const onDownload = async (item: ContentMeta) => {
})
}
-</script> \ No newline at end of file
+</script>
+
+<template>
+ <div id="content-editor" class="">
+ <EditorTable title="Manage content" :show-edit="showEdit" :pagination="pagination" @open-new="openNew">
+ <template #table>
+ <ContentTable
+ :items="items"
+ @open-edit="openEdit"
+ @copy-link="copyLink"
+ @delete="onDelete"
+ @download="onDownload"
+ />
+ </template>
+ <template #editor>
+ <div v-if="showProgress" class="max-w-xl mx-auto">
+ <span id="ProgressLabel" class="sr-only">Loading</span>
+
+ <span
+ role="progressbar"
+ aria-labelledby="ProgressLabel"
+ :aria-valuenow="uploadProgress"
+ class="relative block bg-gray-200 rounded-full dark:bg-dark-500"
+ >
+ <span class="absolute inset-0 flex items-center justify-center text-[10px]/4">
+ <span class="font-bold text-white "> {{ loadingProgress }} </span>
+ </span>
+
+ <span class="block h-4 text-center rounded-full bg-primary-600" :style="progressWidth"></span>
+ </span>
+ </div>
+ <ContentEditor
+ @submit="onSubmit"
+ @close="closeEdit"
+ @delete="onDelete"
+ />
+ </template>
+ </EditorTable>
+ <a class="hidden" ref="downloadAnchor"></a>
+ </div>
+</template> \ No newline at end of file