Commit 9b015b89 authored by elisabeth kee's avatar elisabeth kee

Created matches, modify, and delete pages

parent 6ba16bca
...@@ -80,7 +80,7 @@ $(document).ready(function() { ...@@ -80,7 +80,7 @@ $(document).ready(function() {
} }
}); });
}); });
*/
$('#seeModifications').click(function(){ $('#seeModifications').click(function(){
let idProfile = $listeProfilesSelect2.val(); let idProfile = $listeProfilesSelect2.val();
$.ajax({ $.ajax({
...@@ -99,7 +99,7 @@ $(document).ready(function() { ...@@ -99,7 +99,7 @@ $(document).ready(function() {
}); });
return false; return false;
}); });
*/
$('#modifyFirstname').click(function(){ $('#modifyFirstname').click(function(){
let idProfile = $listeProfilesSelect2.val(); let idProfile = $listeProfilesSelect2.val();
let newFirstname = $('#firstname-modify').val(); let newFirstname = $('#firstname-modify').val();
...@@ -231,13 +231,13 @@ $(document).ready(function() { ...@@ -231,13 +231,13 @@ $(document).ready(function() {
//$listeLovers.append(`<li id="lover-${lover.id}" class="list-group-item">${lover.partnerGender} - who likes ${lover.partnerPet} <button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete" >X</button></li>`); //$listeLovers.append(`<li id="lover-${lover.id}" class="list-group-item">${lover.partnerGender} - who likes ${lover.partnerPet} <button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete" >X</button></li>`);
} }
/* Ajoute un élément li dans la liste de lovers /* Ajoute un élément li dans la liste de lovers*/
function showModifiedProfile(profile) { function showModifiedProfile(profile) {
liToAppend4 = `<li id="${profile.id}" class="list-group-item">You are: ${profile.firstname} - age: ${profile.age} - gender: ${profile.gender} - who likes: ${profile.pet} - contact info: ${profile.contact}`; liToAppend4 = `<li id="${profile.id}" class="list-group-item">You are: ${profile.firstname} - age: ${profile.age} - gender: ${profile.gender} - who likes: ${profile.pet} - contact info: ${profile.contact}`;
profile.lovers.forEach( lover => liToAppend4+= ` - interested in: ${lover.partnerGender} - who likes ${lover.partnerPet}`); profile.lovers.forEach( lover => liToAppend4+= ` - interested in: ${lover.partnerGender} - who likes ${lover.partnerPet}`);
liToAppend4+= `</li>`; liToAppend4+= `</li>`;
$listModifiedProfile.append(liToAppend4); $listModifiedProfile.append(liToAppend4);
}*/ }
/* Ajoute un élément li dans le select des lovers*/ /* Ajoute un élément li dans le select des lovers*/
function appendToSelects(lover) { function appendToSelects(lover) {
......
...@@ -21,40 +21,20 @@ ...@@ -21,40 +21,20 @@
</p> </p>
<h2 style="color:crimson;">Ready to find love?</h2> <h2 style="color:crimson;">Ready to find love?</h2>
<p>Select your profile and search for matches by clicking on your green ";)" button : </p> <div class="form-group">
<ul class="list-group" id="listProfilesSelect"> <input type="button" id="searchForLove" name="searchbtn" value="Search For Love" class="btn btn-primary btn-sm" onclick="window.location.href='pageFindMatches.html'"/>
</ul> </div>
<p>Here are your matches : </p>
<ul class= "list-group" id="listMatches"></ul>
</p>
<p> <p>
<h2 style="color:orangered;">Everyone changes at some point in their lives...</h2> <h2 style="color:orangered;">Everyone changes at some point in their lives...</h2>
<div class="form-group"> <div class="form-group">
<p>Select the profile you wish to modify : </p> <input type="button" id="ModifyProfile" name="modifybtn" value="Modify Your Profile" class="btn btn-primary btn-sm" onclick="window.location.href='pageModifyProfile.html'"/>
<p><select id="listProfilesSelect2"></select></p>
<p>Modify your profile info : </p>
<p>Firstname : <input type="text" name="firstname" id="firstname-modify"><input type="button" id="modifyFirstname" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Gender (Male/Female/Other): <input type="text" name="gender" id="gender-modify"><input type="button" id="modifyGender" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>For a pet, what do you prefer (cats/dogs/other) ? : <input type="text" name="pet" id="pet-modify"><input type="button" id="modifyPet" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Contact information for potential lovers : <input type="text" name="contact" id="contact-modify"><input type="button" id="modifyContact" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Age : <input type="text" name="age" id="age-modify"><input type="button" id="modifyAge" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Want to choose a new love interest ?: </p>
<p><select id="selectLovers2"></select><input type="button" id="modifyLover" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>See your new profile now that you have made all your modifications: </p>
<p><input type="button" id="seeModifications" name="addbtn" value="Modified" class="btn btn-primary btn-sm"></p>
<ul class="list-group" id="showModifiedProfile">
</ul>
</div> </div>
</p> </p>
<p> <p>
<h2>Are you now spoken for?</h2> <h2 style="color:slategray;">No longer need to search for love?</h2>
<div class="form-group"> <div class="form-group">
<label>Want to delete your profile ? Click on the red "X" button :</label> <input type="button" id="deleteProfile" name="deletebtn" value="Delete Your Profile" class="btn btn-primary btn-sm" onclick="window.location.href='pageDelete.html'"/>
<ul class= "list-group" id="listProfilesDelete">
</ul>
</div> </div>
</p> </p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
......
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Time to delete your profile!</title>
</head>
<body style="background-color:honeydew; margin-left:10cm; margin-right:10cm;">
<p><h1 style="color:deeppink; text-align: center;">Time to delete your profile!</h1></p>
<main>
<div class="form-group">
<label>Want to delete your profile ? Simply click on the red "X" button next to your profile :</label>
<ul class= "list-group" id="listProfilesDelete">
</ul>
<input type="button" id="goHome" name="homebtn" value="Go back to the home screen" class="btn btn-primary btn-sm" onclick="window.location.href='index.html'"/>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="hello1.js"></script>
</main>
<footer>
</footer>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Time to find love!</title>
</head>
<body style="background-color:honeydew; margin-left:10cm; margin-right:10cm;">
<p><h1 style="color:deeppink; text-align: center;">Time to find the love you are searching for!</h1></p>
<main>
<p>Find your profile and search for matches by clicking on your green ";)" button : </p>
<ul class="list-group" id="listProfilesSelect">
</ul>
<p>Here are your matches : </p>
<ul class= "list-group" id="listMatches"></ul>
<p>Why not go ahead and contact them ? ;)</p>
</p>
<input type="button" id="goHome" name="homebtn" value="Go back to the home screen" class="btn btn-primary btn-sm" onclick="window.location.href='index.html'"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="hello1.js"></script>
</main>
<footer>
</footer>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Time to modify your profile!</title>
</head>
<body style="background-color:honeydew; margin-left:10cm; margin-right:10cm;">
<p><h1 style="color:deeppink; text-align: center;">Time to modify your profile!</h1></p>
<main>
<div class="form-group">
<p>Select the profile you wish to modify : </p>
<p><select id="listProfilesSelect2"></select></p>
<p>Modify your profile info by entering in new info and then clicking on the "Modify" button : </p>
<p>Firstname : <input type="text" name="firstname" id="firstname-modify"><input type="button" id="modifyFirstname" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Gender (Male/Female/Other): <input type="text" name="gender" id="gender-modify"><input type="button" id="modifyGender" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>For a pet, what do you prefer (cats/dogs/other) ? : <input type="text" name="pet" id="pet-modify"><input type="button" id="modifyPet" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Contact information for potential lovers : <input type="text" name="contact" id="contact-modify"><input type="button" id="modifyContact" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Age : <input type="text" name="age" id="age-modify"><input type="button" id="modifyAge" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
<p>Want to choose a new love interest ?: </p>
<p><select id="selectLovers2"></select><input type="button" id="modifyLover" name="addbtn" value="Modify" class="btn btn-primary btn-sm"></p>
</div>
<input type="button" id="goHome" name="homebtn" value="Go back to the home screen" class="btn btn-primary btn-sm" onclick="window.location.href='index.html'"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="hello1.js"></script>
</main>
<footer>
</footer>
</body>
</html>
\ No newline at end of file
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
<ul class="list-group" id="listLovers"> <ul class="list-group" id="listLovers">
</ul> </ul>
<input type="button" id="goHome" name="homebtn" value="Go back to the home screen" class="btn btn-primary btn-sm" onclick="window.location.href='index.html'"/>
</div> </div>
<p> <p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment