Merge branch 'staging' of gitlab.com:PhilippHofer/rot into staging

This commit is contained in:
Marie Birner 2023-10-31 21:12:23 +01:00
commit 2bd5d76c2f
2 changed files with 21 additions and 1 deletions

View File

@ -129,6 +129,26 @@ function setMaxAmountRowers(name: string, rowers: number) {
// only_steering.parentElement?.parentElement?.parentElement?.classList.add('opacity-50');
// }
//}
let shipmaster = <HTMLElement>document.querySelector('#shipmaster-newrowerjs');
let steering_person = <HTMLElement>document.querySelector('#steering_person-newrowerjs');
if (rowers == 1){
if (shipmaster.parentNode) {
(<HTMLElement>shipmaster.parentNode).classList.add('hidden');
}
if (steering_person.parentNode){
(<HTMLElement>steering_person.parentNode).classList.add('hidden');
}
}else{
if (shipmaster.parentNode){
(<HTMLElement>shipmaster.parentNode).classList.remove('hidden');
}
shipmaster.setAttribute('required', 'required');
if (steering_person.parentNode){
(<HTMLElement>steering_person.parentNode).classList.remove('hidden');
}
steering_person.setAttribute('required', 'required');
}
}
}

View File

@ -244,7 +244,7 @@ ORDER BY departure DESC
};
if let Ok(log_to_finalize) = TryInto::<LogToFinalize>::try_into(log.clone()) {
//TODO: fix clone()
//TODO: fix clone() above
if !boat.shipmaster_allowed(created_by_user).await {
return Err(LogbookCreateError::UserNotAllowedToUseBoat);