Commit 5b7d9717 authored by Pernille Nødtvedt Welle-Watne's avatar Pernille Nødtvedt Welle-Watne
Browse files

Merge branch 'fix-athlete-suggest' into 'master'

make no athlete page more user friendly

See merge request !15
parents b4a75ef7 bc22cd97
Pipeline #117082 passed with stages
in 3 minutes and 23 seconds
......@@ -401,15 +401,13 @@ window.addEventListener("DOMContentLoaded", async () => {
postCommentButton.addEventListener("click", (async (id) => await createComment(id)).bind(undefined, id));
}
} else {
await createBlankExercise();
coachTitle.className = coachTitle.className.replace("hide", "");
if (currentUser.athletes.length > 0) {
await selectAthletesForSuggest(currentUser);
} else {
let alert = createAlert("Will no be able to suggest workout due to not having any athltes", undefined);
document.body.prepend(alert);
}
await createBlankExercise();
setReadOnly(false, "#form-workout");
let ownerInput = document.querySelector("#inputOwner");
......@@ -429,6 +427,12 @@ window.addEventListener("DOMContentLoaded", async () => {
okWorkoutButton.addEventListener("click", (async (currentUser) => await createSuggestWorkout(currentUser)).bind(undefined, currentUser));
cancelWorkoutButton.addEventListener("click", handleCancelDuringWorkoutCreate);
} else {
let description = document.querySelector("#description-no-athletes");
description.className = description.className.replace("hide", "");
}
}
});
\ No newline at end of file
......@@ -31,6 +31,11 @@
</h3>
</div>
</div>
<div class="row">
<div class="col-lg">
<p class="mt-4 hide" id="description-no-athletes" >You can not suggest a workout since you have no registered athletes</p>
</div>
</div>
<form class="row g-3 mb-4" id="form-workout">
<div class="col-lg-6">
<label for="inputName" class="form-label">Name</label>
......
Supports Markdown
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