♻️ Interactive v2 #1

Merged
LittleSheep merged 30 commits from refactor/v2 into master 2024-03-16 08:22:25 +00:00
3 changed files with 34 additions and 19 deletions
Showing only changes of commit fa5b166d88 - Show all commits

View File

@ -62,7 +62,7 @@ func listFeed(c *fiber.Ctx) error {
GROUP BY article_id, moment_id) as reactions GROUP BY article_id, moment_id) as reactions
ON (feed.model_type = 'article' AND feed.id = reactions.article_id) OR ON (feed.model_type = 'article' AND feed.id = reactions.article_id) OR
(feed.model_type = 'moment' AND feed.id = reactions.moment_id) (feed.model_type = 'moment' AND feed.id = reactions.moment_id)
WHERE %s LIMIT ? OFFSET ?`, userTable, commentTable, reactionTable, whereCondition), WHERE %s ORDER BY feed.created_at desc LIMIT ? OFFSET ?`, userTable, commentTable, reactionTable, whereCondition),
database.C.Select(queryArticle).Model(&models.Article{}), database.C.Select(queryArticle).Model(&models.Article{}),
database.C.Select(queryMoment).Model(&models.Moment{}), database.C.Select(queryMoment).Model(&models.Moment{}),
take, take,

View File

@ -53,24 +53,7 @@
</v-form> </v-form>
</v-card> </v-card>
<v-dialog eager v-model="dialogs.plan" class="max-w-[540px]"> <planned-publish v-model:show="dialogs.plan" v-model:value="extras.publishedAt" />
<v-card title="Plan your publish">
<template #text>
<v-text-field
v-model="extras.publishedAt"
class="mt-2"
label="Publish date"
hint="Your post will hidden for public before this time. Leave blank will publish immediately"
variant="outlined"
type="datetime-local"
clearable
/>
</template>
<template #actions>
<v-btn class="ms-auto" text="Ok" @click="dialogs.plan = false"></v-btn>
</template>
</v-card>
</v-dialog>
<v-snackbar v-model="success" :timeout="3000">Your post has been published.</v-snackbar> <v-snackbar v-model="success" :timeout="3000">Your post has been published.</v-snackbar>
@ -83,6 +66,7 @@ import { request } from "@/scripts/request"
import { useEditor } from "@/stores/editor" import { useEditor } from "@/stores/editor"
import { getAtk } from "@/stores/userinfo" import { getAtk } from "@/stores/userinfo"
import { reactive, ref } from "vue" import { reactive, ref } from "vue"
import PlannedPublish from "@/components/publish/parts/PlannedPublish.vue"
const editor = useEditor() const editor = useEditor()

View File

@ -0,0 +1,31 @@
<template>
<v-dialog
eager
class="max-w-[540px]"
:model-value="props.show"
@update:model-value="(val) => emits('update:show', val)"
>
<v-card title="Plan your publish">
<template #text>
<v-text-field
clearable
class="mt-2"
label="Publish date"
hint="Your post will hidden for public before this time. Leave blank will publish immediately"
variant="outlined"
type="datetime-local"
:model-value="props.value"
@update:model-value="(val) => emits('update:value', val)"
/>
</template>
<template #actions>
<v-btn class="ms-auto" text="Ok" @click="emits('update:show', false)"></v-btn>
</template>
</v-card>
</v-dialog>
</template>
<script setup lang="ts">
const props = defineProps<{ show: boolean; value: string | null }>()
const emits = defineEmits(["update:show", "update:value"])
</script>