diff --git a/README.md b/README.md index d6136a8..e568155 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ - [x] list option: move completed below - [x] list option: hide completed - [x] options in cookies -- [ ] Empty list message +- [x] Empty list message - [x] change lang - [ ] toasts - [ ] handle errors diff --git a/resources/lang/en.json b/resources/lang/en.json index e2d4761..fd3635e 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -42,6 +42,8 @@ "resets": "Resets", "completed": "Completed", "new_task_hint": "New task", + "empty_hint": "Looks like there's nothing here, start by adding a new task.", + "all_completed_hint": "Looks like everything's been done!", "options": { "title": "Options", "sort_by": "Sort by", diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 5e60904..1d2c099 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -42,6 +42,8 @@ "resets": "Reviens", "completed": "Complété", "new_task_hint": "Nouvelle tâche", + "empty_hint": "On dirait qu'il n'y a rien ici, commence par ajouter une tâche.", + "all_completed_hint": "On dirait bien que tout a été fait !", "options": { "title": "Options", "sort_by": "Trier par", diff --git a/resources/ts/components/TaskList.vue b/resources/ts/components/TaskList.vue index 1100c92..72b4d02 100644 --- a/resources/ts/components/TaskList.vue +++ b/resources/ts/components/TaskList.vue @@ -19,6 +19,8 @@ const showNextReset = booleanCookieRef("toutDouxShowNextReset", false); const separateCompleted = booleanCookieRef("toutDouxSeparateCompleted", false); const hasCompleted = computed(() => tasks.value.some(taskCompleted)); +const empty = computed(() => tasks.value.length === 0); +const allCompleted = computed(() => tasks.value.every(taskCompleted)); function fetchTasks() { void getTasks(list.value) @@ -88,6 +90,12 @@ onBeforeMount(fetchTasks); /> +
  • + {{ $t('empty_hint') }} +
  • +
  • + {{ $t('all_completed_hint') }} +