Merge branch 'ergo' into 'staging'

Ergo

See merge request PhilippHofer/rot!63
This commit is contained in:
PhilippHofer 2023-11-02 13:04:12 +00:00
commit bf24c8aa9c
3 changed files with 39 additions and 15 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ db.sqlite
Rocket.toml Rocket.toml
frontend/node_modules/* frontend/node_modules/*
/static/ /static/
/data-ergo/

View File

@ -68,19 +68,21 @@ function selectBoatChange() {
} }
function reloadPage() { function reloadPage() {
let pageTitle = document.title; if (!window.location.href.includes("ergo")){
let attentionMessage = 'Riemen- und Dollenbruch'; let pageTitle = document.title;
let attentionMessage = 'Riemen- und Dollenbruch';
document.addEventListener('visibilitychange', function() { document.addEventListener('visibilitychange', function() {
let isPageActive = !document.hidden; let isPageActive = !document.hidden;
if(!isPageActive){ if(!isPageActive){
document.title = attentionMessage; document.title = attentionMessage;
} else { } else {
document.title = pageTitle; document.title = pageTitle;
location.reload(); location.reload();
} }
}); });
}
} }
function setMaxAmountRowers(name: string, rowers: number) { function setMaxAmountRowers(name: string, rowers: number) {

View File

@ -7,6 +7,19 @@
{% if flash %} {% if flash %}
{{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }} {{ macros::alert(message=flash.1, type=flash.0, class="sm:col-span-2 lg:col-span-3") }}
{% endif %} {% endif %}
<details>
<summary>Deine Daten</summary>
<p>
Folgende Daten hat der Ruderassistent von dir. Wenn diese nicht mehr aktuell sind, bitte gewünschte Änderungen an Philipp melden (Tel. nr siehe Signal, oder an it@rudernlinz.at).
<br /><br />
<ul>
<li>Geburtsdatum: {{ loggedin_user.dob }}</li>
<li>Gewicht: {{ loggedin_user.weight}} kg</li>
<li>Geschlecht: {{ loggedin_user.sex}}</li>
</ul>
</p>
</details>
<h1 class="h1">Neuer Eintrag</h1> <h1 class="h1">Neuer Eintrag</h1>
<details> <details>
<summary>Dirty Thirty</summary> <summary>Dirty Thirty</summary>
@ -16,11 +29,15 @@
<label for="user-thirty" class="text-sm text-gray-600">Ergo-Fahrer</label> <label for="user-thirty" class="text-sm text-gray-600">Ergo-Fahrer</label>
<select name="user" id="user-thirty" class="input"> <select name="user" id="user-thirty" class="input">
{% for user in users %} {% for user in users %}
<option value="{{ user.id }}">{{ user.name }}</option> {% if user.id == loggedin_user.id %}
<option value="{{ user.id }}" selected="selected">{{ user.name }}</option>
{% else %}
<option value="{{ user.id }}">{{ user.name }}</option>
{% endif %}
{% endfor %} {% endfor %}
</select> </select>
{{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }}
<input type="file" name="proof" class="input"> <input type="file" name="proof" class="input" accept="image/*" capture="camera">
<input type="submit" value="Speichern" class="btn btn-primary w-full col-span-4 m-auto"/> <input type="submit" value="Speichern" class="btn btn-primary w-full col-span-4 m-auto"/>
</form> </form>
</div> </div>
@ -36,11 +53,15 @@
<select name="user" id="user-dozen" class="input"> <select name="user" id="user-dozen" class="input">
<option disabled="disabled">User auswählen</option> <option disabled="disabled">User auswählen</option>
{% for user in users %} {% for user in users %}
<option value="{{ user.id }}">{{ user.name }}</option> {% if user.id == loggedin_user.id %}
<option value="{{ user.id }}" selected="selected">{{ user.name }}</option>
{% else %}
<option value="{{ user.id }}">{{ user.name }}</option>
{% endif %}
{% endfor %} {% endfor %}
</select> </select>
{{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }} {{ macros::input(label="Zeit [(hh:)mm:ss]/Distanz [m]", name="result", required=true, type="text", class="input") }}
<input type="file" name="proof" class="input"> <input type="file" name="proof" class="input" accept="image/*" capture="camera">
<input type="submit" value="Speichern" class="btn btn-primary w-full col-span-4 m-auto"/> <input type="submit" value="Speichern" class="btn btn-primary w-full col-span-4 m-auto"/>
</form> </form>
</div> </div>