diff --git a/design/TAA.svg b/design/TAA.svg new file mode 100644 index 0000000..db5ff97 --- /dev/null +++ b/design/TAA.svg @@ -0,0 +1,105 @@ + + + + diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/config/WebSecurityConfig.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/config/WebSecurityConfig.java index 877ac1d..f4adcc0 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/config/WebSecurityConfig.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/config/WebSecurityConfig.java @@ -37,7 +37,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .and() .authorizeRequests() - .antMatchers("/css/**") + .antMatchers("/css/**", "/images/**") .permitAll() .and() diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/CoursesController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/CoursesController.java index 8883abf..9c947d5 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/CoursesController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/CoursesController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.PostMapping; * Controller for the list of courses in the system. */ @Controller -public class CoursesController { +public class CoursesController extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/RootController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/RootController.java index 54a8fea..336324b 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/RootController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/RootController.java @@ -1,22 +1,14 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers; -import nl.andrewlalis.teaching_assistant_assistant.model.security.UserDetails; -import org.springframework.security.core.Authentication; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.GetMapping; @Controller -public class RootController { +public class RootController extends UserPageController { - @RequestMapping( - path = "/", - produces = "text/html" - ) - public String index(Authentication authentication, Model model) { - UserDetails userDetails = (UserDetails) authentication.getPrincipal(); - model.addAttribute("user", userDetails.getUser()); + @GetMapping("/") + public String index(Model model) { return "index"; } - } diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/StudentsController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/StudentsController.java index 66b8aca..4294597 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/StudentsController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/StudentsController.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.GetMapping; * Controller for operations dealing with the global collection of students, not particular to one course. */ @Controller -public class StudentsController { +public class StudentsController extends UserPageController { private StudentRepository studentRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/TeachingAssistantsController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/TeachingAssistantsController.java index 91cc428..c389097 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/TeachingAssistantsController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/TeachingAssistantsController.java @@ -17,7 +17,7 @@ import java.util.Optional; * Controller for the list of teaching assistants in the system. */ @Controller -public class TeachingAssistantsController { +public class TeachingAssistantsController extends UserPageController { private TeachingAssistantRepository teachingAssistantRepository; private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/UserPageController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/UserPageController.java new file mode 100644 index 0000000..f0cb073 --- /dev/null +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/UserPageController.java @@ -0,0 +1,23 @@ +package nl.andrewlalis.teaching_assistant_assistant.controllers; + +import nl.andrewlalis.teaching_assistant_assistant.model.security.User; +import nl.andrewlalis.teaching_assistant_assistant.model.security.UserDetails; +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.ModelAttribute; + +/** + * An abstract controller which simplifies the definition of controllers for pages that require a user to be signed in. + */ +public abstract class UserPageController { + + /** + * A shortcut to get the current authenticated user. + * @param auth The spring authentication. + * @return The user that's logged in. + */ + @ModelAttribute("user") + protected User getUser(Authentication auth) { + UserDetails userDetails = (UserDetails) auth.getPrincipal(); + return userDetails.getUser(); + } +} diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CourseEntity.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CourseEntity.java index a052060..1ca3837 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CourseEntity.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CourseEntity.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; import org.springframework.stereotype.Controller; @@ -13,7 +14,7 @@ import java.util.Optional; * Controller for the course entity, that is, one individual course. */ @Controller -public class CourseEntity { +public class CourseEntity extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CreateCourse.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CreateCourse.java index 7d8cd0d..1924056 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CreateCourse.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/CreateCourse.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; import org.springframework.stereotype.Controller; @@ -7,7 +8,7 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; @Controller -public class CreateCourse { +public class CreateCourse extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/Generate.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/Generate.java index 2d5227b..0658a62 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/Generate.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/Generate.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; import nl.andrewlalis.teaching_assistant_assistant.util.sample_data.CourseGenerator; @@ -10,7 +11,7 @@ import org.springframework.web.bind.annotation.GetMapping; import java.util.List; @Controller -public class Generate { +public class Generate extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/ImportStudents.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/ImportStudents.java index 516efcc..94b085c 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/ImportStudents.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/ImportStudents.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -22,7 +23,7 @@ import java.util.Optional; * Controller for importing students from a CSV sheet. */ @Controller -public class ImportStudents { +public class ImportStudents extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/ExportStudentTeams.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/ExportStudentTeams.java index 7375204..d198cb2 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/ExportStudentTeams.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/ExportStudentTeams.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.student_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.Student; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; @@ -18,7 +19,7 @@ import java.util.Optional; * Controller for exporting team information into readable files. */ @Controller -public class ExportStudentTeams { +public class ExportStudentTeams extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java index 9d05182..0f242c9 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.student_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -15,7 +16,7 @@ import java.io.IOException; import java.util.Optional; @Controller -public class GenerateRepositories { +public class GenerateRepositories extends UserPageController { private CourseRepository courseRepository; private StudentTeamRepository studentTeamRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/MergeSingleTeams.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/MergeSingleTeams.java index 1d5ac35..c2655a2 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/MergeSingleTeams.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/MergeSingleTeams.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.student_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -20,7 +21,7 @@ import java.util.Optional; * TODO: Implement this functionality automatically. */ @Controller -public class MergeSingleTeams { +public class MergeSingleTeams extends UserPageController { private Logger logger = LogManager.getLogger(MergeSingleTeams.class); diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java index 18cf28d..610f6a8 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/StudentTeamEntity.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.student_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.Student; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; @@ -20,7 +21,7 @@ import java.util.List; import java.util.Optional; @Controller -public class StudentTeamEntity { +public class StudentTeamEntity extends UserPageController { private StudentTeamRepository studentTeamRepository; private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/UpdateBranchProtection.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/UpdateBranchProtection.java index 41636b0..bc60bcc 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/UpdateBranchProtection.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/UpdateBranchProtection.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.student_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -15,7 +16,7 @@ import java.util.Optional; * Updates branch protection for all student repositories in a given course. */ @Controller -public class UpdateBranchProtection { +public class UpdateBranchProtection extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/students/InviteAllToRepository.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/students/InviteAllToRepository.java index 1803284..c33d3bd 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/students/InviteAllToRepository.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/students/InviteAllToRepository.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.students; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.Student; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -17,7 +18,7 @@ import java.util.List; import java.util.Optional; @Controller -public class InviteAllToRepository { +public class InviteAllToRepository extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/AssignToStudentTeams.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/AssignToStudentTeams.java index e1e23f2..8bbc84e 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/AssignToStudentTeams.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/AssignToStudentTeams.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.teaching_assistant_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.StudentTeam; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.TeachingAssistantTeam; @@ -14,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.*; @Controller -public class AssignToStudentTeams { +public class AssignToStudentTeams extends UserPageController { private CourseRepository courseRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/CreateTeachingAssistantTeam.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/CreateTeachingAssistantTeam.java index fef4843..d92e1c4 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/CreateTeachingAssistantTeam.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/CreateTeachingAssistantTeam.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.teaching_assistant_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.TeachingAssistant; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.TeachingAssistantTeam; @@ -15,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.Optional; @Controller -public class CreateTeachingAssistantTeam { +public class CreateTeachingAssistantTeam extends UserPageController { private CourseRepository courseRepository; private TeachingAssistantRepository teachingAssistantRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/TeachingAssistantTeamEntity.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/TeachingAssistantTeamEntity.java index 5923980..a4d60c1 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/TeachingAssistantTeamEntity.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/teaching_assistant_teams/TeachingAssistantTeamEntity.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.courses.entity.teaching_assistant_teams; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.teams.TeachingAssistantTeam; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -12,7 +13,7 @@ import org.springframework.web.bind.annotation.PathVariable; import java.util.Optional; @Controller -public class TeachingAssistantTeamEntity { +public class TeachingAssistantTeamEntity extends UserPageController { private CourseRepository courseRepository; private TeachingAssistantTeamRepository teachingAssistantTeamRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentCreateController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentCreateController.java index ffce89b..2f59c83 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentCreateController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentCreateController.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.students; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.Course; import nl.andrewlalis.teaching_assistant_assistant.model.people.Student; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.CourseRepository; @@ -17,7 +18,7 @@ import java.util.Optional; * Controller for creating a new student. */ @Controller -public class StudentCreateController { +public class StudentCreateController extends UserPageController { /** * A constant which defines what value is returned if the user says that the newly created student should not be diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentEntityController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentEntityController.java index 2d2f8f5..c727408 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentEntityController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/students/StudentEntityController.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.students; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.people.Student; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.StudentRepository; import org.springframework.stereotype.Controller; @@ -13,7 +14,7 @@ import java.util.Optional; * Controller for a single student entity. */ @Controller -public class StudentEntityController { +public class StudentEntityController extends UserPageController { private StudentRepository studentRepository; diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/teaching_assistants/TeachingAssistantEntityController.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/teaching_assistants/TeachingAssistantEntityController.java index acf4c94..9572e61 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/teaching_assistants/TeachingAssistantEntityController.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/teaching_assistants/TeachingAssistantEntityController.java @@ -1,5 +1,6 @@ package nl.andrewlalis.teaching_assistant_assistant.controllers.teaching_assistants; +import nl.andrewlalis.teaching_assistant_assistant.controllers.UserPageController; import nl.andrewlalis.teaching_assistant_assistant.model.people.TeachingAssistant; import nl.andrewlalis.teaching_assistant_assistant.model.repositories.TeachingAssistantRepository; import org.springframework.stereotype.Controller; @@ -13,7 +14,7 @@ import java.util.Optional; * Controller for a single teaching assistant entity. */ @Controller -public class TeachingAssistantEntityController { +public class TeachingAssistantEntityController extends UserPageController { private TeachingAssistantRepository teachingAssistantRepository; diff --git a/src/main/resources/static/css/footer.css b/src/main/resources/static/css/footer.css index 6f8e752..48a62c8 100644 --- a/src/main/resources/static/css/footer.css +++ b/src/main/resources/static/css/footer.css @@ -1,17 +1,9 @@ -.footer_bar { - background-color: darkslategray; - color: whitesmoke; - height: 30px; - padding-top: 20px; - padding-bottom: 20px; - position: fixed; - width: 100%; - bottom: 0; - z-index: -1; /* Make this footer appear above all other things. */ +body { + padding-bottom: 110px; } -.third { - width: 33%; - display: inline-block; - text-align: center; +.footer { + background-color: darkslategray; + color: whitesmoke; + height: 100px; } \ No newline at end of file diff --git a/src/main/resources/static/css/header.css b/src/main/resources/static/css/header.css index 4f929d5..11c0071 100644 --- a/src/main/resources/static/css/header.css +++ b/src/main/resources/static/css/header.css @@ -1,45 +1,13 @@ -body { - padding: 0; - margin: 0; - background-color: whitesmoke; -} - -.header_bar { +.header { background-color: green; - width: 100%; color: whitesmoke; - padding-bottom: 20px; - padding-top: 20px; - height: 30px; } -.header_title { - margin-top: auto; - margin-bottom: auto; - width: 25%; - display: inline; - font-size: 30px; -} - -.header_link_list { - list-style-type: none; - margin: 0; - padding: 0; - width: 75%; - display: inline; -} - -.header_link_list li { - display: inline-block; -} - -.header_link_list a { +.header a { text-decoration: none; color: inherit; - background-color: darkgreen; - padding: 10px; } -.header_link_list a:hover { - background-color: darkgray; +.header a:hover { + color: lightgray; } \ No newline at end of file diff --git a/src/main/resources/static/css/style.css b/src/main/resources/static/css/style.css index 1505eac..6f2cfb1 100644 --- a/src/main/resources/static/css/style.css +++ b/src/main/resources/static/css/style.css @@ -2,6 +2,7 @@ body { font-family: sans-serif; background-color: white; + padding-bottom: 70px; } .content_container { diff --git a/src/main/resources/static/images/favicon.ico b/src/main/resources/static/images/favicon.ico new file mode 100644 index 0000000..8c497af Binary files /dev/null and b/src/main/resources/static/images/favicon.ico differ diff --git a/src/main/resources/static/images/logo.png b/src/main/resources/static/images/logo.png new file mode 100644 index 0000000..9281ddc Binary files /dev/null and b/src/main/resources/static/images/logo.png differ diff --git a/src/main/resources/templates/fragments/footer.html b/src/main/resources/templates/fragments/footer.html index d2879dd..c0c9261 100644 --- a/src/main/resources/templates/fragments/footer.html +++ b/src/main/resources/templates/fragments/footer.html @@ -5,19 +5,32 @@
-