Skip to content

Commit

Permalink
Improved the way the app is rendered on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
nulzo committed Nov 7, 2023
1 parent c82ece3 commit e055313
Show file tree
Hide file tree
Showing 34 changed files with 2,647 additions and 2,517 deletions.
3 changes: 1 addition & 2 deletions backend/src/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class Meta:


class TicketSerializer(serializers.ModelSerializer):
professor = serializers.PrimaryKeyRelatedField(
queryset=Professor.prof.all())
professor = serializers.PrimaryKeyRelatedField(queryset=Professor.prof.all())
course = serializers.PrimaryKeyRelatedField(queryset=Course.generic.all())
issue = serializers.PrimaryKeyRelatedField(queryset=Issues.generic.all())
# student = serializers.PrimaryKeyRelatedField(
Expand Down
20 changes: 7 additions & 13 deletions backend/src/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
MessageSerializer,
ProfessorSerializer,
SectionSerializer,
TicketSerializer,
TicketGetSerializer,
TicketSerializer,
UserSerializer,
)

Expand Down Expand Up @@ -418,8 +418,7 @@ def get(self, request):
sections = sections.filter(professor__in=query)

if first_name := querystring.get("first-name"):
query = Professor.prof.filter(
first_name=first_name.capitalize())
query = Professor.prof.filter(first_name=first_name.capitalize())
sections = sections.filter(professor__in=query)

if modality := querystring.get("modality"):
Expand Down Expand Up @@ -459,8 +458,7 @@ def get(self, request):

if querystring:
if department := querystring.get("department"):
courses = courses.filter(
course_department=self.sanitize(department))
courses = courses.filter(course_department=self.sanitize(department))

if name := querystring.get("name"):
courses = courses.filter(course_name=name)
Expand All @@ -472,8 +470,7 @@ def get(self, request):
courses = courses.filter(course_id=course_id)

if course_id_contains := querystring.get("course-id-contains"):
courses = courses.filter(
course_id__contains=course_id_contains)
courses = courses.filter(course_id__contains=course_id_contains)

if greater_than_code := querystring.get("higher-than"):
courses = courses.filter(course_id__gt=greater_than_code)
Expand Down Expand Up @@ -514,8 +511,7 @@ def get(self, request):

if querystring:
if department := querystring.get("department"):
users = users.filter(
course_department=self.sanitize(department))
users = users.filter(course_department=self.sanitize(department))

if name := querystring.get("name"):
users = users.filter(name=name)
Expand Down Expand Up @@ -579,8 +575,7 @@ def get(self, request):

if querystring:
if department := querystring.get("department"):
users = users.filter(
course_department=self.sanitize(department))
users = users.filter(course_department=self.sanitize(department))

if name := querystring.get("name"):
users = users.filter(name=name)
Expand Down Expand Up @@ -739,8 +734,7 @@ def get(self, request):
query_string = self.get_querystring(request=request)
if query_string:
if professor_name := query_string.get("professor"):
professors = professors.filter(
full_name=self.sanitize(professor_name))
professors = professors.filter(full_name=self.sanitize(professor_name))
if professor_id := query_string.get("id"):
professors = professors.filter(professor_id=professor_id)
if professor_first_name := query_string.get("first-name"):
Expand Down
2 changes: 2 additions & 0 deletions frontend-ts/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This is a typescript project. The only files that are JS files are
# the test files from Jest
**/*.js
*.js
js
2 changes: 1 addition & 1 deletion frontend-ts/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
ignorePatterns: ["dist", ".eslintrc.cjs", "*.js", "**/*.js", "data/"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh"],
rules: {
Expand Down
3 changes: 3 additions & 0 deletions frontend-ts/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Ignore useless json formatting
**/*.json
# Ignore js files
**/*.js
*.js
28 changes: 13 additions & 15 deletions frontend-ts/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image" href="/UNO.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="./node_modules/preline/dist/preline.js"></script>
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<title>CSLC Tutoring Portal</title>
</head>

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image" href="/UNO.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="./node_modules/preline/dist/preline.js"></script>
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
<title>CSLC Tutoring Portal</title>
</head>

<body class="overscroll-none">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>

</html>
<body class="overscroll-none">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion frontend-ts/src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Root() {
<div className="grid grid-cols-3 sm:grid-cols-4 md:grid-cols-6 lg:grid-cols-8 xl:grid-cols-10 2xl:grid-cols-14 3xl:grid-cols-14">
<Sidebar />
<div className="col-span-3 sm:col-span-4 md:col-span-6 lg:col-span-6 xl:col-span-8 lg:border-l sm:border-muted-primary 3xl:col-span-9">
<div className="h-full mx-10 px-4 py-6 lg:px-1">
<div className="h-full mx-6 sm:mx-10 sm:px-4 py-6 lg:px-1">
<Outlet />
</div>
<Toaster />
Expand Down
15 changes: 5 additions & 10 deletions frontend-ts/src/components/navigation/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export default function Navbar() {
}
return (
<>
<nav
<div
className={
"flex lg:hidden px-10 py-2 flex-wrap items-center bg-white w-full shadow-lg text-sm border-b"
"bg-background flex lg:hidden px-6 py-2 flex-wrap items-center w-full shadow-lg text-sm border-b"
}
>
<div className={"grid grid-cols-3 gap-4 w-full"}>
Expand All @@ -19,18 +19,14 @@ export default function Navbar() {
>
<div
className={
"tooltip tooltip-right lg:hidden bg-white font-thin text-white"
"tooltip tooltip-right lg:hidden font-thin text-foreground"
}
data-tip="open sidebar"
>
<Button
onClick={onClick}
className="bg-white hover:bg-secondary"
>
<Button onClick={onClick} variant="ghost" className="">
<MenuIcon />
</Button>
</div>
{/* <span className={"px-2 flex flex-wrap hidden lg:flex content-center text-lg font-semibold tracking-tight"}>Computer Science Learning Center</span> */}
</div>
</div>
<div
Expand Down Expand Up @@ -119,8 +115,7 @@ export default function Navbar() {
</ul>
</div>
</div>
</nav>
{/* <hr className={"h-px mt-0 bg-gray-400 border-0"}/> */}
</div>
</>
);
}
Loading

0 comments on commit e055313

Please sign in to comment.