diff --git a/fresh.gen.ts b/fresh.gen.ts
index a256829..be51c53 100644
--- a/fresh.gen.ts
+++ b/fresh.gen.ts
@@ -3,20 +3,21 @@
// This file is automatically updated during development when running `dev.ts`.
import * as $_apps_layout from "./routes/(apps)/_layout.tsx";
-import * as $_apps_mobility_api_insert_students from "./routes/(apps)/mobility/api/insert_students.ts";
import * as $_apps_mobility_index from "./routes/(apps)/mobility/index.tsx";
import * as $_apps_mobility_partials_admin_mobility from "./routes/(apps)/mobility/partials/(admin)/mobility.tsx";
import * as $_apps_mobility_partials_index from "./routes/(apps)/mobility/partials/index.tsx";
import * as $_apps_mobility_partials_overview from "./routes/(apps)/mobility/partials/overview.tsx";
-import * as $_apps_mobility_partials_students from "./routes/(apps)/mobility/partials/students.tsx";
import * as $_apps_notes_index from "./routes/(apps)/notes/index.tsx";
import * as $_apps_notes_partials_admin_courses from "./routes/(apps)/notes/partials/(admin)/courses.tsx";
import * as $_apps_notes_partials_admin_students from "./routes/(apps)/notes/partials/(admin)/students.tsx";
import * as $_apps_notes_partials_index from "./routes/(apps)/notes/partials/index.tsx";
import * as $_apps_notes_partials_notes from "./routes/(apps)/notes/partials/notes.tsx";
-import * as $_apps_students_api_example from "./routes/(apps)/students/api/example.ts";
+import * as $_apps_students_api_insert_students from "./routes/(apps)/students/api/insert_students.ts";
import * as $_apps_students_index from "./routes/(apps)/students/index.tsx";
+import * as $_apps_students_partials_admin_consult from "./routes/(apps)/students/partials/(admin)/consult.tsx";
+import * as $_apps_students_partials_admin_upload from "./routes/(apps)/students/partials/(admin)/upload.tsx";
import * as $_apps_students_partials_index from "./routes/(apps)/students/partials/index.tsx";
+import * as $_apps_students_partials_overview from "./routes/(apps)/students/partials/overview.tsx";
import * as $_404 from "./routes/_404.tsx";
import * as $_app from "./routes/_app.tsx";
import * as $_middleware from "./routes/_middleware.ts";
@@ -28,18 +29,16 @@ import * as $logout from "./routes/logout.tsx";
import * as $_islands_AppNavigator from "./routes/(_islands)/AppNavigator.tsx";
import * as $_islands_Navbar from "./routes/(_islands)/Navbar.tsx";
import * as $_apps_mobility_islands_ConsultMobility from "./routes/(apps)/mobility/(_islands)/ConsultMobility.tsx";
-import * as $_apps_mobility_islands_ConsultStudents from "./routes/(apps)/mobility/(_islands)/ConsultStudents.tsx";
import * as $_apps_mobility_islands_EditMobility from "./routes/(apps)/mobility/(_islands)/EditMobility.tsx";
-import * as $_apps_mobility_islands_EditStudents from "./routes/(apps)/mobility/(_islands)/EditStudents.tsx";
import * as $_apps_mobility_islands_ImportFile from "./routes/(apps)/mobility/(_islands)/ImportFile.tsx";
-import * as $_apps_mobility_islands_UploadStudents from "./routes/(apps)/mobility/(_islands)/UploadStudents.tsx";
+import * as $_apps_students_islands_ConsultStudents from "./routes/(apps)/students/(_islands)/ConsultStudents.tsx";
+import * as $_apps_students_islands_EditStudents from "./routes/(apps)/students/(_islands)/EditStudents.tsx";
+import * as $_apps_students_islands_UploadStudents from "./routes/(apps)/students/(_islands)/UploadStudents.tsx";
import type { Manifest } from "$fresh/server.ts";
const manifest = {
routes: {
"./routes/(apps)/_layout.tsx": $_apps_layout,
- "./routes/(apps)/mobility/api/insert_students.ts":
- $_apps_mobility_api_insert_students,
"./routes/(apps)/mobility/index.tsx": $_apps_mobility_index,
"./routes/(apps)/mobility/partials/(admin)/mobility.tsx":
$_apps_mobility_partials_admin_mobility,
@@ -47,8 +46,6 @@ const manifest = {
$_apps_mobility_partials_index,
"./routes/(apps)/mobility/partials/overview.tsx":
$_apps_mobility_partials_overview,
- "./routes/(apps)/mobility/partials/students.tsx":
- $_apps_mobility_partials_students,
"./routes/(apps)/notes/index.tsx": $_apps_notes_index,
"./routes/(apps)/notes/partials/(admin)/courses.tsx":
$_apps_notes_partials_admin_courses,
@@ -56,10 +53,17 @@ const manifest = {
$_apps_notes_partials_admin_students,
"./routes/(apps)/notes/partials/index.tsx": $_apps_notes_partials_index,
"./routes/(apps)/notes/partials/notes.tsx": $_apps_notes_partials_notes,
- "./routes/(apps)/students/api/example.ts": $_apps_students_api_example,
+ "./routes/(apps)/students/api/insert_students.ts":
+ $_apps_students_api_insert_students,
"./routes/(apps)/students/index.tsx": $_apps_students_index,
+ "./routes/(apps)/students/partials/(admin)/consult.tsx":
+ $_apps_students_partials_admin_consult,
+ "./routes/(apps)/students/partials/(admin)/upload.tsx":
+ $_apps_students_partials_admin_upload,
"./routes/(apps)/students/partials/index.tsx":
$_apps_students_partials_index,
+ "./routes/(apps)/students/partials/overview.tsx":
+ $_apps_students_partials_overview,
"./routes/_404.tsx": $_404,
"./routes/_app.tsx": $_app,
"./routes/_middleware.ts": $_middleware,
@@ -74,16 +78,16 @@ const manifest = {
"./routes/(_islands)/Navbar.tsx": $_islands_Navbar,
"./routes/(apps)/mobility/(_islands)/ConsultMobility.tsx":
$_apps_mobility_islands_ConsultMobility,
- "./routes/(apps)/mobility/(_islands)/ConsultStudents.tsx":
- $_apps_mobility_islands_ConsultStudents,
"./routes/(apps)/mobility/(_islands)/EditMobility.tsx":
$_apps_mobility_islands_EditMobility,
- "./routes/(apps)/mobility/(_islands)/EditStudents.tsx":
- $_apps_mobility_islands_EditStudents,
"./routes/(apps)/mobility/(_islands)/ImportFile.tsx":
$_apps_mobility_islands_ImportFile,
- "./routes/(apps)/mobility/(_islands)/UploadStudents.tsx":
- $_apps_mobility_islands_UploadStudents,
+ "./routes/(apps)/students/(_islands)/ConsultStudents.tsx":
+ $_apps_students_islands_ConsultStudents,
+ "./routes/(apps)/students/(_islands)/EditStudents.tsx":
+ $_apps_students_islands_EditStudents,
+ "./routes/(apps)/students/(_islands)/UploadStudents.tsx":
+ $_apps_students_islands_UploadStudents,
},
baseUrl: import.meta.url,
} satisfies Manifest;
diff --git a/routes/(apps)/mobility/(_props)/props.ts b/routes/(apps)/mobility/(_props)/props.ts
index b324ead..6003875 100644
--- a/routes/(apps)/mobility/(_props)/props.ts
+++ b/routes/(apps)/mobility/(_props)/props.ts
@@ -8,9 +8,8 @@ const properties: AppProperties = {
index: "Homepage",
overview: "Mobility overview",
mobility: "Mobility management",
- students: "Students management",
},
- adminOnly: ["students"],
+ adminOnly: ["mobility"],
};
export default properties;
diff --git a/routes/(apps)/mobility/partials/students.tsx b/routes/(apps)/mobility/partials/students.tsx
deleted file mode 100644
index f3c7cb9..0000000
--- a/routes/(apps)/mobility/partials/students.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import { RouteConfig } from "$fresh/server.ts";
-import UploadStudents from "../(_islands)/UploadStudents.tsx";
-import ConsultStudents from "../(_islands)/ConsultStudents.tsx";
-//import EditStudents from "../(_islands)/EditStudents.tsx";
-
-export const config: RouteConfig = {
- skipAppWrapper: false,
- skipInheritedLayouts: false,
-};
-
-export default function Students() {
- return (
-
- Manage Promotions
-
-
-
-
- );
-}
diff --git a/routes/(apps)/mobility/(_islands)/ConsultStudents.tsx b/routes/(apps)/students/(_islands)/ConsultStudents.tsx
similarity index 96%
rename from routes/(apps)/mobility/(_islands)/ConsultStudents.tsx
rename to routes/(apps)/students/(_islands)/ConsultStudents.tsx
index deeb2e6..7b097db 100644
--- a/routes/(apps)/mobility/(_islands)/ConsultStudents.tsx
+++ b/routes/(apps)/students/(_islands)/ConsultStudents.tsx
@@ -21,7 +21,7 @@ export default function ConsultStudents() {
useEffect(() => {
const fetchData = async () => {
try {
- const response = await fetch("/mobility/api/insert_students");
+ const response = await fetch("/students/api/insert_students");
if (!response.ok) {
throw new Error(`Error fetching data: ${response.statusText}`);
}
diff --git a/routes/(apps)/mobility/(_islands)/EditStudents.tsx b/routes/(apps)/students/(_islands)/EditStudents.tsx
similarity index 100%
rename from routes/(apps)/mobility/(_islands)/EditStudents.tsx
rename to routes/(apps)/students/(_islands)/EditStudents.tsx
diff --git a/routes/(apps)/mobility/(_islands)/UploadStudents.tsx b/routes/(apps)/students/(_islands)/UploadStudents.tsx
similarity index 97%
rename from routes/(apps)/mobility/(_islands)/UploadStudents.tsx
rename to routes/(apps)/students/(_islands)/UploadStudents.tsx
index bb9129b..10ed4e2 100644
--- a/routes/(apps)/mobility/(_islands)/UploadStudents.tsx
+++ b/routes/(apps)/students/(_islands)/UploadStudents.tsx
@@ -37,7 +37,7 @@ export default function UploadStudents() {
range: 1, // Ignorer les en-tĂȘtes
});
- const response = await fetch("/mobility/api/insert_students", {
+ const response = await fetch("/students/api/insert_students", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ promoName: sheetName, data }),
diff --git a/routes/(apps)/students/(_props)/props.ts b/routes/(apps)/students/(_props)/props.ts
index 0a7a522..54ecaab 100644
--- a/routes/(apps)/students/(_props)/props.ts
+++ b/routes/(apps)/students/(_props)/props.ts
@@ -5,10 +5,12 @@ const properties: AppProperties = {
icon: "badge",
pages: {
index: "Homepage",
+ overview: "Students overview",
upload: "Upload students",
+ consult: "Consult students"
},
- adminOnly: ["upload"],
- hint: "See student information",
+ adminOnly: ["upload", "consult"],
+ hint: "Create students promotion and see informations",
};
export default properties;
diff --git a/routes/(apps)/students/api/example.ts b/routes/(apps)/students/api/example.ts
deleted file mode 100644
index 9f04cd1..0000000
--- a/routes/(apps)/students/api/example.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { Handlers } from "$fresh/server.ts";
-
-export const handler: Handlers = {
- async POST(request, context) {
- if (request.headers.get("content-type") != "application/json") {
- return new Response(null, {
- status: 400,
- });
- }
-
- const responseBody = {
- requestBody: await request.json(),
- context,
- };
-
- return new Response(JSON.stringify(responseBody), {
- headers: {
- "content-type": "application/json",
- },
- });
- },
-};
diff --git a/routes/(apps)/mobility/api/insert_students.ts b/routes/(apps)/students/api/insert_students.ts
similarity index 100%
rename from routes/(apps)/mobility/api/insert_students.ts
rename to routes/(apps)/students/api/insert_students.ts
diff --git a/routes/(apps)/students/partials/(admin)/consult.tsx b/routes/(apps)/students/partials/(admin)/consult.tsx
new file mode 100644
index 0000000..7106daf
--- /dev/null
+++ b/routes/(apps)/students/partials/(admin)/consult.tsx
@@ -0,0 +1,17 @@
+import ConsultStudents from "$root/routes/(apps)/students/(_islands)/ConsultStudents.tsx";
+import { getPartialsConfig, makePartials } from "$root/defaults/makePartials.tsx";
+import { FreshContext } from "$fresh/server.ts";
+import { State } from "$root/routes/_middleware.ts";
+//import EditStudents from "../(_islands)/EditStudents.tsx";
+
+async function Students(_request: Request, _context: FreshContext) {
+ return (
+ <>
+ Manage Promotions
+
+ >
+ );
+}
+
+export const config = getPartialsConfig();
+export default makePartials(Students);
diff --git a/routes/(apps)/students/partials/(admin)/upload.tsx b/routes/(apps)/students/partials/(admin)/upload.tsx
new file mode 100644
index 0000000..0010328
--- /dev/null
+++ b/routes/(apps)/students/partials/(admin)/upload.tsx
@@ -0,0 +1,17 @@
+import UploadStudents from "$root/routes/(apps)/students/(_islands)/UploadStudents.tsx";
+import { getPartialsConfig, makePartials } from "$root/defaults/makePartials.tsx";
+import { FreshContext } from "$fresh/server.ts";
+import { State } from "$root/routes/_middleware.ts";
+//import EditStudents from "../(_islands)/EditStudents.tsx";
+
+async function Students(_request: Request, _context: FreshContext) {
+ return (
+ <>
+ Manage Promotions
+
+ >
+ );
+}
+
+export const config = getPartialsConfig();
+export default makePartials(Students);
diff --git a/routes/(apps)/students/partials/overview.tsx b/routes/(apps)/students/partials/overview.tsx
new file mode 100644
index 0000000..ceac77c
--- /dev/null
+++ b/routes/(apps)/students/partials/overview.tsx
@@ -0,0 +1,17 @@
+import { Partial } from "$fresh/runtime.ts";
+import { RouteConfig } from "$fresh/server.ts";
+
+type ModulesProps = Record;
+
+export const config: RouteConfig = {
+ skipAppWrapper: true,
+ skipInheritedLayouts: true,
+};
+
+export default function Modules(_props: ModulesProps) {
+ return (
+
+ students
+
+ );
+}