diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4b1e733..f4eabd0 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -20,8 +20,8 @@ import RegisterDriver from "./pages/RegisterDriver.tsx"; import SendNotif from "./pages/SendNotif.tsx"; import ViewProfile from "./pages/ViewProfile.tsx"; -import Protocols from "./components/Policies/protocols.tsx"; -import Rules from "./components/Policies/rules.tsx"; +import Protocols from "./pages/Policies/Protocols.tsx"; +import Rules from "./pages/Policies/Rules.tsx"; import ChangePassword from "./pages/ChangePassword.tsx"; import RequireAuth from "./components/RequireAuth.tsx"; @@ -42,99 +42,37 @@ const Main = () => { {/* PUBLIC ROUTES */} - - } - /> - } - /> + } /> + } /> - } - /> + } /> - } - /> + } /> }> {/* FOR ALL LOGGED IN */} - } - /> - } - /> + } /> + } /> {/* USER ROUTES */} }> - } - /> - } - /> - } - /> - } - /> - } - /> + } /> + } /> + } /> + } /> + } /> {/* ADMIN ROUTES */} }> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> diff --git a/frontend/src/components/Policies/rules.tsx b/frontend/src/components/Policies/rules.tsx deleted file mode 100644 index 617f729..0000000 --- a/frontend/src/components/Policies/rules.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import Header from "../Header"; - -const Rules = () => { - return ( -
-
-
-
-
-
-

- Parking Rules and Regulations -

- -
-

- 1. - All vehicles/motorcycles are required to park properly at designated - parking areas. -

- -

- 2. - Avoid parking on roadsides and gutters on campus. -

- -

- 3. - Any damage caused by a vehicle/motorcycle to any CPU property shall be - properly assessed and the owner will be charged the amount equivalent - to its current cost. -

- -

- 4. - Vehicles/motorcycles with car passes are given priority in parking - areas while non-car pass vehicles are limited to only 3 hours on - parking inside the campus unless it is used for official purposes and - sanctioned by the University Administration. All vehicles/motorcycles - owners must follow 10:00 PM to 5:00 AM curfew hours inside the campus. -

- -

- 5. A - vehicle/motorcycle who wants to park overnight inside the campus must - ask permission from CPU Administration. -

- -

- 6. - The CPU Administration is not liable for any loss or damage that may - happen to any vehicle/motorcycle while parked inside the campus. -

- -

- 7. - The CPU Administration has the right to revoke parking privileges to - any vehicle/motorcycle as necessary to protect the University in -
- accordance with the University standing policies for security and - safety reasons. -

- -

- 8. - Parking inside the CPU Campus is only a privilege given by the - Administration and not a right given to any individual or group - regardless of his position or affiliation. -

-
-
- -
-
- ); -}; - -export default Rules; diff --git a/frontend/src/components/ViolationCard.tsx b/frontend/src/components/ViolationCard.tsx index edb03dd..dfa62cf 100644 --- a/frontend/src/components/ViolationCard.tsx +++ b/frontend/src/components/ViolationCard.tsx @@ -3,6 +3,8 @@ import { useState, useRef, useEffect } from "react"; import { Violation } from "../types/datatypes"; import { useEditViolation } from "../hooks/violation-hooks/useEditViolation"; import useUpdateStatus from "../hooks/useUpdateStatus"; +import useAuth from "../hooks/context-hooks/useAuth"; +import { AuthContextType } from "../types/user.types"; const ViolationCard = ({ violation }: { violation: Violation }) => { const [isMenuOpen, setIsMenuOpen] = useState(false); @@ -11,6 +13,7 @@ const ViolationCard = ({ violation }: { violation: Violation }) => { const { deleteViolation } = useDeleteViolation(); const { updateViolation } = useEditViolation(); const { handleUpdateStatus } = useUpdateStatus(); + const { auth }: AuthContextType = useAuth(); const dropdownRef = useRef(null); const date = new Date(violation.violation_date!); const year = date.getFullYear(); @@ -36,7 +39,9 @@ const ViolationCard = ({ violation }: { violation: Violation }) => { }; const handleStatusClick = async () => { - await handleUpdateStatus(violation.id!); + if (auth?.isAdmin) { + await handleUpdateStatus(violation.id!); + } }; const handleEditViolation = () => { diff --git a/frontend/src/pages/AboutPage.tsx b/frontend/src/pages/AboutPage.tsx index 112241d..08fd8c4 100644 --- a/frontend/src/pages/AboutPage.tsx +++ b/frontend/src/pages/AboutPage.tsx @@ -6,7 +6,7 @@ const AboutPage = () => {
-
+

About Us

diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index 7deb243..7160b0d 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -74,8 +74,7 @@ const HomePage = () => {

Please allow 3-5 working days - for the validation process to complete. Once verified, you will - receive a notification. + for the validation process to complete.

diff --git a/frontend/src/pages/Policies.tsx b/frontend/src/pages/Policies.tsx index d5b15c7..2491f30 100644 --- a/frontend/src/pages/Policies.tsx +++ b/frontend/src/pages/Policies.tsx @@ -6,18 +6,16 @@ const Policies = () => { return (
-
-
+
- -
+ +
- {activeSection === "protocols" && (
- -

+

CPU Traffic Protocol and Decorum -

+ -

- - 1. - - All vehicle owner/drivers are required to open their windows for - visual inspection and identification when going in and out of the CPU - campus. +

+ 1. + All vehicle owner/drivers are required to open their windows for + visual inspection and identification when going in and out of + the CPU campus.

-

- - 2. - - The speed limit inside the campus is 15KPH. OVERTAKING is not allowed. -

+

+ 2. + The speed limit inside the campus is 15KPH. OVERTAKING is not + allowed. +

-

- - 3. - - All vehicles/motorcycles must park properly at designated parking - areas. Illegal parking and Blocking of Driveway are not allowed. - Observe No Loading/Unloading signs on designated areas. +

+ 3. + All vehicles/motorcycles must park properly at designated + parking areas. Illegal parking and Blocking of Driveway are not + allowed. Observe No Loading/Unloading signs on designated areas.

-

- - 4. - +

+ 4. Blowing horns, loud noise, and blaring sounds of all vehicles/motorcycles are not allowed.

-

- - 5. - +

+ 5. All vehicles/motorcycles must follow all implementing traffic routes and road signs on campus.

- - 6. - + 6. The following are not allowed inside the campus: -
- -

- - a. - +
+

+ a. Smoking belching vehicles. -

+

-

- - b. - +

+ b. Vehicles suspected of carrying bombs, dangerous chemicals or contaminated by hazardous elements.

-

- - c. - - Vehicle suspected of being used by criminal elements or used for Kidnap for Ransom (KFR). -

+

+ c. + Vehicle suspected of being used by criminal elements or used + for Kidnap for Ransom (KFR). +

-

- - d. - +

+ d. Tricycles, pedicabs or tri-sikads and similar types of - transportation (except when the owner is issued a special permit by - the CPU Administration). + transportation (except when the owner is issued a special + permit by the CPU Administration).

-

- - 7. - - Vehicles involved in accidents inside the campus will be held by the - CPU guards for inspection and upon verification from the proper - authorities. +

+ 7. + Vehicles involved in accidents inside the campus will be held by + the CPU guards for inspection and upon verification from the + proper authorities.

-

- - 8. - +

+ 8. Any vehicle suspected or found bringing illegal drugs, fireams, - deadly weapons, alcoholic drinks, or prographic materials inside the - campus will be held by the CPU guards for inspection and proper disposition of the CPU - Administration and PNP or any related Law Enforcement Agencies. + deadly weapons, alcoholic drinks, or prographic materials inside + the campus will be held by the CPU guards for inspection and + proper disposition of the CPU Administration and PNP or any + related Law Enforcement Agencies.

-

- - 9. - The CPU Administration through the Campus Traffic, Security and - Safety Office has the discretion to allow or prevent any vehicle or - motorcycle entry to the CPU campus if it compromises the safety and security of the - University. +

+ 9.The CPU + Administration through the Campus Traffic, Security and Safety + Office has the discretion to allow or prevent any vehicle or + motorcycle entry to the CPU campus if it compromises the safety + and security of the University.

-

- - 10. - - All drivers should follow CPU administrative policies, especially - those concerning health and safety protocols. +

+ 10. + All drivers should follow CPU administrative policies, + especially those concerning health and safety protocols.

-
)} {activeSection === "rules" && (
+

+ Parking Rules and Regulations +

-

- Parking Rules and Regulations -

- -

- - 1. - - All vehicles/motorcycles are required to park properly at designated parking areas. -

+

+ 1. + All vehicles/motorcycles are required to park properly at + designated parking areas. +

-

- - 2. - +

+ 2. Avoid parking on roadsides and gutters on campus. -

+ -

- - 3. - - Any damage caused by a vehicle/motorcycle to any CPU property shall - be properly assessed and the owner will be charged the amount - equivalent to its current cost. +

+ 3. + Any damage caused by a vehicle/motorcycle to any CPU property + shall be properly assessed and the owner will be charged the + amount equivalent to its current cost.

-

- - 4. - - Vehicles/motorcycles with car passes are given priority in parking - areas while non-car pass vehicles are limited to only 3 hours on - parking inside the campus unless it is used for official purposes and sanctioned by the University - Administration. All vehicles/motorcycles owners must follow 10:00 PM to - 5:00 AM curfew hours inside the campus. +

+ 4. + Vehicles/motorcycles with car passes are given priority in + parking areas while non-car pass vehicles are limited to only 3 + hours on parking inside the campus unless it is used for + official purposes and sanctioned by the University + Administration. All vehicles/motorcycles owners must follow + 10:00 PM to 5:00 AM curfew hours inside the campus.

-

- - 5. - - A vehicle/motorcycle who wants to park overnight inside the campus +

+ 5.A + vehicle/motorcycle who wants to park overnight inside the campus must ask permission from CPU Administration.

-

- - 6. - - The CPU Administration is not liable for any loss or damage that may - happen to any vehicle/motorcycle while parked inside the campus. +

+ 6. + The CPU Administration is not liable for any loss or damage that + may happen to any vehicle/motorcycle while parked inside the + campus.

-

- - 7. - - The CPU Administration has the right to revoke parking privileges to - any vehicle/motorcycle as necessary to protect the University in -
accordance with the University standing policies for security and safety reasons. +

+ 7. + The CPU Administration has the right to revoke parking + privileges to any vehicle/motorcycle as necessary to protect the + University in +
+ accordance with the University standing policies for security + and safety reasons.

-

- - 8. - +

+ 8. Parking inside the CPU Campus is only a privilege given by the Administration and not a right given to any individual or group regardless of his position or affiliation.

-
)}
diff --git a/frontend/src/components/Policies/protocols.tsx b/frontend/src/pages/Policies/Protocols.tsx similarity index 73% rename from frontend/src/components/Policies/protocols.tsx rename to frontend/src/pages/Policies/Protocols.tsx index 34509e2..a91d82c 100644 --- a/frontend/src/components/Policies/protocols.tsx +++ b/frontend/src/pages/Policies/Protocols.tsx @@ -1,51 +1,50 @@ -import Header from "../Header"; +import Header from "../../components/Header"; const Protocols = () => { - return ( -
-
-
-
-
-
-

- CPU Traffic Protocol and Decorum -

- -
+ return ( +
+
+
+
+
+
+

+ CPU Traffic Protocol and Decorum +

+

1. All vehicle owner/drivers are required to open their windows for visual inspection and identification when going in and out of the CPU campus.

- +

2. The speed limit inside the campus is 15KPH. OVERTAKING is not allowed.

- +

3. All vehicles/motorcycles must park properly at designated parking areas. Illegal parking and Blocking of Driveway are not allowed. Observe No Loading/Unloading signs on designated areas.

- +

4. Blowing horns, loud noise, and blaring sounds of all vehicles/motorcycles are not allowed.

- +

5. - All vehicles/motorcycles must follow all implementing traffic routes - and road signs on campus. + All vehicles/motorcycles must follow all implementing traffic + routes and road signs on campus.

- +

6. The following are not allowed inside the campus: @@ -54,52 +53,52 @@ const Protocols = () => { a. Smoking belching vehicles.

- +

b. Vehicles suspected of carrying bombs, dangerous chemicals or contaminated by hazardous elements.

- +

c. - Vehicle suspected of being used by criminal elements or used for - Kidnap for Ransom (KFR). + Vehicle suspected of being used by criminal elements or used + for Kidnap for Ransom (KFR).

- +

d. Tricycles, pedicabs or tri-sikads and similar types of - transportation (except when the owner is issued a special permit - by the CPU Administration). + transportation (except when the owner is issued a special + permit by the CPU Administration).

- +

7. - Vehicles involved in accidents inside the campus will be held by the - CPU guards for inspection and upon verification from the proper - authorities. + Vehicles involved in accidents inside the campus will be held by + the CPU guards for inspection and upon verification from the + proper authorities.

- +

8. Any vehicle suspected or found bringing illegal drugs, fireams, - deadly weapons, alcoholic drinks, or prographic materials inside the - campus will be held by the CPU guards for inspection and proper - disposition of the CPU Administration and PNP or any related Law - Enforcement Agencies. + deadly weapons, alcoholic drinks, or prographic materials inside + the campus will be held by the CPU guards for inspection and + proper disposition of the CPU Administration and PNP or any + related Law Enforcement Agencies.

- +

9. The CPU Administration through the Campus Traffic, Security and Safety Office has the discretion to allow or prevent any vehicle or - motorcycle entry to the CPU campus if it compromises the safety and - security of the University. + motorcycle entry to the CPU campus if it compromises the safety + and security of the University.

- +

10. All drivers should follow CPU administrative policies, especially @@ -108,9 +107,8 @@ const Protocols = () => {

-
- - ); - }; +
+ ); +}; -export default Protocols; \ No newline at end of file +export default Protocols; diff --git a/frontend/src/pages/Policies/Rules.tsx b/frontend/src/pages/Policies/Rules.tsx new file mode 100644 index 0000000..978f355 --- /dev/null +++ b/frontend/src/pages/Policies/Rules.tsx @@ -0,0 +1,80 @@ +import Header from "../../components/Header"; + +const Rules = () => { + return ( +
+
+
+
+
+
+

+ Parking Rules and Regulations +

+ +
+

+ 1. + All vehicles/motorcycles are required to park properly at + designated parking areas. +

+ +

+ 2. + Avoid parking on roadsides and gutters on campus. +

+ +

+ 3. + Any damage caused by a vehicle/motorcycle to any CPU property + shall be properly assessed and the owner will be charged the + amount equivalent to its current cost. +

+ +

+ 4. + Vehicles/motorcycles with car passes are given priority in parking + areas while non-car pass vehicles are limited to only 3 hours on + parking inside the campus unless it is used for official purposes + and sanctioned by the University Administration. All + vehicles/motorcycles owners must follow 10:00 PM to 5:00 AM curfew + hours inside the campus. +

+ +

+ 5. A + vehicle/motorcycle who wants to park overnight inside the campus + must ask permission from CPU Administration. +

+ +

+ 6. + The CPU Administration is not liable for any loss or damage that + may happen to any vehicle/motorcycle while parked inside the + campus. +

+ +

+ 7. + The CPU Administration has the right to revoke parking privileges + to any vehicle/motorcycle as necessary to protect the University + in +
+ accordance with the University standing policies for security and + safety reasons. +

+ +

+ 8. + Parking inside the CPU Campus is only a privilege given by the + Administration and not a right given to any individual or group + regardless of his position or affiliation. +

+
+
+
+
+ ); +}; + +export default Rules;