Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #217 from SELab-2/projects-page-functionality
Browse files Browse the repository at this point in the history
Projects page & basic students page functionality
  • Loading branch information
Mikxox authored Apr 28, 2022
2 parents 5e88742 + 01f92b2 commit 405eb56
Show file tree
Hide file tree
Showing 19 changed files with 4,524 additions and 549 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class EditionController(val service: EditionService) {
* Returns the currently active edition, or null if there is no active edition.
*/
@GetMapping("/active")
@Secured("ROLE_ADMIN")
fun getActiveEdition(): Edition? = service.getActiveEdition()

/**
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { useRouter } from 'next/router';
import { PropsWithChildren } from 'react';
import useUser from '../hooks/useUser';
import { UserRole } from '../lib/types';
import useEdition from '../hooks/useEdition';

type HeaderProps = PropsWithChildren<unknown>;

const Header: React.FC<HeaderProps> = () => {
const router = useRouter();
const [user] = useUser();
const [edition] = useEdition();
const current_path = router.pathname;

return (
Expand All @@ -30,14 +32,14 @@ const Header: React.FC<HeaderProps> = () => {
current_path === '/students' ? 'underline' : ''
}`}
>
<Link href="/students">Select Students</Link>
<Link href={`/${edition}/students`}>Select Students</Link>
</li>
<li
className={`ml-3 hover:underline sm:inline ${
current_path === '/projects' ? 'underline' : ''
}`}
>
<Link href="/projects">Projects</Link>
<Link href={`/${edition}/projects`}>Projects</Link>
</li>
<li
className={`ml-3 hover:underline sm:inline ${
Expand Down
Loading

0 comments on commit 405eb56

Please sign in to comment.