diff --git a/components/AppBreadcrumb.vue b/components/AppBreadcrumb.vue index 3764017..857533b 100644 --- a/components/AppBreadcrumb.vue +++ b/components/AppBreadcrumb.vue @@ -1,16 +1,20 @@ diff --git a/components/HomeMenuCards2.vue b/components/HomeMenuCards2.vue deleted file mode 100644 index 7f27210..0000000 --- a/components/HomeMenuCards2.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - \ No newline at end of file diff --git a/components/HomeNews.vue b/components/HomeNews.vue new file mode 100644 index 0000000..dbf4b69 --- /dev/null +++ b/components/HomeNews.vue @@ -0,0 +1,72 @@ + + + diff --git a/components/NewsletterForm.vue b/components/NewsletterForm.vue index 5804a37..4efb893 100644 --- a/components/NewsletterForm.vue +++ b/components/NewsletterForm.vue @@ -1,64 +1,85 @@ \ No newline at end of file +}; + diff --git a/components/NewsletterModal.vue b/components/NewsletterModal.vue index 02701e9..29a7303 100644 --- a/components/NewsletterModal.vue +++ b/components/NewsletterModal.vue @@ -10,23 +10,22 @@ \ No newline at end of file +defineExpose({ open, close }); + diff --git a/components/PromesseResume.vue b/components/PromesseResume.vue index 72c72b1..b58dd88 100644 --- a/components/PromesseResume.vue +++ b/components/PromesseResume.vue @@ -1,60 +1,78 @@ \ No newline at end of file + diff --git a/components/ScrollToTopButton.vue b/components/ScrollToTopButton.vue index 31380aa..e461b35 100644 --- a/components/ScrollToTopButton.vue +++ b/components/ScrollToTopButton.vue @@ -1,27 +1,31 @@ \ No newline at end of file + + Sommaire + + diff --git a/components/footer.vue b/components/footer.vue deleted file mode 100644 index 59b29c2..0000000 --- a/components/footer.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - - - \ No newline at end of file diff --git a/components/submenu.vue b/components/submenu.vue index 03db88e..2917a63 100644 --- a/components/submenu.vue +++ b/components/submenu.vue @@ -1,28 +1,25 @@ \ No newline at end of file + + diff --git a/composables/useInstitution.ts b/composables/useInstitution.ts new file mode 100644 index 0000000..f4622a5 --- /dev/null +++ b/composables/useInstitution.ts @@ -0,0 +1,15 @@ +// composables/useInstitution.ts + +export function getInstitutionColor(index: number): string { + const colors = [ + "#4299E1", + "#48BB78", + "#ED8936", + "#ECC94B", + "#9F7AEA", + "#ED64A6", + "#38B2AC", + "#F56565", + ]; + return colors[index % colors.length]; +} diff --git a/composables/usePromesseStatus.ts b/composables/usePromesseStatus.ts new file mode 100644 index 0000000..1dc7bb9 --- /dev/null +++ b/composables/usePromesseStatus.ts @@ -0,0 +1,53 @@ +// composables/useStatus.ts + +export function getStatusIcon(status: string): string { + const statusIcons: { [key: string]: string } = { + "non tenue": "i-heroicons-x-circle", + "en cours": "i-heroicons-arrow-path", + tenue: "i-heroicons-check-circle", + "non évaluée": "i-heroicons-question-mark-circle", + }; + + return ( + statusIcons[status.toLowerCase()] || "i-heroicons-question-mark-circle" + ); +} + +export function getStatusBackgroundClass(status: string): string { + switch (status.toLowerCase()) { + case "tenue": + return "bg-green-100"; + case "non tenue": + return "bg-red-100"; + case "en cours": + return "bg-yellow-100"; + default: + return "bg-gray-100"; + } +} + +export function getStatusIconClass(status: string): string { + switch (status.toLowerCase()) { + case "tenue": + return "text-green-600"; + case "non tenue": + return "text-red-600"; + case "en cours": + return "text-yellow-600"; + default: + return "text-gray-600"; + } +} + +export function getStatusTextClass(status: string): string { + switch (status.toLowerCase()) { + case "tenue": + return "text-green-800"; + case "non tenue": + return "text-red-800"; + case "en cours": + return "text-yellow-800"; + default: + return "text-gray-800"; + } +} diff --git a/layouts/default.vue b/layouts/default.vue index 6a5211c..9f9495a 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/plugins/utils.ts b/plugins/utils.ts index 2e3fa5b..b275228 100644 --- a/plugins/utils.ts +++ b/plugins/utils.ts @@ -27,7 +27,7 @@ export default defineNuxtPlugin(() => { const day = date.getDate(); const month = monthNames[date.getMonth()]; const year = date.getFullYear(); - var days = [ + const days = [ "Dimanche", "Lundi", "Mardi", @@ -36,7 +36,7 @@ export default defineNuxtPlugin(() => { "Vendredi", "Samedi", ]; - var dayName = days[date.getDay()]; + const dayName = days[date.getDay()]; return `${dayName} ${day} ${month} ${year}`; }, dateMonthYearformat: (dateStr: string) => { diff --git a/server/api/__sitemap__/urls.ts b/server/api/__sitemap__/urls.ts index 71bd7b3..bf50667 100644 --- a/server/api/__sitemap__/urls.ts +++ b/server/api/__sitemap__/urls.ts @@ -4,7 +4,7 @@ import reportsData from "@/assets/data/rapports-liste.json"; export default defineSitemapEventHandler(async (event) => { // Générer un tableau de chaînes d'URL pour les rapports const reportUrls = reportsData.map( - (report) => `/rapport-senegal/${report.slug}` + (report) => `/rapport-senegal/${report.slug}`, ); // Récupérer toutes les pages du dossier content diff --git a/server/api/aide-presse.ts b/server/api/aide-presse.ts index 987a432..f6961dd 100644 --- a/server/api/aide-presse.ts +++ b/server/api/aide-presse.ts @@ -1,5 +1,5 @@ import aides from "~/assets/data/fadp.json"; -import { AidePresse } from "~/types/aide-presse-type"; +import type { AidePresse } from "~/types/aide-presse-type"; export default defineEventHandler((): AidePresse[] => { return aides; diff --git a/server/api/barometre-politique/diomaye-faye.ts b/server/api/barometre-politique/diomaye-faye.ts index 9f2813c..70513e4 100644 --- a/server/api/barometre-politique/diomaye-faye.ts +++ b/server/api/barometre-politique/diomaye-faye.ts @@ -1,7 +1,6 @@ // /server/api/barometre-politique/diomaye-faye.ts import promesses from "~/assets/data/barometre-diomaye.json"; -import { Promesse } from "~/types/promesse"; -import { PromesseStats } from "~/types/promesse"; +import type { Promesse, PromesseStats } from "~/types/promesse"; function calculateStats(promesses: Promesse[]): PromesseStats { const stats: PromesseStats = { diff --git a/server/api/budget-lfi.ts b/server/api/budget-lfi.ts new file mode 100644 index 0000000..718e9a3 --- /dev/null +++ b/server/api/budget-lfi.ts @@ -0,0 +1,6 @@ +import data from "~/assets/data/budget-2024-lfi.json"; +// import { GovernmentMember } from "~/types/government-member"; + +export default defineEventHandler((): any => { + return data; +}); diff --git a/server/api/budget-q1.ts b/server/api/budget-q1.ts new file mode 100644 index 0000000..90f9633 --- /dev/null +++ b/server/api/budget-q1.ts @@ -0,0 +1,5 @@ +import data from "~/assets/data/budget-2024-q1.json"; + +export default defineEventHandler((): any => { + return data; +}); diff --git a/server/api/nominations-magistrature.ts b/server/api/nominations-magistrature.ts index f9f5316..d9941a5 100644 --- a/server/api/nominations-magistrature.ts +++ b/server/api/nominations-magistrature.ts @@ -1,10 +1,10 @@ import magistratureMembers from "~/assets/data/nominations-magistrature.json"; -import { MagistratureType } from "~/types/magistrature-type"; +import type { MagistratureType } from "~/types/magistrature-type"; export default defineEventHandler((): MagistratureType[] => { return magistratureMembers.sort( (a, b) => new Date(b.date_nomination).getTime() - - new Date(a.date_nomination).getTime() + new Date(a.date_nomination).getTime(), ); }); diff --git a/server/api/nominations.ts b/server/api/nominations.ts new file mode 100644 index 0000000..729c4ec --- /dev/null +++ b/server/api/nominations.ts @@ -0,0 +1,10 @@ +import governmentMembers from "~/assets/data/nominations.json"; +import type { GovernmentMember } from "~/types/government-member"; + +export default defineEventHandler((): GovernmentMember[] => { + return governmentMembers.sort( + (a, b) => + new Date(b.nominationDate).getTime() - + new Date(a.nominationDate).getTime(), + ); +}); diff --git a/server/api/quiz-image.ts b/server/api/quiz-image.ts index c4df339..f22aa42 100644 --- a/server/api/quiz-image.ts +++ b/server/api/quiz-image.ts @@ -1,5 +1,5 @@ import questions from "~/assets/data/quiz-photos.json"; -import { Question } from "~/types/question"; +import type { Question } from "~/types/question"; export default defineEventHandler((): Question[] => { return questions; diff --git a/server/api/quiz-text.ts b/server/api/quiz-text.ts index ed42233..1274930 100644 --- a/server/api/quiz-text.ts +++ b/server/api/quiz-text.ts @@ -1,5 +1,5 @@ import questions from "~/assets/data/quiz-text.json"; -import { Question } from "~/types/question"; +import type { Question } from "~/types/question"; export default defineEventHandler((): Question[] => { return questions; diff --git a/stores/promesseStore.ts b/stores/promesseStore.ts new file mode 100644 index 0000000..72ca02a --- /dev/null +++ b/stores/promesseStore.ts @@ -0,0 +1,15 @@ +// stores/itemStore.ts +import { defineStore } from "pinia"; +import type { Promesse } from "~/types/promesse"; + +export const usePromesseStore = defineStore("promesse", { + state: () => ({ + items: [] as Promesse[], + selectedItem: null as Promesse | null, + }), + actions: { + selectItem(item: Promesse) { + this.selectedItem = item; + }, + }, +}); diff --git a/types/journal.ts b/types/journal.ts index f8ebb21..6f15d8d 100644 --- a/types/journal.ts +++ b/types/journal.ts @@ -1,5 +1,4 @@ export type Journal = { - numero: string; - date: string; - }; - \ No newline at end of file + numero: string; + date: string; +};