Skip to content

Commit

Permalink
Fix matching and add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony (Juntao) Hu committed Dec 5, 2021
1 parent 66b1138 commit 20fabd3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
8 changes: 7 additions & 1 deletion app/src/main/java/com/amigo/control/DashboardController.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
package com.amigo.control;

import java.util.List;

import com.amigo.match.DemoMatching;
import com.amigo.match.Match;
import com.amigo.present.UserPresenter;
import com.amigo.user.User;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.servlet.ModelAndView;
Expand Down Expand Up @@ -33,6 +36,9 @@ public ModelAndView showDashboard(@ModelAttribute User user) {
public ModelAndView showMatchingScreen() {
ModelAndView mav = new ModelAndView("matching-screen");
User currentUser = presenter.getUser();
var allMatches = DemoMatching.doMatching(currentUser);
List<Match> matchList = allMatches.get(currentUser.getId());
currentUser.setCurrentMatches(matchList);

int counter = 0;
for (var each : currentUser.getCurrentMatches()) {
Expand Down
28 changes: 14 additions & 14 deletions app/src/main/resources/templates/matching-screen.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
</head>
<body class="body">
<div class="navigator-div">
<a href="index.html" class="button-2 w-button"><strong>Amigos</strong></a>
<a href="/index" class="button-2 w-button"><strong>Amigos</strong></a>
<a href="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/CSC207-UofT/course-project-super-turtle-hackers" target="_blank" class="button w-button"><strong>SuperTurtleHackers</strong></a>
<link rel="prefetch" href="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/CSC207-UofT/course-project-super-turtle-hackers"><img src="images/github.png" loading="lazy" width="38" alt="" class="image-9">
</div>
<div class="div-block-11">
<a href="main-account-page.html" class="home-copy w-button">Home</a>
<a href="/dashboard" class="home-copy w-button">Home</a>
<div class="normal-text-style-copy">Choose an Amigo from below</div>
</div>
<div class="w-layout-grid grid">
<div class="div-for-match-1"><img src="images/Empty-profile-icon.png" loading="lazy" width="41" alt="" class="profile-pic">
<h5 class="username">User1</h5>
<h5 class="username" th:utext="${name_1}">User1</h5>
<div class="w-layout-grid match-1-info-grid">
<h6>Hobbies</h6>
<h6>Sports Interests</h6>
Expand All @@ -39,14 +39,14 @@ <h6>Recreation interests</h6>
<div th:utext="${music_1}">This is some text inside of a div block.</div>
<div th:utext="${recreational_1}">This is some text inside of a div block.</div>
<div id="w-node-_58ef5489-6995-c249-6e87-a6ad2f52c0b8-727523c4" class="w-layout-grid grid-4">
<h6>Common Courses</h6>
<h6>Courses</h6>
<div th:utext="${courses_1}">This is some text inside of a div block.</div>
<a href="user1-profile.html" class="button-5 w-button">Select User1      &gt;</a>
<a href="user1-profile.html" class="button-5 w-button">Select Them      &gt;</a>
</div>
</div>
</div>
<div class="div-for-match-2"><img src="images/Empty-profile-icon.png" loading="lazy" width="41" alt="" class="match-2-pic">
<h5 class="match-2-username">User2</h5>
<h5 class="match-2-username" th:utext="${name_2}">User2</h5>
<div class="w-layout-grid match-2-info-grid">
<h6>Hobbies</h6>
<h6>Sports Interests</h6>
Expand All @@ -57,14 +57,14 @@ <h6>Recreation interests</h6>
<div th:utext="${music_2}">This is some text inside of a div block.</div>
<div th:utext="${recreational_2}">This is some text inside of a div block.</div>
<div id="w-node-_5cc9eaae-d95c-d923-d660-28f1547a16ac-727523c4" class="w-layout-grid grid-4">
<h6>Common Courses</h6>
<h6>Courses</h6>
<div th:utext="${courses_2}">This is some text inside of a div block.</div>
<a href="user2-profile.html" class="button-5-copy w-button">Select User2     &gt;</a>
<a href="user2-profile.html" class="button-5-copy w-button">Select Them     &gt;</a>
</div>
</div>
</div>
<div class="div-for-match-3"><img src="images/Empty-profile-icon.png" loading="lazy" width="41" alt="" class="match-3-pic">
<h5 class="match-3-username">User3</h5>
<h5 class="match-3-username" th:utext="${name_3}">User3</h5>
<div class="w-layout-grid match-3-info-grid">
<h6>Hobbies</h6>
<h6>Sports Interests</h6>
Expand All @@ -75,14 +75,14 @@ <h6>Recreation interests</h6>
<div th:utext="${music_3}">This is some text inside of a div block.</div>
<div th:utext="${recreational_3}">This is some text inside of a div block.</div>
<div id="w-node-_9ffa7a2f-0d92-bc86-7085-ed5f5b96ba7a-727523c4" class="w-layout-grid grid-4">
<h6>Common Courses</h6>
<h6>Courses</h6>
<div th:utext="${courses_3}">This is some text inside of a div block.</div>
<a href="user3-profile.html" class="button-5-copy-copy w-button">Select User3      &gt;</a>
<a href="user3-profile.html" class="button-5-copy-copy w-button">Select Them      &gt;</a>
</div>
</div>
</div>
<div class="div-for-match-4"><img src="images/Empty-profile-icon.png" loading="lazy" width="41" alt="" class="match-4-pic">
<h5 class="match-4-username">User4</h5>
<h5 class="match-4-username" th:utext="${name_4}">User4</h5>
<div class="w-layout-grid match-4-info-grid">
<h6>Hobbies</h6>
<h6>Sports Interests</h6>
Expand All @@ -93,9 +93,9 @@ <h6>Recreation interests</h6>
<div th:utext="${music_4}">This is some text inside of a div block.</div>
<div th:utext="${recreational_4}">This is some text inside of a div block.</div>
<div id="w-node-_31c8c668-211d-b1a0-3f15-da8fdee96d9c-727523c4" class="w-layout-grid grid-4">
<h6>Common Courses</h6>
<h6>Courses</h6>
<div th:utext="${courses_4}">This is some text inside of a div block.</div>
<a href="user4-profile.html" class="button-5-copy-copy-copy w-button">Select User4     &gt;</a>
<a href="user4-profile.html" class="button-5-copy-copy-copy w-button">Select Them     &gt;</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 20fabd3

Please sign in to comment.