Add inline admin create forms to home page components
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 28s

Lazy-load create forms (Post, Activity, Favorite, Rowing) directly
into their corresponding home components with an admin-only toggle
button, replacing the need to navigate to the admin page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 12:13:13 +01:00
parent 66f32cdbd2
commit a911e6ca69
8 changed files with 78 additions and 10 deletions

View File

@@ -3,6 +3,8 @@ import Button from "@/components/input/Button.vue";
import { ref } from "vue";
import axios from "axios";
const emit = defineEmits(["done", "cancel"]);
const images = ref([]);
const results = ref([]);
@@ -35,6 +37,7 @@ async function submit() {
);
images.value = [];
emit("done");
}
</script>
@@ -43,6 +46,7 @@ async function submit() {
<h1>Create Rowing</h1>
<input type="file" accept="image/jpeg,image/png,image/gif,image/webp" multiple @change="onFileChange" />
<Button @click="submit">Upload</Button>
<Button @click="emit('cancel')">Cancel</Button>
<div v-for="r in results" :key="r.name">
<span class="text-primary">{{ r.name }}: </span>
<span :class="r.ok ? 'text-secondary' : 'text-red-500'">{{ r.status }}</span>