Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41e94c8bcb | ||
|
|
765f3e1f8a | ||
|
|
fb48f64ed8 | ||
|
|
5ae0684d39 | ||
|
|
ea9a50a2f7 | ||
|
|
5e60b5ad20 | ||
|
|
f811facff8 | ||
|
|
db9ecb4773 | ||
|
|
51801f67f9 | ||
|
|
fe41547ced |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tout-doux",
|
"name": "tout-doux",
|
||||||
"version": "1.0.5",
|
"version": "1.2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 78 KiB |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "tout-doux"
|
name = "tout-doux"
|
||||||
version = "1.0.5"
|
version = "1.2.0"
|
||||||
description = ""
|
description = ""
|
||||||
requires-python = ">=3.14"
|
requires-python = ">=3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
+22
-13
@@ -12,27 +12,36 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.bg-hero {
|
.bg-hero {
|
||||||
--size: 5vh;
|
--size: 15vh;
|
||||||
--angle: 45deg;
|
--angle: 45deg;
|
||||||
background: repeating-linear-gradient(
|
background: repeating-linear-gradient(
|
||||||
var(--angle),
|
var(--angle),
|
||||||
var(--color-base-200) calc(0 * var(--size)),
|
var(--color-base-200) 0%,
|
||||||
var(--color-base-200) calc(1 * var(--size)),
|
var(--color-base-200) 12.5%,
|
||||||
var(--color-secondary) calc(1 * var(--size)),
|
var(--color-secondary) 12.5%,
|
||||||
var(--color-secondary) calc(2 * var(--size)),
|
var(--color-secondary) 25%,
|
||||||
var(--color-base-200) calc(2 * var(--size)),
|
var(--color-base-200) 25%,
|
||||||
var(--color-base-200) calc(3 * var(--size)),
|
var(--color-base-200) 37.5%,
|
||||||
var(--color-accent) calc(3 * var(--size)),
|
var(--color-accent) 37.5%,
|
||||||
var(--color-accent) calc(4 * var(--size)),
|
var(--color-accent) 50%,
|
||||||
var(--color-base-200) calc(4 * var(--size))
|
var(--color-base-200) 50%,
|
||||||
|
var(--color-base-200) 62.5%,
|
||||||
|
var(--color-secondary) 62.5%,
|
||||||
|
var(--color-secondary) 75%,
|
||||||
|
var(--color-base-200) 75%,
|
||||||
|
var(--color-base-200) 87.5%,
|
||||||
|
var(--color-accent) 87.5%,
|
||||||
|
var(--color-accent) 100%,
|
||||||
|
var(--color-base-200) 100%
|
||||||
);
|
);
|
||||||
background-size: calc(4 * var(--size) / sin(var(--angle)))
|
background-repeat: repeat;
|
||||||
calc(4 * var(--size) / sin(var(--angle)));
|
background-size: calc(var(--size) / sin(var(--angle)))
|
||||||
|
calc(var(--size) / sin(var(--angle)));
|
||||||
animation: BackgroundAnimate 10s linear infinite reverse;
|
animation: BackgroundAnimate 10s linear infinite reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes BackgroundAnimate {
|
@keyframes BackgroundAnimate {
|
||||||
0% {
|
0% {
|
||||||
background-position: calc(4 * var(--size) / sin(var(--angle))) 0;
|
background-position: calc(var(--size) / sin(var(--angle))) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,5 +78,11 @@
|
|||||||
"call_to_action": "Create your list below:",
|
"call_to_action": "Create your list below:",
|
||||||
"home_button": "Let's go !",
|
"home_button": "Let's go !",
|
||||||
"share_button": "Share my list",
|
"share_button": "Share my list",
|
||||||
"share_text": "Check my list on Tout Doux!"
|
"share_text": "Check my list on Tout Doux!",
|
||||||
|
"add_button": "Add task",
|
||||||
|
"cancel_button": "Cancel editing",
|
||||||
|
"save_button": "Save task",
|
||||||
|
"clone_button": "Clone task",
|
||||||
|
"delete_button": "Delete task",
|
||||||
|
"recent": "Recent lists"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,5 +78,11 @@
|
|||||||
"call_to_action": "Créez ta liste ci-dessous :",
|
"call_to_action": "Créez ta liste ci-dessous :",
|
||||||
"home_button": "C'est parti !",
|
"home_button": "C'est parti !",
|
||||||
"share_button": "Partager ma liste",
|
"share_button": "Partager ma liste",
|
||||||
"share_text": "Regarde ma liste sur Tout Doux!"
|
"share_text": "Regarde ma liste sur Tout Doux!",
|
||||||
|
"add_button": "Ajouter la tâche",
|
||||||
|
"cancel_button": "Annuler la modification",
|
||||||
|
"save_button": "Sauvegarder la tâche",
|
||||||
|
"clone_button": "Cloner la tâche",
|
||||||
|
"delete_button": "Supprimer la tâche",
|
||||||
|
"recent": "Listes récentes"
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-5
@@ -25,13 +25,19 @@ onMounted(() => {
|
|||||||
<div class="hero bg-hero grow">
|
<div class="hero bg-hero grow">
|
||||||
<div class="hero-content text-center p-0">
|
<div class="hero-content text-center p-0">
|
||||||
<div
|
<div
|
||||||
class="max-w-md min-w-96 bg-base-100 rounded-box shadow-md"
|
class="max-w-md min-w-96 bg-base-100 rounded-box shadow-md p-4"
|
||||||
>
|
>
|
||||||
<h1
|
<router-link
|
||||||
class="p-4 pb-2 text-4xl font-bold opacity-60 tracking-wide select-none"
|
to="/"
|
||||||
|
class="text-4xl font-bold opacity-60 tracking-wide select-none"
|
||||||
>
|
>
|
||||||
<list-todo-icon :stroke-width="3" :size="32" class="inline" /> Tout Doux
|
<list-todo-icon
|
||||||
</h1>
|
:stroke-width="3"
|
||||||
|
:size="32"
|
||||||
|
class="inline"
|
||||||
|
/>
|
||||||
|
Tout Doux
|
||||||
|
</router-link>
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
import { ref, onBeforeMount, watch } from "vue";
|
import { ref, onBeforeMount, watch } from "vue";
|
||||||
import { getCron, parseCron, validCron } from "@/lib/cron";
|
import { getCron, parseCron, validCron } from "@/lib/cron";
|
||||||
import { CronType } from "@/enums";
|
import { CronType } from "@/enums";
|
||||||
import { DEFAULT_CRON } from "@/constants";
|
|
||||||
|
const DEFAULT_CRON = "0 0 * * *";
|
||||||
|
|
||||||
const cron = defineModel<string | null>({ required: true });
|
const cron = defineModel<string | null>({ required: true });
|
||||||
const rawCron = ref<string>(DEFAULT_CRON);
|
const rawCron = ref<string>(DEFAULT_CRON);
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ArrowBigRightDashIcon } from "@lucide/vue";
|
||||||
|
|
||||||
|
defineProps<{ list: string }>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<router-link
|
||||||
|
:to="`/${list}`"
|
||||||
|
class="w-full flex gap-2 mb-2 hover:underline"
|
||||||
|
>
|
||||||
|
<arrow-big-right-dash-icon :size="16" class="inline" /> {{ list }}
|
||||||
|
</router-link>
|
||||||
|
</template>
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeMount, ref, watch, computed, defineAsyncComponent, nextTick } from "vue";
|
import {
|
||||||
|
onBeforeMount,
|
||||||
|
ref,
|
||||||
|
watch,
|
||||||
|
computed,
|
||||||
|
defineAsyncComponent,
|
||||||
|
nextTick,
|
||||||
|
} from "vue";
|
||||||
import type { Task } from "@/types";
|
import type { Task } from "@/types";
|
||||||
import { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue";
|
import { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue";
|
||||||
import { updateTask } from "@/api/tasks";
|
import { updateTask } from "@/api/tasks";
|
||||||
@@ -151,7 +158,11 @@ watch(task, () => {
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="list-col-grow flex flex-col gap-2">
|
<div class="list-col-grow flex flex-col gap-2">
|
||||||
<div class="flex justify-evenly">
|
<div class="flex justify-evenly">
|
||||||
<button class="btn btn-square me-1" @click="onClose">
|
<button
|
||||||
|
class="btn btn-square me-1"
|
||||||
|
:title="$t('cancel_button')"
|
||||||
|
@click="onClose"
|
||||||
|
>
|
||||||
<x-icon />
|
<x-icon />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -159,14 +170,23 @@ watch(task, () => {
|
|||||||
:class="
|
:class="
|
||||||
editName.trim().length === 0 ? 'btn-disabled' : ''
|
editName.trim().length === 0 ? 'btn-disabled' : ''
|
||||||
"
|
"
|
||||||
|
:title="$t('save_button')"
|
||||||
@click="onSave"
|
@click="onSave"
|
||||||
>
|
>
|
||||||
<save-icon />
|
<save-icon />
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-square me-1" @click="onClone">
|
<button
|
||||||
|
class="btn btn-square me-1"
|
||||||
|
:title="$t('clone_button')"
|
||||||
|
@click="onClone"
|
||||||
|
>
|
||||||
<copy-icon />
|
<copy-icon />
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-square" @click="onDelete">
|
<button
|
||||||
|
class="btn btn-square"
|
||||||
|
:title="$t('delete_button')"
|
||||||
|
@click="onDelete"
|
||||||
|
>
|
||||||
<trash-icon />
|
<trash-icon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export const DEFAULT_CRON = "0 0 * * *";
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getCookie, setCookie } from "./cookies";
|
import { getCookie, setCookie } from "@/lib/cookies";
|
||||||
|
|
||||||
export function getLang() {
|
export function getLang() {
|
||||||
const params = new URLSearchParams(document.location.search);
|
const params = new URLSearchParams(document.location.search);
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import { ref } from "vue";
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import { getCookie, setCookie } from "@/lib/cookies";
|
||||||
|
|
||||||
|
const COOKIE_NAME = "recent-lists";
|
||||||
|
const MAX_RECENT_LISTS = 32;
|
||||||
|
|
||||||
|
export const useListStore = defineStore("lists", () => {
|
||||||
|
const lists = ref<string[]>([]);
|
||||||
|
|
||||||
|
const rawData = getCookie(COOKIE_NAME, "");
|
||||||
|
if (rawData) {
|
||||||
|
lists.value = rawData.split(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
function addList(list: string) {
|
||||||
|
lists.value = [list]
|
||||||
|
.concat(lists.value)
|
||||||
|
.filter((v, i, a) => a.indexOf(v) === i)
|
||||||
|
.slice(0, MAX_RECENT_LISTS);
|
||||||
|
setCookie(COOKIE_NAME, lists.value.join(","));
|
||||||
|
}
|
||||||
|
|
||||||
|
return { lists, addList };
|
||||||
|
});
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ArrowBigRightDashIcon, DicesIcon } from "@lucide/vue";
|
import { useListStore } from "@/stores/lists";
|
||||||
|
import { ArrowBigRightDashIcon, DicesIcon, HistoryIcon } from "@lucide/vue";
|
||||||
import { generateSlug } from "random-word-slugs";
|
import { generateSlug } from "random-word-slugs";
|
||||||
import { onBeforeMount, ref } from "vue";
|
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
|
||||||
import { onBeforeRouteUpdate } from "vue-router";
|
import { onBeforeRouteUpdate } from "vue-router";
|
||||||
|
const RecentItem = defineAsyncComponent(
|
||||||
|
() => import("@/components/RecentItem.vue"),
|
||||||
|
);
|
||||||
|
|
||||||
const listNameInput = ref<string>(generateSlug(4));
|
const listNameInput = ref<string>(generateSlug(4));
|
||||||
|
|
||||||
|
const { lists: recentLists } = useListStore();
|
||||||
|
|
||||||
function onRandom() {
|
function onRandom() {
|
||||||
listNameInput.value = generateSlug(4);
|
listNameInput.value = generateSlug(4);
|
||||||
}
|
}
|
||||||
@@ -19,19 +25,18 @@ function onInput() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateTitle() {
|
function updateTitle() {
|
||||||
document.title = 'Tout Doux';
|
document.title = "Tout Doux";
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(updateTitle)
|
onBeforeMount(updateTitle);
|
||||||
onBeforeRouteUpdate(updateTitle);
|
onBeforeRouteUpdate(updateTitle);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="p-4">
|
<div class="italic mt-4 text-xl font-extralight">
|
||||||
<div
|
{{ $t("home") }}<br />{{ $t("call_to_action") }}
|
||||||
class="mb-4 italic text-xl font-extralight"
|
</div>
|
||||||
>{{ $t('home') }}<br/>{{ $t('call_to_action') }}</div>
|
<div class="flex gap-2 mt-4">
|
||||||
<div class="flex gap-2 mb-4">
|
|
||||||
<input
|
<input
|
||||||
v-model="listNameInput"
|
v-model="listNameInput"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -43,9 +48,9 @@ onBeforeRouteUpdate(updateTitle);
|
|||||||
<dices-icon />
|
<dices-icon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full">
|
<div class="mt-4">
|
||||||
<router-link
|
<router-link
|
||||||
class="btn btn-lg px-4"
|
class="btn btn-lg"
|
||||||
:class="listNameInput.trim().length === 0 ? 'btn-disabled' : ''"
|
:class="listNameInput.trim().length === 0 ? 'btn-disabled' : ''"
|
||||||
:to="`/${listNameInput.trim()}`"
|
:to="`/${listNameInput.trim()}`"
|
||||||
>
|
>
|
||||||
@@ -53,5 +58,21 @@ onBeforeRouteUpdate(updateTitle);
|
|||||||
{{ $t("home_button") }}
|
{{ $t("home_button") }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="recentLists.length"
|
||||||
|
class="mt-4 -mb-4 lh collapse collapse-arrow font-light text-sm"
|
||||||
|
>
|
||||||
|
<input id="recent-dropdown p-0" type="checkbox" />
|
||||||
|
<div class="collapse-title p-0 content-center">
|
||||||
|
<history-icon class="inline" :size="16" />
|
||||||
|
{{ $t("recent") }}
|
||||||
|
</div>
|
||||||
|
<div class="collapse-content">
|
||||||
|
<recent-item
|
||||||
|
v-for="(list, i) in recentLists"
|
||||||
|
:key="`recent-${i}`"
|
||||||
|
:list="list"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
CircleCheckBigIcon,
|
CircleCheckBigIcon,
|
||||||
CheckCheckIcon,
|
CheckCheckIcon,
|
||||||
SearchIcon,
|
SearchIcon,
|
||||||
Share2Icon
|
Share2Icon,
|
||||||
} from "@lucide/vue";
|
} from "@lucide/vue";
|
||||||
const TaskItem = defineAsyncComponent(
|
const TaskItem = defineAsyncComponent(
|
||||||
() => import("@/components/TaskItem.vue"),
|
() => import("@/components/TaskItem.vue"),
|
||||||
@@ -19,8 +19,9 @@ import { SortType } from "@/enums";
|
|||||||
import { booleanCookieRef, enumCookieRef } from "@/lib/cookies";
|
import { booleanCookieRef, enumCookieRef } from "@/lib/cookies";
|
||||||
import { useAlertStore } from "@/stores/alerts";
|
import { useAlertStore } from "@/stores/alerts";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { onBeforeRouteUpdate, useRoute } from "vue-router";
|
import { onBeforeRouteLeave, onBeforeRouteUpdate, useRoute } from "vue-router";
|
||||||
import { shareLink } from "@/lib/share";
|
import { shareLink } from "@/lib/share";
|
||||||
|
import { useListStore } from "@/stores/lists";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
@@ -28,6 +29,7 @@ const list = ref<string | null>(null);
|
|||||||
const loading = ref<boolean>(true);
|
const loading = ref<boolean>(true);
|
||||||
const taskInput = ref<string>("");
|
const taskInput = ref<string>("");
|
||||||
const tasks = ref<Task[]>([]);
|
const tasks = ref<Task[]>([]);
|
||||||
|
const refreshTimeout = ref<number>(0);
|
||||||
|
|
||||||
const sortType = enumCookieRef<SortType>("sSortType", SortType.CREATED_AT);
|
const sortType = enumCookieRef<SortType>("sSortType", SortType.CREATED_AT);
|
||||||
const sortReverse = booleanCookieRef("sortReverse", false);
|
const sortReverse = booleanCookieRef("sortReverse", false);
|
||||||
@@ -48,15 +50,21 @@ const allCompleted = computed<boolean>(
|
|||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
|
|
||||||
const { alertSuccess, alertError, alertWarning } = useAlertStore();
|
const { alertSuccess, alertError, alertWarning } = useAlertStore();
|
||||||
|
const { addList } = useListStore();
|
||||||
|
|
||||||
function fetchTasks() {
|
function fetchTasks(requestedList: string) {
|
||||||
if (list.value) {
|
const initialList = list.value;
|
||||||
|
if (list.value === requestedList) {
|
||||||
getTasks(list.value)
|
getTasks(list.value)
|
||||||
.then((data: Task[]) => {
|
.then((data: Task[]) => {
|
||||||
|
if (list.value === initialList) {
|
||||||
tasks.value = data;
|
tasks.value = data;
|
||||||
reSortTasks();
|
reSortTasks(true);
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
setTimeout(fetchTasks, 10000);
|
refreshTimeout.value = setTimeout(() => {
|
||||||
|
fetchTasks(list.value ?? "");
|
||||||
|
}, 10000);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
if (tasks.value.length !== 0) {
|
if (tasks.value.length !== 0) {
|
||||||
@@ -68,9 +76,14 @@ function fetchTasks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reSortTasks() {
|
function reSortTasks(update = false) {
|
||||||
tasks.value = sortTasks(tasks.value, sortType.value, sortReverse.value);
|
tasks.value = sortTasks(tasks.value, sortType.value, sortReverse.value);
|
||||||
|
if (update) {
|
||||||
updateTitle();
|
updateTitle();
|
||||||
|
if (tasks.value.length && list.value) {
|
||||||
|
addList(list.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onNewTask() {
|
function onNewTask() {
|
||||||
@@ -81,7 +94,7 @@ function onNewTask() {
|
|||||||
})
|
})
|
||||||
.then((data: Task) => {
|
.then((data: Task) => {
|
||||||
tasks.value.push(data);
|
tasks.value.push(data);
|
||||||
reSortTasks();
|
reSortTasks(true);
|
||||||
alertSuccess(i18n.t("alerts.task_created"));
|
alertSuccess(i18n.t("alerts.task_created"));
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@@ -93,6 +106,10 @@ function onNewTask() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onUpdateTask() {
|
||||||
|
reSortTasks(true);
|
||||||
|
}
|
||||||
|
|
||||||
function onCloneTask(task: Task) {
|
function onCloneTask(task: Task) {
|
||||||
if (list.value) {
|
if (list.value) {
|
||||||
createTask(list.value, {
|
createTask(list.value, {
|
||||||
@@ -101,6 +118,7 @@ function onCloneTask(task: Task) {
|
|||||||
})
|
})
|
||||||
.then((data: Task) => {
|
.then((data: Task) => {
|
||||||
tasks.value.push(data);
|
tasks.value.push(data);
|
||||||
|
reSortTasks(true);
|
||||||
alertSuccess(i18n.t("alerts.task_cloned"));
|
alertSuccess(i18n.t("alerts.task_cloned"));
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@@ -112,6 +130,7 @@ function onCloneTask(task: Task) {
|
|||||||
function onDeleteTask(task: Task) {
|
function onDeleteTask(task: Task) {
|
||||||
deleteTask(task.id)
|
deleteTask(task.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
reSortTasks(true);
|
||||||
alertSuccess(i18n.t("alerts.task_deleted"));
|
alertSuccess(i18n.t("alerts.task_deleted"));
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@@ -130,10 +149,11 @@ function onChangeSortReverse() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onShare() {
|
function onShare() {
|
||||||
|
if (!empty.value) {
|
||||||
shareLink(
|
shareLink(
|
||||||
`Tout Doux - ${list.value ?? ''}`,
|
`Tout Doux - ${list.value ?? ""}`,
|
||||||
i18n.t('share_text'),
|
i18n.t("share_text"),
|
||||||
`${document.location.href.split('?')[0] ?? ''}?lang=${i18n.locale.value}`
|
`${document.location.href.split("?")[0] ?? ""}?lang=${i18n.locale.value}`,
|
||||||
)
|
)
|
||||||
.then((viaShare) => {
|
.then((viaShare) => {
|
||||||
if (!viaShare) {
|
if (!viaShare) {
|
||||||
@@ -141,74 +161,85 @@ function onShare() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
alertError(i18n.t("alerts.share_error"))
|
alertError(i18n.t("alerts.share_error"));
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTitle() {
|
function updateTitle() {
|
||||||
if (list.value !== null) {
|
if (list.value !== null) {
|
||||||
document.title = `Tout Doux - ${list.value} (${completedCount.value.toFixed(0)}/${taskCount.value.toFixed(0)})`
|
document.title = `Tout Doux - ${list.value} (${completedCount.value.toFixed(0)}/${taskCount.value.toFixed(0)})`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
list.value = (route.params.list as string).slice(0, 128);
|
list.value = (route.params.list as string).slice(0, 128);
|
||||||
fetchTasks();
|
fetchTasks(list.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
onBeforeRouteUpdate((to) => {
|
onBeforeRouteUpdate((to) => {
|
||||||
list.value = (to.params.list as string).slice(0, 128);
|
list.value = (to.params.list as string).slice(0, 128);
|
||||||
fetchTasks();
|
fetchTasks(list.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
onBeforeRouteLeave(() => {
|
||||||
|
clearTimeout(refreshTimeout.value);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="list-row italic text-sm font-extralight self-center">
|
<div
|
||||||
|
class="list-row italic text-sm font-extralight self-center"
|
||||||
|
:class="!empty ? 'cursor-pointer hover:underline' : ''"
|
||||||
|
:title="!empty ? $t('share_button') : ''"
|
||||||
|
@click="onShare"
|
||||||
|
>
|
||||||
{{ list }}
|
{{ list }}
|
||||||
<span v-if="taskCount">({{ completedCount }} / {{ taskCount }})</span>
|
<span v-if="!empty"
|
||||||
|
>({{ completedCount }} / {{ taskCount }}) <share-2-icon
|
||||||
|
class="inline"
|
||||||
|
:size="16"
|
||||||
|
:stroke-width="1"
|
||||||
|
/></span>
|
||||||
</div>
|
</div>
|
||||||
<ul class="list">
|
<div
|
||||||
|
v-if="!loading && empty"
|
||||||
|
class="mt-4 mb-4 italic text-xl font-extralight"
|
||||||
|
>
|
||||||
|
<search-icon class="inline" />
|
||||||
|
<span v-html="$t('empty_hint')"></span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="!loading && allCompleted && separateCompleted"
|
||||||
|
class="mt-4 mb-4 italic text-xl font-extralight"
|
||||||
|
>
|
||||||
|
<check-check-icon class="inline" />
|
||||||
|
<span v-html="$t('all_completed_hint')"></span>
|
||||||
|
</div>
|
||||||
|
<ul v-else class="list">
|
||||||
<template v-for="(task, i) in tasks" :key="task.id">
|
<template v-for="(task, i) in tasks" :key="task.id">
|
||||||
<li v-if="tasks[i] && (!separateCompleted || !taskCompleted(task))">
|
<li v-if="tasks[i] && (!separateCompleted || !taskCompleted(task))">
|
||||||
<task-item
|
<task-item
|
||||||
v-model="tasks[i]"
|
v-model="tasks[i]"
|
||||||
:show-last-checked="showLastChecked"
|
:show-last-checked="showLastChecked"
|
||||||
:show-next-reset="showNextReset"
|
:show-next-reset="showNextReset"
|
||||||
@updated="updateTitle"
|
@updated="onUpdateTask"
|
||||||
@clone="onCloneTask"
|
@clone="onCloneTask"
|
||||||
@delete="onDeleteTask"
|
@delete="onDeleteTask"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
<li
|
|
||||||
v-if="!loading && empty"
|
|
||||||
class="list-row italic text-xl font-extralight self-center"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
><search-icon class="inline" />
|
|
||||||
<span v-html="$t('empty_hint')"></span
|
|
||||||
></span>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
v-else-if="!loading && allCompleted && separateCompleted"
|
|
||||||
class="list-row italic text-xl font-extralight self-center"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
><check-check-icon class="inline" />
|
|
||||||
<span v-html="$t('all_completed_hint')"></span
|
|
||||||
></span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div
|
<div
|
||||||
v-if="separateCompleted && hasCompleted"
|
v-if="separateCompleted && hasCompleted"
|
||||||
class="collapse collapse-arrow"
|
class="collapse collapse-arrow mb-4"
|
||||||
>
|
>
|
||||||
<input id="completed-dropdown" type="checkbox" />
|
<input id="completed-dropdown p-0" type="checkbox" />
|
||||||
<div class="collapse-title mb-0">
|
<div class="collapse-title p-0 content-center">
|
||||||
<circle-check-big-icon class="inline" :size="24" />
|
<circle-check-big-icon class="inline" :size="24" />
|
||||||
{{ $t("completed") }} ({{ completedCount }})
|
{{ $t("completed") }} ({{ completedCount }})
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse-content p-0">
|
<div class="collapse-content p-0 -mb-4">
|
||||||
<ul class="list">
|
<ul class="list">
|
||||||
<template
|
<template
|
||||||
v-for="(task, i) in tasks"
|
v-for="(task, i) in tasks"
|
||||||
@@ -227,7 +258,7 @@ onBeforeRouteUpdate((to) => {
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2 p-4">
|
<div class="flex gap-2">
|
||||||
<input
|
<input
|
||||||
v-model="taskInput"
|
v-model="taskInput"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -238,19 +269,18 @@ onBeforeRouteUpdate((to) => {
|
|||||||
<button
|
<button
|
||||||
class="btn btn-square"
|
class="btn btn-square"
|
||||||
:disabled="loading || taskInput.trim().length === 0"
|
:disabled="loading || taskInput.trim().length === 0"
|
||||||
|
:title="$t('add_button')"
|
||||||
@click="onNewTask"
|
@click="onNewTask"
|
||||||
>
|
>
|
||||||
<circle-plus-icon />
|
<circle-plus-icon />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div
|
||||||
<button class="btn btn-sm px-4" @click="onShare">
|
v-if="!empty"
|
||||||
<share-2-icon class="inline" :size="16" /> {{ $t('share_button') }}
|
class="mt-4 -mb-4 collapse collapse-arrow font-light text-sm"
|
||||||
</button>
|
>
|
||||||
</div>
|
<input id="options-dropdown p-0" type="checkbox" />
|
||||||
<div class="collapse collapse-arrow font-light text-sm">
|
<div class="collapse-title p-0 content-center">
|
||||||
<input id="options-dropdown" type="checkbox" />
|
|
||||||
<div class="collapse-title">
|
|
||||||
<settings-2-icon class="inline" :size="16" />
|
<settings-2-icon class="inline" :size="16" />
|
||||||
{{ $t("options.title") }}
|
{{ $t("options.title") }}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,18 +4,20 @@ import { onBeforeMount } from "vue";
|
|||||||
import { onBeforeRouteUpdate } from "vue-router";
|
import { onBeforeRouteUpdate } from "vue-router";
|
||||||
|
|
||||||
function updateTitle() {
|
function updateTitle() {
|
||||||
document.title = 'Tout Doux - Not Found';
|
document.title = "Tout Doux - Not Found";
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeMount(updateTitle)
|
onBeforeMount(updateTitle);
|
||||||
onBeforeRouteUpdate(updateTitle);
|
onBeforeRouteUpdate(updateTitle);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="italic text-xl font-extralight mb-4">
|
<div class="italic text-xl font-extralight mt-4">
|
||||||
<circle-question-mark-icon class="inline" /> {{ $t('not_found') }}
|
<circle-question-mark-icon class="inline" /> {{ $t("not_found") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full">
|
<div class="w-full mt-4">
|
||||||
<router-link to="/" class="btn mb-4 px-4">{{ $t('not_found_button') }}</router-link>
|
<router-link to="/" class="btn">{{
|
||||||
|
$t("not_found_button")
|
||||||
|
}}</router-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ asyncpg = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tout-doux"
|
name = "tout-doux"
|
||||||
version = "1.0.5"
|
version = "1.2.0"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "flask", extra = ["async"] },
|
{ name = "flask", extra = ["async"] },
|
||||||
|
|||||||
Reference in New Issue
Block a user