Author SHA1 Message Date
klemek 4300e901ab chore: 1.3.0
Python Lint CI / ruff (push) Successful in 15m11s
Python Lint CI / ruff-format-check (push) Successful in 14m39s
Python Lint CI / ty (push) Successful in 11m57s
TS Lint / ESLint (push) Successful in 8m40s
TS Lint / Oxlint (push) Successful in 7m58s
Docker Build / build (push) Successful in 24m31s
TS Lint / TypeScript (push) Successful in 7m5s
2026-07-16 16:37:02 +02:00
klemek 6a0e162596 feat: metadata
Docker Build / build (push) Has been cancelled
Python Lint CI / ruff (push) Has been cancelled
Python Lint CI / ruff-format-check (push) Has been cancelled
Python Lint CI / ty (push) Has been cancelled
TS Lint / ESLint (push) Has been cancelled
TS Lint / Oxlint (push) Has been cancelled
TS Lint / TypeScript (push) Has been cancelled
2026-07-16 16:36:55 +02:00
klemek 603bd9f108 fix: local data before sending to server
TS Lint / Oxlint (push) Successful in 58s
TS Lint / TypeScript (push) Successful in 1m17s
TS Lint / ESLint (push) Successful in 1m17s
Docker Build / build (push) Successful in 13m28s
2026-07-16 15:54:34 +02:00
klemek 41e94c8bcb chore: 1.2.0
Python Lint CI / ruff (push) Successful in 6m27s
Python Lint CI / ty (push) Successful in 9m24s
Python Lint CI / ruff-format-check (push) Successful in 10m28s
TS Lint / ESLint (push) Successful in 11m35s
Docker Build / build (push) Successful in 19m33s
TS Lint / Oxlint (push) Successful in 10m26s
TS Lint / TypeScript (push) Successful in 9m7s
2026-07-16 11:47:43 +02:00
klemek 765f3e1f8a feat: title as menu link and updated lists history
Docker Build / build (push) Has been cancelled
TS Lint / ESLint (push) Has been cancelled
TS Lint / Oxlint (push) Has been cancelled
TS Lint / TypeScript (push) Has been cancelled
2026-07-16 11:47:35 +02:00
klemek fb48f64ed8 fix: paddings and margins
TS Lint / Oxlint (push) Successful in 57s
TS Lint / TypeScript (push) Successful in 1m8s
TS Lint / ESLint (push) Successful in 1m28s
Docker Build / build (push) Successful in 8m40s
2026-07-16 11:28:18 +02:00
klemek 5ae0684d39 chore: 1.1.0
Python Lint CI / ruff (push) Successful in 6m31s
Python Lint CI / ruff-format-check (push) Successful in 6m46s
Python Lint CI / ty (push) Successful in 6m58s
TS Lint / ESLint (push) Successful in 6m6s
TS Lint / TypeScript (push) Successful in 5m55s
TS Lint / Oxlint (push) Successful in 5m56s
Docker Build / build (push) Successful in 13m56s
2026-07-15 16:34:53 +02:00
klemek ea9a50a2f7 feat: recent lists
Docker Build / build (push) Has been cancelled
TS Lint / ESLint (push) Has been cancelled
TS Lint / Oxlint (push) Has been cancelled
TS Lint / TypeScript (push) Has been cancelled
2026-07-15 16:34:37 +02:00
klemek 5e60b5ad20 feat: hide unnecessary options at first
TS Lint / ESLint (push) Successful in 3m55s
TS Lint / TypeScript (push) Successful in 4m45s
TS Lint / Oxlint (push) Successful in 4m45s
Docker Build / build (push) Successful in 8m53s
2026-07-15 16:10:06 +02:00
klemek f811facff8 feat: add titles to icon-only buttons
Docker Build / build (push) Has been cancelled
TS Lint / ESLint (push) Has been cancelled
TS Lint / Oxlint (push) Has been cancelled
TS Lint / TypeScript (push) Has been cancelled
2026-07-15 16:08:52 +02:00
klemek db9ecb4773 fix: preview
TS Lint / Oxlint (push) Successful in 3m42s
TS Lint / ESLint (push) Successful in 3m42s
TS Lint / TypeScript (push) Successful in 3m44s
Docker Build / build (push) Successful in 9m19s
2026-07-15 15:49:34 +02:00
klemek 51801f67f9 fix: animated background 2026-07-15 15:49:29 +02:00
klemek fe41547ced fix: better preview 2026-07-15 15:22:05 +02:00
22 changed files with 393 additions and 173 deletions
+13
View File
@@ -6,6 +6,7 @@ import flask_limiter
import flask_limiter.util
import gunicorn.app.base
import tortoise
from tortoise.functions import Count
from app import PKG_NAME
from app.lang import get_lang
@@ -56,6 +57,18 @@ class Server(gunicorn.app.base.BaseApplication):
lang=lambda key: get_lang(locale, key),
)
@self.app.route("/api/meta", methods=["GET"])
async def metadata() -> dict:
return {
"tasks": await Task.all().count(),
"lists": (
await Task.all()
.annotate(count=Count("list_name", distinct=True))
.first()
.values("count")
)["count"],
}
@self.app.route("/api/lists/<list_name>/tasks", methods=["GET"])
async def get_tasks(list_name: str) -> list:
return await Task.filter(list_name=list_name[:128]).values()
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "tout-doux",
"version": "1.0.5",
"version": "1.3.0",
"private": true,
"type": "module",
"engines": {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 78 KiB

+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "tout-doux"
version = "1.0.5"
version = "1.3.0"
description = ""
requires-python = ">=3.14"
dependencies = [
+22 -13
View File
@@ -12,27 +12,36 @@ body {
}
.bg-hero {
--size: 5vh;
--size: 15vh;
--angle: 45deg;
background: repeating-linear-gradient(
var(--angle),
var(--color-base-200) calc(0 * var(--size)),
var(--color-base-200) calc(1 * var(--size)),
var(--color-secondary) calc(1 * var(--size)),
var(--color-secondary) calc(2 * var(--size)),
var(--color-base-200) calc(2 * var(--size)),
var(--color-base-200) calc(3 * var(--size)),
var(--color-accent) calc(3 * var(--size)),
var(--color-accent) calc(4 * var(--size)),
var(--color-base-200) calc(4 * var(--size))
var(--color-base-200) 0%,
var(--color-base-200) 12.5%,
var(--color-secondary) 12.5%,
var(--color-secondary) 25%,
var(--color-base-200) 25%,
var(--color-base-200) 37.5%,
var(--color-accent) 37.5%,
var(--color-accent) 50%,
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)))
calc(4 * var(--size) / sin(var(--angle)));
background-repeat: repeat;
background-size: calc(var(--size) / sin(var(--angle)))
calc(var(--size) / sin(var(--angle)));
animation: BackgroundAnimate 10s linear infinite reverse;
}
@keyframes BackgroundAnimate {
0% {
background-position: calc(4 * var(--size) / sin(var(--angle))) 0;
background-position: calc(var(--size) / sin(var(--angle))) 0;
}
}
+8 -1
View File
@@ -78,5 +78,12 @@
"call_to_action": "Create your list below:",
"home_button": "Let's go !",
"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",
"metadata": "{lists} lists / {tasks} tasks"
}
+8 -1
View File
@@ -78,5 +78,12 @@
"call_to_action": "Créez ta liste ci-dessous :",
"home_button": "C'est parti !",
"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",
"metadata": "{lists} listes / {tasks} tâches"
}
+11 -5
View File
@@ -25,13 +25,19 @@ onMounted(() => {
<div class="hero bg-hero grow">
<div class="hero-content text-center p-0">
<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
class="p-4 pb-2 text-4xl font-bold opacity-60 tracking-wide select-none"
<router-link
to="/"
class="text-4xl font-bold opacity-60 tracking-wide select-none"
>
<list-todo-icon :stroke-width="3" :size="32" class="inline" /> Tout Doux
</h1>
<list-todo-icon
:stroke-width="3"
:size="32"
class="inline"
/>
Tout Doux
</router-link>
<router-view />
</div>
</div>
+6
View File
@@ -0,0 +1,6 @@
import type { Metadata } from "@/types";
export async function getMetadata(): Promise<Metadata> {
const response = await fetch(`/api/meta`);
return await response.json();
}
+2 -1
View File
@@ -2,7 +2,8 @@
import { ref, onBeforeMount, watch } from "vue";
import { getCron, parseCron, validCron } from "@/lib/cron";
import { CronType } from "@/enums";
import { DEFAULT_CRON } from "@/constants";
const DEFAULT_CRON = "0 0 * * *";
const cron = defineModel<string | null>({ required: true });
const rawCron = ref<string>(DEFAULT_CRON);
+16 -1
View File
@@ -1,9 +1,23 @@
<script setup lang="ts">
import { defineAsyncComponent } from "vue";
import { getMetadata } from "@/api/meta";
import type { Metadata } from "@/types";
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
const metadata = ref<Metadata|null>(null);
const LangInput = defineAsyncComponent(
() => import("@/components/LangInput.vue"),
);
function fetchMetadata() {
void getMetadata()
.then((data) => {
metadata.value = data;
setTimeout(fetchMetadata, 600000);
});
}
onBeforeMount(fetchMetadata);
</script>
<template>
@@ -19,6 +33,7 @@ const LangInput = defineAsyncComponent(
>
klemek
</a>
<span v-if="metadata">- {{ $t("metadata", metadata) }}</span>
</p>
</aside>
</footer>
+14
View File
@@ -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>
+57 -21
View File
@@ -1,12 +1,19 @@
<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 { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue";
import { updateTask } from "@/api/tasks";
const CronInput = defineAsyncComponent(
() => import("@/components/CronInput.vue"),
);
import { taskCompleted, taskNextReset } from "@/lib/tasks";
import { isTemporary, taskCompleted, taskNextReset } from "@/lib/tasks";
import { relativeTime } from "@/lib/dates";
import { useAlertStore } from "@/stores/alerts";
import { useI18n } from "vue-i18n";
@@ -31,10 +38,12 @@ const i18n = useI18n();
const { alertSuccess, alertError } = useAlertStore();
async function onOpen() {
if (!isTemporary(task.value)) {
editMode.value = true;
await nextTick();
editNameInput.value?.focus();
}
}
function onClose() {
editName.value = task.value.name;
@@ -44,10 +53,14 @@ function onClose() {
function onSave() {
if (editName.value.trim()) {
updateTask(task.value.id, {
const data = {
name: editName.value.trim(),
reset_cron: editCron.value,
})
};
task.value.name = editName.value.trim();
task.value.reset_cron = editCron.value;
editMode.value = false;
updateTask(task.value.id, data)
.then((newTask) => {
task.value = newTask;
emit("updated", newTask);
@@ -56,47 +69,56 @@ function onSave() {
.catch(() => {
alertError(i18n.t("alerts.task_update_error"));
});
task.value.name = editName.value;
task.value.reset_cron = editCron.value;
editMode.value = false;
}
}
function onCheck() {
if (!isTemporary(task.value)) {
if (!checked.value) {
updateTask(task.value.id, {
const data = {
check_date: new Date().toISOString(),
previous_check_date: task.value.check_date?.toISOString(),
})
.then((newTask) => {
task.value = newTask;
emit("updated", newTask);
};
task.value.previous_check_date = task.value.check_date;
task.value.check_date = new Date();
updateTask(task.value.id, data)
.then((data) => {
task.value = data;
emit("updated", data);
})
.catch(() => {
alertError(i18n.t("alerts.task_update_error"));
});
} else {
updateTask(task.value.id, {
const data = {
check_date: null,
previous_check_date: task.value.check_date?.toISOString(),
})
.then((newTask) => {
task.value = newTask;
emit("updated", newTask);
};
task.value.previous_check_date = task.value.check_date;
task.value.check_date = null;
updateTask(task.value.id, data)
.then((data) => {
task.value = data;
emit("updated", data);
})
.catch(() => {
alertError(i18n.t("alerts.task_update_error"));
});
}
}
}
function onClone() {
if (!isTemporary(task.value)) {
emit("clone", task.value);
}
}
function onDelete() {
if (!isTemporary(task.value)) {
emit("delete", task.value);
}
}
onBeforeMount(() => {
editName.value = task.value.name;
@@ -105,6 +127,7 @@ onBeforeMount(() => {
refreshKey.value++;
}, 60000);
});
watch(task, () => {
if (!editMode.value && task.value.name !== editName.value) {
editName.value = task.value.name;
@@ -124,7 +147,7 @@ watch(task, () => {
type="checkbox"
class="checkbox"
:checked="checked"
@click.prevent="onCheck"
@click="onCheck"
/>
</div>
<div
@@ -151,7 +174,11 @@ watch(task, () => {
<template v-else>
<div class="list-col-grow flex flex-col gap-2">
<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 />
</button>
<button
@@ -159,14 +186,23 @@ watch(task, () => {
:class="
editName.trim().length === 0 ? 'btn-disabled' : ''
"
:title="$t('save_button')"
@click="onSave"
>
<save-icon />
</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 />
</button>
<button class="btn btn-square" @click="onDelete">
<button
class="btn btn-square"
:title="$t('delete_button')"
@click="onDelete"
>
<trash-icon />
</button>
</div>
-1
View File
@@ -1 +0,0 @@
export const DEFAULT_CRON = "0 0 * * *";
+1 -1
View File
@@ -1,4 +1,4 @@
import { getCookie, setCookie } from "./cookies";
import { getCookie, setCookie } from "@/lib/cookies";
export function getLang() {
const params = new URLSearchParams(document.location.search);
+19 -1
View File
@@ -1,7 +1,9 @@
import { SortType } from "@/enums";
import type { RawTask, Task } from "@/types";
import type { RawTask, Task, TaskCreateData } from "@/types";
import { CronExpressionParser } from "cron-parser";
const TEMPORARY_ID = "tmp";
export function parseTask(task: RawTask): Task {
return {
id: task.id,
@@ -16,6 +18,22 @@ export function parseTask(task: RawTask): Task {
};
}
export function newTemporaryTask(data: TaskCreateData): Task {
return {
id: TEMPORARY_ID,
name: data.name,
reset_cron: data.reset_cron,
created_at: new Date(),
updated_at: new Date(),
check_date: null,
previous_check_date: null,
}
}
export function isTemporary(task: Task): boolean {
return task.id === TEMPORARY_ID;
}
export function taskNextReset(task: Task): Date | null {
if (task.check_date === null || task.reset_cron === null) {
return null;
+25
View File
@@ -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 };
});
+5
View File
@@ -46,3 +46,8 @@ export interface Alert {
created: Date;
seconds: number;
}
export interface Metadata {
tasks: number;
lists: number;
}
+32 -11
View File
@@ -1,11 +1,17 @@
<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 { onBeforeMount, ref } from "vue";
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
import { onBeforeRouteUpdate } from "vue-router";
const RecentItem = defineAsyncComponent(
() => import("@/components/RecentItem.vue"),
);
const listNameInput = ref<string>(generateSlug(4));
const { lists: recentLists } = useListStore();
function onRandom() {
listNameInput.value = generateSlug(4);
}
@@ -19,19 +25,18 @@ function onInput() {
}
function updateTitle() {
document.title = 'Tout Doux';
document.title = "Tout Doux";
}
onBeforeMount(updateTitle)
onBeforeMount(updateTitle);
onBeforeRouteUpdate(updateTitle);
</script>
<template>
<div class="p-4">
<div
class="mb-4 italic text-xl font-extralight"
>{{ $t('home') }}<br/>{{ $t('call_to_action') }}</div>
<div class="flex gap-2 mb-4">
<div class="italic mt-4 text-xl font-extralight">
{{ $t("home") }}<br />{{ $t("call_to_action") }}
</div>
<div class="flex gap-2 mt-4">
<input
v-model="listNameInput"
type="text"
@@ -43,9 +48,9 @@ onBeforeRouteUpdate(updateTitle);
<dices-icon />
</button>
</div>
<div class="w-full">
<div class="mt-4">
<router-link
class="btn btn-lg px-4"
class="btn btn-lg"
:class="listNameInput.trim().length === 0 ? 'btn-disabled' : ''"
:to="`/${listNameInput.trim()}`"
>
@@ -53,5 +58,21 @@ onBeforeRouteUpdate(updateTitle);
{{ $t("home_button") }}
</router-link>
</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>
</template>
+95 -59
View File
@@ -9,18 +9,19 @@ import {
CircleCheckBigIcon,
CheckCheckIcon,
SearchIcon,
Share2Icon
Share2Icon,
} from "@lucide/vue";
const TaskItem = defineAsyncComponent(
() => import("@/components/TaskItem.vue"),
);
import { taskCompleted, sortTasks } from "@/lib/tasks";
import { taskCompleted, sortTasks, newTemporaryTask } from "@/lib/tasks";
import { SortType } from "@/enums";
import { booleanCookieRef, enumCookieRef } from "@/lib/cookies";
import { useAlertStore } from "@/stores/alerts";
import { useI18n } from "vue-i18n";
import { onBeforeRouteUpdate, useRoute } from "vue-router";
import { onBeforeRouteLeave, onBeforeRouteUpdate, useRoute } from "vue-router";
import { shareLink } from "@/lib/share";
import { useListStore } from "@/stores/lists";
const route = useRoute();
@@ -28,6 +29,7 @@ const list = ref<string | null>(null);
const loading = ref<boolean>(true);
const taskInput = ref<string>("");
const tasks = ref<Task[]>([]);
const refreshTimeout = ref<number>(0);
const sortType = enumCookieRef<SortType>("sSortType", SortType.CREATED_AT);
const sortReverse = booleanCookieRef("sortReverse", false);
@@ -48,15 +50,21 @@ const allCompleted = computed<boolean>(
const i18n = useI18n();
const { alertSuccess, alertError, alertWarning } = useAlertStore();
const { addList } = useListStore();
function fetchTasks() {
if (list.value) {
function fetchTasks(requestedList: string) {
const initialList = list.value;
if (list.value === requestedList) {
getTasks(list.value)
.then((data: Task[]) => {
if (list.value === initialList) {
tasks.value = data;
reSortTasks();
reSortTasks(true);
loading.value = false;
setTimeout(fetchTasks, 10000);
refreshTimeout.value = setTimeout(() => {
fetchTasks(list.value ?? "");
}, 10000);
}
})
.catch(() => {
if (tasks.value.length !== 0) {
@@ -68,20 +76,28 @@ function fetchTasks() {
}
}
function reSortTasks() {
function reSortTasks(update = false) {
tasks.value = sortTasks(tasks.value, sortType.value, sortReverse.value);
if (update) {
updateTitle();
if (tasks.value.length && list.value) {
addList(list.value);
}
}
}
function onNewTask() {
if (taskInput.value.trim() && list.value && !loading.value) {
createTask(list.value, {
const data = {
name: taskInput.value.trim(),
reset_cron: null,
})
};
const task = newTemporaryTask(data);
tasks.value.push(task);
reSortTasks(true);
createTask(list.value, data)
.then((data: Task) => {
tasks.value.push(data);
reSortTasks();
task.id = data.id;
alertSuccess(i18n.t("alerts.task_created"));
})
.catch(() => {
@@ -93,14 +109,23 @@ function onNewTask() {
}
}
function onUpdateTask() {
reSortTasks(true);
}
function onCloneTask(task: Task) {
if (list.value) {
createTask(list.value, {
const data = {
name: task.name,
reset_cron: task.reset_cron,
})
};
const newTask = newTemporaryTask(data);
tasks.value.push(newTask);
reSortTasks(true);
createTask(list.value, data)
.then((data: Task) => {
tasks.value.push(data);
task.id = data.id;
reSortTasks(true);
alertSuccess(i18n.t("alerts.task_cloned"));
})
.catch(() => {
@@ -110,6 +135,8 @@ function onCloneTask(task: Task) {
}
function onDeleteTask(task: Task) {
tasks.value.splice(tasks.value.indexOf(task), 1);
reSortTasks(true);
deleteTask(task.id)
.then(() => {
alertSuccess(i18n.t("alerts.task_deleted"));
@@ -117,8 +144,6 @@ function onDeleteTask(task: Task) {
.catch(() => {
alertError(i18n.t("alerts.task_delete_error"));
});
tasks.value.splice(tasks.value.indexOf(task), 1);
}
function onChangeSortType() {
@@ -130,10 +155,11 @@ function onChangeSortReverse() {
}
function onShare() {
if (!empty.value) {
shareLink(
`Tout Doux - ${list.value ?? ''}`,
i18n.t('share_text'),
`${document.location.href.split('?')[0] ?? ''}?lang=${i18n.locale.value}`
`Tout Doux - ${list.value ?? ""}`,
i18n.t("share_text"),
`${document.location.href.split("?")[0] ?? ""}?lang=${i18n.locale.value}`,
)
.then((viaShare) => {
if (!viaShare) {
@@ -141,74 +167,85 @@ function onShare() {
}
})
.catch(() => {
alertError(i18n.t("alerts.share_error"))
alertError(i18n.t("alerts.share_error"));
});
}
}
function updateTitle() {
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(() => {
list.value = (route.params.list as string).slice(0, 128);
fetchTasks();
fetchTasks(list.value);
});
onBeforeRouteUpdate((to) => {
list.value = (to.params.list as string).slice(0, 128);
fetchTasks();
fetchTasks(list.value);
});
onBeforeRouteLeave(() => {
clearTimeout(refreshTimeout.value);
});
</script>
<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 }}
<span v-if="taskCount">({{ completedCount }} / {{ taskCount }})</span>
<span v-if="!empty"
>({{ completedCount }} / {{ taskCount }})&nbsp;<share-2-icon
class="inline"
:size="16"
:stroke-width="1"
/></span>
</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">
<li v-if="tasks[i] && (!separateCompleted || !taskCompleted(task))">
<task-item
v-model="tasks[i]"
:show-last-checked="showLastChecked"
:show-next-reset="showNextReset"
@updated="updateTitle"
@updated="onUpdateTask"
@clone="onCloneTask"
@delete="onDeleteTask"
/>
</li>
</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>
<div
v-if="separateCompleted && hasCompleted"
class="collapse collapse-arrow"
class="collapse collapse-arrow mb-4"
>
<input id="completed-dropdown" type="checkbox" />
<div class="collapse-title mb-0">
<input id="completed-dropdown p-0" type="checkbox" />
<div class="collapse-title p-0 content-center">
<circle-check-big-icon class="inline" :size="24" />
{{ $t("completed") }} ({{ completedCount }})
</div>
<div class="collapse-content p-0">
<div class="collapse-content p-0 -mb-4">
<ul class="list">
<template
v-for="(task, i) in tasks"
@@ -227,7 +264,7 @@ onBeforeRouteUpdate((to) => {
</ul>
</div>
</div>
<div class="flex gap-2 p-4">
<div class="flex gap-2">
<input
v-model="taskInput"
type="text"
@@ -238,19 +275,18 @@ onBeforeRouteUpdate((to) => {
<button
class="btn btn-square"
:disabled="loading || taskInput.trim().length === 0"
:title="$t('add_button')"
@click="onNewTask"
>
<circle-plus-icon />
</button>
</div>
<div>
<button class="btn btn-sm px-4" @click="onShare">
<share-2-icon class="inline" :size="16" /> {{ $t('share_button') }}
</button>
</div>
<div class="collapse collapse-arrow font-light text-sm">
<input id="options-dropdown" type="checkbox" />
<div class="collapse-title">
<div
v-if="!empty"
class="mt-4 -mb-4 collapse collapse-arrow font-light text-sm"
>
<input id="options-dropdown p-0" type="checkbox" />
<div class="collapse-title p-0 content-center">
<settings-2-icon class="inline" :size="16" />
{{ $t("options.title") }}
</div>
+8 -6
View File
@@ -4,18 +4,20 @@ import { onBeforeMount } from "vue";
import { onBeforeRouteUpdate } from "vue-router";
function updateTitle() {
document.title = 'Tout Doux - Not Found';
document.title = "Tout Doux - Not Found";
}
onBeforeMount(updateTitle)
onBeforeMount(updateTitle);
onBeforeRouteUpdate(updateTitle);
</script>
<template>
<div class="italic text-xl font-extralight mb-4">
<circle-question-mark-icon class="inline" /> {{ $t('not_found') }}
<div class="italic text-xl font-extralight mt-4">
<circle-question-mark-icon class="inline" /> {{ $t("not_found") }}
</div>
<div class="w-full">
<router-link to="/" class="btn mb-4 px-4">{{ $t('not_found_button') }}</router-link>
<div class="w-full mt-4">
<router-link to="/" class="btn">{{
$t("not_found_button")
}}</router-link>
</div>
</template>
Generated
+1 -1
View File
@@ -323,7 +323,7 @@ asyncpg = [
[[package]]
name = "tout-doux"
version = "1.0.5"
version = "1.3.0"
source = { editable = "." }
dependencies = [
{ name = "flask", extra = ["async"] },