From 6eae88f4e9d8d2875d6f087764fbce6382d0ed24 Mon Sep 17 00:00:00 2001 From: FernandoJVideira <03.pleaser-minster@icloud.com> Date: Fri, 23 Jan 2026 17:29:04 +0000 Subject: [PATCH] feat: basic toggle post visibility --- app/components/ui/modal/CreatePostModal.vue | 648 ++++++++++---------- app/pages/admin/users/index.vue | 2 +- app/pages/index.vue | 34 +- app/pages/profile/index.vue | 21 +- 4 files changed, 343 insertions(+), 362 deletions(-) diff --git a/app/components/ui/modal/CreatePostModal.vue b/app/components/ui/modal/CreatePostModal.vue index aa73f73..b72548d 100644 --- a/app/components/ui/modal/CreatePostModal.vue +++ b/app/components/ui/modal/CreatePostModal.vue @@ -1,330 +1,320 @@ - - - - - - - - - - - - Submit New Publication - - - - - - - - - - - - - - - - Upload a file - - - or drag and drop - - - Selected: {{ uploadForm.file.name }} - - - - - - - Title - - {{ errors.title }} - - - Type - - Conference Paper - - - - - - - Abstract ({{ uploadForm.abstract.length }}/2000) - - - {{ errors.abstract }} - - - - - - Authors - - - - - - - - - - - {{ author }} - - - - - - - - - - - Tags - - - No tags - - { - const idx = uploadForm.selectedTagIds.indexOf(tag.id); - if (idx > -1) uploadForm.selectedTagIds.splice(idx, 1); - else uploadForm.selectedTagIds.push(tag.id); - }" :class="[ - uploadForm.selectedTagIds.includes(tag.id) - ? getTagClass(tag.id) + ' border-transparent' - : 'bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-400' - ]" - class="px-3 py-1.5 rounded-full border text-xs font-bold uppercase tracking-tight transition-all shadow-sm whitespace-nowrap"> - {{ tag.name }} - - - - - - - - - {{ isSubmitting ? 'Uploading...' : 'Submit' }} - - - Cancel - - - - - - + + + + + + + + + + + + Submit New Publication + + + + + + + + + + + + + + + + Upload a file + + + or drag and drop + + + Selected: {{ uploadForm.file.name }} + + + + + + + Title + + {{ errors.title }} + + + Type + + Conference Paper + + + + + + + Abstract ({{ uploadForm.abstract.length }}/2000) + + + {{ errors.abstract }} + + + + + + Authors + + + + + + + + + + + {{ author }} + + + + + + + + + + + Tags + + + No tags + + { + const idx = uploadForm.selectedTagIds.indexOf(tag.id); + if (idx > -1) uploadForm.selectedTagIds.splice(idx, 1); + else uploadForm.selectedTagIds.push(tag.id); + }"> + {{ tag.name }} + + + + + + + + + {{ isSubmitting ? 'Uploading...' : 'Submit' }} + + + Cancel + + + + + + \ No newline at end of file diff --git a/app/pages/admin/users/index.vue b/app/pages/admin/users/index.vue index 52f568d..87dc9a6 100644 --- a/app/pages/admin/users/index.vue +++ b/app/pages/admin/users/index.vue @@ -497,7 +497,7 @@ const config = useRuntimeConfig(); const api = config.public.apiBase; const authStore = useAuthStore(); const { token } = storeToRefs(authStore); -const notifications = useNotifications(); +const notifications = useNotificationStore(); const users = ref([]); const loading = ref(false); diff --git a/app/pages/index.vue b/app/pages/index.vue index c526c27..c4aec5f 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -127,26 +127,20 @@ - - - - ▲ + @click.stop="votePost(post, 1)">▲ {{ post.rating }} ▼ + @click.stop="votePost(post, -1)">▼ @@ -159,17 +153,9 @@ year: 'numeric', month: 'long', day: 'numeric' }) }} - - - - - - + :title="post.hidden ? 'Unhide' : 'Hide'" @click.stop="toggleHide(post)"> - @@ -482,15 +468,15 @@ const checkQueryForModal = () => { const toggleHide = async (post) => { try { - const newState = !post.isHidden; + const newState = !post.hidden; - await $fetch(`${api}/publications/${post.id}`, { + await $fetch(`${api}/publications/${post.id}/hide`, { method: 'PATCH', headers: { Authorization: `Bearer ${token.value}` }, - body: { isHidden: newState } + body: { is_hidden: newState } }); - post.isHidden = newState; + post.hidden = newState; notifications.success(`Post ${newState ? 'hidden' : 'restored'}`); } catch (err) { diff --git a/app/pages/profile/index.vue b/app/pages/profile/index.vue index be5a498..97a4664 100644 --- a/app/pages/profile/index.vue +++ b/app/pages/profile/index.vue @@ -618,7 +618,7 @@
or drag and drop
- Selected: {{ uploadForm.file.name }} -
{{ errors.title }}
{{ errors.abstract }}
+ Selected: {{ uploadForm.file.name }} +