mirror of
https://github.com/Floriansylvain/RenewCMS.git
synced 2026-08-19 11:43:22 +02:00
Implemented article creation/edition draft
This commit is contained in:
@@ -117,6 +117,9 @@ span {
|
|||||||
font-size: var(--font-body);
|
font-size: var(--font-body);
|
||||||
font-weight: var(--medium-weight);
|
font-weight: var(--medium-weight);
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
background-color: var(--primary);
|
background-color: var(--primary);
|
||||||
|
|
||||||
transition: background-color 150ms, color 150ms;
|
transition: background-color 150ms, color 150ms;
|
||||||
@@ -134,6 +137,11 @@ span {
|
|||||||
background-color: var(--primary-verylight);
|
background-color: var(--primary-verylight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button-secondary:active {
|
||||||
|
background-color: var(--primary-light);
|
||||||
|
color: var(--neutral-dark);
|
||||||
|
}
|
||||||
|
|
||||||
.button-primary:hover {
|
.button-primary:hover {
|
||||||
background-color: var(--primary-light);
|
background-color: var(--primary-light);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { createRouter, createWebHistory, type NavigationGuard } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import { useAuthStore } from '@/stores/AuthStore'
|
import { useAuthStore } from '@/stores/AuthStore'
|
||||||
import { nextTick } from 'vue'
|
import { nextTick } from 'vue'
|
||||||
import Debug from '@/views/Debug.vue'
|
import Debug from '@/views/Debug.vue'
|
||||||
import Login from '@/views/Login.vue'
|
import Login from '@/views/Login.vue'
|
||||||
import Home from '@/views/Home.vue'
|
import Home from '@/views/Home.vue'
|
||||||
import Articles from '@/views/Articles.vue'
|
import Articles from '@/views/Articles.vue'
|
||||||
import Edition from '@/views/Edition.vue'
|
import ArticlesEdit from '@/views/ArticlesEdit.vue'
|
||||||
|
import ArticlesNew from '@/views/ArticlesNew.vue'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
@@ -45,7 +46,15 @@ const router = createRouter({
|
|||||||
{
|
{
|
||||||
path: '/articles/edit/:articleID',
|
path: '/articles/edit/:articleID',
|
||||||
name: 'edition',
|
name: 'edition',
|
||||||
component: Edition,
|
component: ArticlesEdit,
|
||||||
|
meta: {
|
||||||
|
title: 'GohCMS - Edition'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/articles/new',
|
||||||
|
name: 'edition',
|
||||||
|
component: ArticlesNew,
|
||||||
meta: {
|
meta: {
|
||||||
title: 'GohCMS - Edition'
|
title: 'GohCMS - Edition'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { RouterLink } from 'vue-router'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<p>articles page</p>
|
<main>
|
||||||
|
<RouterLink class="button-primary" to="/articles/new">Créer un article</RouterLink>
|
||||||
|
</main>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
main {
|
||||||
|
padding: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
main>a {
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -5,8 +5,7 @@ import { useRoute } from 'vue-router';
|
|||||||
import tinymceScriptSrc from '@/assets/tinymce/tinymce.min.js?url'
|
import tinymceScriptSrc from '@/assets/tinymce/tinymce.min.js?url'
|
||||||
|
|
||||||
const articleID = useRoute().params.articleID
|
const articleID = useRoute().params.articleID
|
||||||
const defaultData = `<h1>Bienvenue</h1><p>Vous êtes en mode <em>édition</em> d'article.</p><p>Celui-ci semble encore neuf ! Supprimez ces lignes et laissez libre cours à votre imagination :)</p><p>Pour plus d'infos, rendez-vous sur la <a title="Attention, rickroll incoming" href="https:/www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank" rel="noopener">page d'aide</a>.</p>`
|
const editorData: Ref<string> = ref('')
|
||||||
const editorData: Ref<string> = ref(defaultData)
|
|
||||||
|
|
||||||
console.log(articleID)
|
console.log(articleID)
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { RouterLink } from 'vue-router'
|
||||||
|
|
||||||
|
const defaultData = `<h1>Bienvenue</h1><p>Vous êtes en mode <em>édition</em> d'article.</p><p>Celui-ci semble encore neuf ! Supprimez ces lignes et laissez libre cours à votre imagination :)</p><p>Pour plus d'infos, rendez-vous sur la <a title="Attention, rickroll incoming" href="https:/www.youtube.com/watch?v=dQw4w9WgXcQ" target="_blank" rel="noopener">page d'aide</a>.</p>`
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<main>
|
||||||
|
<h2>Créer un nouvel article</h2>
|
||||||
|
<form @submit.prevent="">
|
||||||
|
<div class="inputs-group">
|
||||||
|
<div class="label-input">
|
||||||
|
<label for="title">Titre de l'article</label>
|
||||||
|
<input id="title" name="title" placeholder="" type="text">
|
||||||
|
<p>⚠️ Ce titre servira d'identifiant, il doit être unique !</p>
|
||||||
|
</div>
|
||||||
|
<div class="label-input">
|
||||||
|
<label for="page">Page</label>
|
||||||
|
<input id="page" name="page" placeholder="" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="buttons-group">
|
||||||
|
<RouterLink class="button-secondary" type="submit" to="/articles">Annuler</RouterLink>
|
||||||
|
<button class="button-primary" type="submit">Créer</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</main>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
main {
|
||||||
|
padding: 0 64px;
|
||||||
|
max-width: 100%;
|
||||||
|
width: 560px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
margin: 32px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons-group a,
|
||||||
|
.buttons-group button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputs-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user