Skip to content
Snippets Groups Projects
Commit 250d0337 authored by Connor Brock's avatar Connor Brock
Browse files

Started integrating dropdown menu using CSS, also commented out code causing...

Started integrating dropdown menu using CSS, also commented out code causing errors. Will fix when implementing database retrieval.
parent 1ce226b5
No related branches found
No related tags found
1 merge request!41Resolve "As a convenience enthusiast, I want a drop down menu to be able to quickly scan QR codes I find along my dragon trail so that I may continue on my adventure without disruption."
......@@ -36,12 +36,12 @@ public class DragonsTaleController {
return modelAndView;
}
@GetMapping("/dragonstale/{landmarkID}")
public Integer getDTLandmarkID(@RequestParam(value="landmarkID") int landmark){
Integer idCounter = 0;
modelAndView = new ModelAndView("/dragonstale/{landmarkID}")
.addObject() //All your doing is retrieving the information from the database giving it to a string variable.
}
// @GetMapping("/dragonstale/{landmarkID}")
// public Integer getDTLandmarkID(@RequestParam(value="landmarkID") int landmark){
// Integer idCounter = 0;
// modelAndView = new ModelAndView("/dragonstale/{landmarkID}")
// .addObject() //All your doing is retrieving the information from the database giving it to a string variable.
// }
//Create another controller that directs to the given DragonsTale..Trail.. and updates the users account accordingly.
......
......@@ -13,18 +13,18 @@ public class DragonsTaleJDBC implements DragonsTaleRepository{
private RowMapper<User> userMapper;
@Override
public Map<Long, Boolean> getDTCompletion(int landmarkID){
//Be conscious of sql injections here.
String sql = "SELECT userid, trailID, completedOrNot FROM dtprogress WHERE landmarkID = ?";
int dtQuery = jdbc.query(sql, landmarkID);
//Query it twice to extract the given parameters, then use these parameters in a loop to query the completion.
List<Map<String, Integer>> query = jdbc.query(sql, id);
Map<Long, Boolean> dtProgress = new HashMap<>();
for (Map<String, Object> result : dtQuery) {
dtProgress.put((Long)result.get("stickerID"), (boolean)result.get("hasSticker"));
}
return dtProgress;
}
// @Override
// public Map<Long, Boolean> getDTCompletion(int landmarkID){
// //Be conscious of sql injections here.
// String sql = "SELECT userid, trailID, completedOrNot FROM dtprogress WHERE landmarkID = ?";
// int dtQuery = jdbc.query(sql, landmarkID);
// //Query it twice to extract the given parameters, then use these parameters in a loop to query the completion.
// List<Map<String, Integer>> query = jdbc.query(sql, id);
//
// Map<Long, Boolean> dtProgress = new HashMap<>();
// for (Map<String, Object> result : dtQuery) {
// dtProgress.put((Long)result.get("stickerID"), (boolean)result.get("hasSticker"));
// }
// return dtProgress;
// }
}
......@@ -8,14 +8,33 @@ body{
background-color: #927BB7;
}
.dropdown{
.dropdown button{
background-color: coral;
color: white;
padding: 20px;
padding: 25px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropdown a{
display: block;
color: #393433;
text-decoration: none;
padding: 10px 15px;
}
.dropdown .content{
position: absolute;
background-color: #D3B69C;
min-width:100px;
}
.dropdown:hover .content{
display: block;
}
.images{
max-width:100%;
height:auto;
......
var getQR = function (){
// document.getElementById("qrCodeScanner").style.cursor = "pointer";
window.location.href = "/QRScan";
}
\ No newline at end of file
......@@ -30,7 +30,7 @@
<div class="dropdown">
<button class="dropdownButton">There are <span th:text="${getListSize}"> Size of List </span> adventures in this journey! </button>
<ul th:each="item : ${landmarksList}" id="tabBox">
<li>
<li class="content">
<a id="#" href="#landmarkTabLink" th:text="${item.landmarkName}"> Landmark Tab</a>
<button id="qrCodeScanner" onclick="getQR()">Click here to scan a QR code for: <span th:text="${item.landmarkName}">Landmark Name Here</span></button>
</li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment