Skip to content

Commit

Permalink
another frontend update
Browse files Browse the repository at this point in the history
  • Loading branch information
hajekad3 committed Jan 4, 2023
1 parent e144201 commit c6d2a32
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 156 deletions.
48 changes: 24 additions & 24 deletions frontEnd/coach.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ <h1> Coach </h1>

<section id="getRequest">
<h2>Get</h2>
<label for="id-input-get">ID:</label>
<input type="text" id="id-input-get" />
<label for="id-get">ID:</label>
<input type="text" id="id-get" />
<br />
<button onclick="coachGet()">Get Coach</button>
<br />
Expand All @@ -28,20 +28,20 @@ <h2>Get</h2>

<section id="postCoach">
<h2>Post</h2>
<label for="cost-rate-input-post">Cost rate:</label>
<input type="text" id="cost-rate-input-post" />
<label for="cost-rate-post">Cost rate:</label>
<input type="text" id="cost-rate-post" />
<br />
<label for="password-input-post">Password:</label>
<input type="password" id="password-input-post" />
<label for="password-post">Password:</label>
<input type="password" id="password-post" />
<br />
<label for="email-input-post">Email:</label>
<input type="email" id="email-input-post" />
<label for="email-post">Email:</label>
<input type="email" id="email-post" />
<br />
<label for="first-name-input-post">First name:</label>
<input type="text" id="first-name-input-post" />
<label for="first-name-post">First name:</label>
<input type="text" id="first-name-post" />
<br />
<label for="second-name-input-post">Second name:</label>
<input type="text" id="second-name-input-post" />
<label for="second-name-post">Second name:</label>
<input type="text" id="second-name-post" />
<br />
<button onclick="createCoach()">Create Coach</button>
<br />
Expand All @@ -50,8 +50,8 @@ <h2>Post</h2>

<section id="deleteRequest">
<h2>Delete</h2>
<label for="id-input-delete">ID:</label>
<input type="text" id="id-input-delete" />
<label for="id-delete">ID:</label>
<input type="text" id="id-delete" />
<button onclick="coachDelete()">Delete Coach</button>
<textarea id="responseDelete"></textarea>
</section>
Expand All @@ -61,20 +61,20 @@ <h2>Update</h2>
<label for="id-update">Id:</label>
<input type="text" id="id-update" />
<br />
<label for="cost-rate-input-update">Cost rate:</label>
<input type="number" id="cost-rate-input-update" min="0" max="10000" />
<label for="cost-rate-update">Cost rate:</label>
<input type="number" id="cost-rate-update" min="0" max="10000" />
<br />
<label for="password-input-update">Password:</label>
<input type="password" id="password-input-update" />
<label for="password-update">Password:</label>
<input type="password" id="password-update" />
<br />
<label for="email-input-update">Email:</label>
<input type="email" id="email-input-update" />
<label for="email-update">Email:</label>
<input type="email" id="email-update" />
<br />
<label for="first-name-input-update">First name:</label>
<input type="text" id="first-name-input-update" />
<label for="first-name-update">First name:</label>
<input type="text" id="first-name-update" />
<br />
<label for="second-name-input-update">Second name:</label>
<input type="text" id="second-name-input-update" />
<label for="second-name-update">Second name:</label>
<input type="text" id="second-name-update" />
<br />

<label for="trainings-update">Trainings:</label>
Expand Down
24 changes: 12 additions & 12 deletions frontEnd/coach.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
async function coachGet() {
const id = document.getElementById('id-input-get').value;
const id = document.getElementById('id-get').value;
get(id, '/coach');
}

async function createCoach() {
const costRate = document.getElementById('cost-rate-input-post').value;
const password = document.getElementById('password-input-post').value;
const email = document.getElementById('email-input-post').value;
const firstName = document.getElementById('first-name-input-post').value;
const secondName = document.getElementById('second-name-input-post').value;
const costRate = document.getElementById('cost-rate-post').value;
const password = document.getElementById('password-post').value;
const email = document.getElementById('email-post').value;
const firstName = document.getElementById('first-name-post').value;
const secondName = document.getElementById('second-name-post').value;

const createCoachDto = {
costRate: costRate,
Expand All @@ -22,17 +22,17 @@ async function createCoach() {
}

async function coachDelete() {
const id = document.getElementById('id-input-delete').value;
const id = document.getElementById('id-delete').value;
remove(id, '/coach');
}

async function updateCoach() {
const id = document.getElementById('id-update').value;
const costRate = document.getElementById('cost-rate-input-update').value;
const password = document.getElementById('password-input-update').value;
const email = document.getElementById('email-input-update').value;
const firstName = document.getElementById('first-name-input-update').value;
const secondName = document.getElementById('second-name-input-update').value;
const costRate = document.getElementById('cost-rate-update').value;
const password = document.getElementById('password-update').value;
const email = document.getElementById('email-update').value;
const firstName = document.getElementById('first-name-update').value;
const secondName = document.getElementById('second-name-update').value;
const inputs = document.querySelectorAll('.trainingInput');
const trainings = Array.from(inputs).map(input => Number(input.value));

Expand Down
70 changes: 27 additions & 43 deletions frontEnd/place.html
Original file line number Diff line number Diff line change
@@ -1,84 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<title>Trainee</title>
<title>Place</title>
</head>
<body>
<header>
<h1> Trainee </h1>
<h1> Place </h1>
<nav>
<ul>
<li><a href="coach.html">Coach</a></li>
<li><a href="training.html">Training</a></li>
<li><a href="place.html">Place</a></li>
<li><a href="trainee.html">Trainee</a></li>
</ul>
</nav>
</header>
<main>

<section id="getRequest">
<h2>Get</h2>
<label for="id-input-get">ID:</label>
<input type="text" id="id-input-get" />
<label for="id-get">ID:</label>
<input type="text" id="id-get" />
<br />
<button onclick="traineeGet()">Get Trainee</button>
<button onclick="placeGet()">Get Place</button>
<br />
<textarea id="responseGet"></textarea>
</section>

<section id="postTrainee">
<h2>Create Trainee</h2>
<section id="postPlace">
<h2>Create Place</h2>
<form>
<label for="username-input-post">Username:</label><br>
<input type="text" id="username-input-post" name="username"><br>
<label for="password-input-post">Password:</label><br>
<input type="text" id="password-input-post" name="password"><br>
<label for="email-input-post">Email:</label><br>
<input type="text" id="email-input-post" name="email"><br>
<label for="first-name-input-post">First Name:</label><br>
<input type="text" id="first-name-input-post" name="firstName"><br>
<label for="second-name-input-post">Second Name:</label><br>
<input type="text" id="second-name-input-post" name="secondName"><br>
<label for="skill-cap-input-post">Skill Cap:</label><br>
<input type="text" id="skill-cap-input-post" name="skillCap"><br>
<button type="button" onclick="createTrainee()">Create Trainee</button>
<label for="longitude-post">Longitude:</label><br>
<input type="text" id="username-post"><br>
<label for="latitude-post">Latitude:</label><br>
<input type="text" id="latitude-post"><br>
</form>
<textarea id="responsePost" rows="10" cols="50"></textarea>
</section>

<section id="deleteRequest">
<h2>Delete</h2>
<label for="id-input-delete">ID:</label>
<input type="text" id="id-input-delete" />
<button onclick="traineeDelete()">Delete Trainee</button>
<label for="id-delete">ID:</label>
<input type="text" id="id-delete" />
<button onclick="placeDelete()">Delete Place</button>
<textarea id="responseDelete"></textarea>
</section>

<section id="updateTrainee">
<h2>Create Trainee</h2>
<section id="updatePlace">
<h2>Update Place</h2>
<form>
<label for="id-update">Trainee ID:</label><br>
<input type="text" id="id-update" name="id"><br>
<label for="username-input-update">Username:</label><br>
<input type="text" id="username-input-update" name="username"><br>
<label for="password-input-update">Password:</label><br>
<input type="text" id="password-input-update" name="password"><br>
<label for="email-input-update">Email:</label><br>
<input type="text" id="email-input-update" name="email"><br>
<label for="first-name-input-update">First Name:</label><br>
<input type="text" id="first-name-input-update" name="firstName"><br>
<label for="second-name-input-update">Second Name:</label><br>
<input type="text" id="second-name-input-update" name="secondName"><br>
<label for="skill-cap-input-update">Skill Cap:</label><br>
<input type="text" id="skill-cap-input-update" name="skillCap"><br>
<button type="button" onclick="updateTrainee()">Update Trainee</button>
<label for="id-update">Id:</label><br>
<input type="text" id="id-update"><br>
<label for="longitude-update">Longitude:</label><br>
<input type="text" id="longitude-update"><br>
<label for="latitude-updpate">Latitude:</label><br>
<input type="text" id="latitude-udpate"><br>
<label for="training-update">Trainings:</label><br>
<input type="text" id="training-update"><br>
</form>
<textarea id="responsePut" rows="10" cols="50"></textarea>
<textarea id="responsePost" rows="10" cols="50"></textarea>
</section>
</main>
<footer>
<p>Copyright 2022</p>
</footer>
<script src="trainee.js"></script>
<script src="place.js"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions frontEnd/place.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
async function placeGet() {
const id = document.getElementById('id-input-get').value;
const id = document.getElementById('id-get').value;
get(id, '/place');
}

Expand All @@ -16,7 +16,7 @@ async function createPlace() {
}

async function placeDelete() {
const id = document.getElementById('id-input-delete').value;
const id = document.getElementById('id-delete').value;
remove(id, '/place')
}

Expand Down
60 changes: 30 additions & 30 deletions frontEnd/trainee.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ <h1> Trainee </h1>

<section id="getRequest">
<h2>Get</h2>
<label for="id-input-get">ID:</label>
<input type="text" id="id-input-get" />
<label for="id-get">ID:</label>
<input type="text" id="id-get" />
<br />
<button onclick="traineeGet()">Get Trainee</button>
<br />
Expand All @@ -29,48 +29,48 @@ <h2>Get</h2>
<section id="postTrainee">
<h2>Create Trainee</h2>
<form>
<label for="username-input-post">Username:</label><br>
<input type="text" id="username-input-post" name="username"><br>
<label for="password-input-post">Password:</label><br>
<input type="text" id="password-input-post" name="password"><br>
<label for="email-input-post">Email:</label><br>
<input type="text" id="email-input-post" name="email"><br>
<label for="first-name-input-post">First Name:</label><br>
<input type="text" id="first-name-input-post" name="firstName"><br>
<label for="second-name-input-post">Second Name:</label><br>
<input type="text" id="second-name-input-post" name="secondName"><br>
<label for="skill-cap-input-post">Skill Cap:</label><br>
<input type="text" id="skill-cap-input-post" name="skillCap"><br>
<label for="username-post">Username:</label><br>
<input type="text" id="username-post"><br>
<label for="password-post">Password:</label><br>
<input type="text" id="password-post"><br>
<label for="email-post">Email:</label><br>
<input type="text" id="email-post"><br>
<label for="first-name-post">First Name:</label><br>
<input type="text" id="first-name-post"><br>
<label for="second-name-post">Second Name:</label><br>
<input type="text" id="second-name-post"><br>
<label for="skill-cap-post">Skill Cap:</label><br>
<input type="text" id="skill-cap-post"><br>
<button type="button" onclick="createTrainee()">Create Trainee</button>
</form>
<textarea id="responsePost" rows="10" cols="50"></textarea>
</section>

<section id="deleteRequest">
<h2>Delete</h2>
<label for="id-input-delete">ID:</label>
<input type="text" id="id-input-delete" />
<label for="id-delete">ID:</label>
<input type="text" id="id-delete" />
<button onclick="traineeDelete()">Delete Trainee</button>
<textarea id="responseDelete"></textarea>
</section>

<section id="updateTrainee">
<h2>Create Trainee</h2>
<h2>Update Trainee</h2>
<form>
<label for="id-update">Trainee ID:</label><br>
<input type="text" id="id-update" name="id"><br>
<label for="username-input-update">Username:</label><br>
<input type="text" id="username-input-update" name="username"><br>
<label for="password-input-update">Password:</label><br>
<input type="text" id="password-input-update" name="password"><br>
<label for="email-input-update">Email:</label><br>
<input type="text" id="email-input-update" name="email"><br>
<label for="first-name-input-update">First Name:</label><br>
<input type="text" id="first-name-input-update" name="firstName"><br>
<label for="second-name-input-update">Second Name:</label><br>
<input type="text" id="second-name-input-update" name="secondName"><br>
<label for="skill-cap-input-update">Skill Cap:</label><br>
<input type="text" id="skill-cap-input-update" name="skillCap"><br>
<input type="text" id="id-update"><br>
<label for="username-update">Username:</label><br>
<input type="text" id="username-update"><br>
<label for="password-update">Password:</label><br>
<input type="text" id="password-update"><br>
<label for="email-update">Email:</label><br>
<input type="text" id="email-update"><br>
<label for="first-name-update">First Name:</label><br>
<input type="text" id="first-name-update"><br>
<label for="second-name-update">Second Name:</label><br>
<input type="text" id="second-name-update"><br>
<label for="skill-cap-update">Skill Cap:</label><br>
<input type="text" id="skill-cap-update"><br>
<button type="button" onclick="updateTrainee()">Update Trainee</button>
</form>
<textarea id="responsePut" rows="10" cols="50"></textarea>
Expand Down
4 changes: 2 additions & 2 deletions frontEnd/trainee.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
async function traineeGet() {
const id = document.getElementById('id-input-get').value;
const id = document.getElementById('id-get').value;
get(id, '/trainee');
}

Expand All @@ -24,7 +24,7 @@ async function createTrainee() {
}

async function traineeDelete() {
const id = document.getElementById('id-input-delete').value;
const id = document.getElementById('id-delete').value;
remove(id, '/trainee');
}

Expand Down
Loading

0 comments on commit c6d2a32

Please sign in to comment.