Why do you think you can't use a `th:block` inside another? That should work fine.
I asked ChatGPT to translate it and it came up with this which seems very reasonable. I could not
test it since I don't have your backend, but maybe it will help you along. It certainly _looks_ reasonable at first sight:
Feel free to ask a specific follow-up question if there is still something that is not working.