Skip to content

Commit

Permalink
Clean-up & documentation #170
Browse files Browse the repository at this point in the history
  • Loading branch information
heming-langrenn committed Apr 24, 2024
1 parent 5b18f56 commit 45ec570
Show file tree
Hide file tree
Showing 12 changed files with 332 additions and 68 deletions.
2 changes: 2 additions & 0 deletions result_service_gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
PhotosEdit,
PhotoUpdate,
Ping,
PrintDash,
PrintLists,
Resultat,
ResultatEdit,
Expand Down Expand Up @@ -92,6 +93,7 @@ async def create_app() -> web.Application:
web.view("/photos_edit", PhotosEdit),
web.view("/photos", Photos),
web.view("/photo_update", PhotoUpdate),
web.view("/print_dash", PrintDash),
web.view("/print_lists", PrintLists),
web.view("/resultat", Resultat),
web.view("/resultat_edit", ResultatEdit),
Expand Down
3 changes: 2 additions & 1 deletion result_service_gui/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ height: 400px;

#spacer {
height: 4px;
background-color: white;
}

#minispacer {
Expand Down Expand Up @@ -665,7 +666,7 @@ width:auto;
}

img {
margin-bottom: -4px;
margin-bottom: 1px;
}

.lb_caption-container {
Expand Down
9 changes: 8 additions & 1 deletion result_service_gui/templates/control.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<a href=control?&event_id={{ event_id }}&action=control>Alle</a>
{% for klasse in raceclasses %}
{% if klasse.ranking %}
<a href=control?valgt_klasse={{ klasse.name }}&event_id={{ event_id }}&action=control>{{ klasse.name }}</a>
<a href=control?valgt_klasse={{ klasse.name }}&event_id={{ event_id }}&action=c>{{ klasse.name }}</a>
{% endif %}
{% endfor %}
</div>
Expand All @@ -39,7 +39,14 @@
</li>
{% endblock %}
{% block content %}
<! --- Information --->
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Her er det mulig å slette feilaktige registreringer.<br>
- Hvis du velger Alle klasser så vil kun system-error (valideringsfeil eller teknisk feil) vises.<br>
</div>
<div id=spacer></div>
<! --- End Information --->
<table>
<form action=/control method=post>
<tr>
Expand Down
92 changes: 75 additions & 17 deletions result_service_gui/templates/open_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,83 @@
<li class=dropdown>
<a href=javascript:void(0) class=dropbtn>...</a>
<div class=dropdown-content>
<table><tr><td>
<a id="myIndex" onclick="event_gui_href('myIndex', '')" href=><img id=menu_icon src="../static/icon_event.png"> Forsiden</a>
{% if event_id %}
<a id="myStart" onclick="result_gui_href('myStart', 'start?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_start.png"> Startlister</a>
<a id="myLive" onclick="result_gui_href('myLive', 'live?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_live.png"> Live</a>
<a id="myResult" onclick="result_gui_href('myResult', 'resultat?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_result.png"> Resultater</a>
<a id="myPhoto" onclick="result_gui_href('myPhoto', 'photos?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_photos.png"> Bilder</a>
{% if username != "Gjest" %}
</td><td>
<a id="myNewContestant" onclick="event_gui_href('myNewContestant', 'contestants?event_id={{ event_id }}&action=new_manual')" href=><img id=menu_icon src="../static/icon_new.png"> Etteranmelding</a>
<a id="myTiming" onclick="result_gui_href('myTiming', 'resultat_edit?event_id={{ event_id }}&heat=0')" href=><img id=menu_icon src="../static/icon_timing.png"> Tidtaker</a>
<a id="myTimingDash" onclick="result_gui_href('myTimingDash', 'timing_dash?event_id={{ event_id }}&heat=0')" href=><img id=menu_icon src="../static/icon_timing.png"> Admin: Tidtaker</a>
<a id="myAdmF" onclick="event_gui_href('myAdmF', 'tasks?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_event.png"> Admin: Sette rennet</a>
<a id="myAdmU" onclick="result_gui_href('myAdmU', 'dashboard?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_settings.png"> Admin: Renndagen</a>
<a id="myAdmB" onclick="result_gui_href('myAdmB', 'photos_edit?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_photos_adm.png"> Admin: Foto</a>
<table>
{% if not event_id %}
<tr>
<td>
<nobr><a id="myIndex" onclick="event_gui_href('myIndex', '')" href=><img id=menu_icon src="../static/icon_event.png"> Forsiden</a>&nbsp;</nobr>
</td>
</tr>
{% else %}
{% if username == "Gjest" %}
<tr><td id="black">
{{ event.name }}
</td></tr>
<tr><td>
<a id="myStart" onclick="result_gui_href('myStart', 'start?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_start.png"> Startlister</a>
</td></tr>
<tr><td>
<a id="myLive" onclick="result_gui_href('myLive', 'live?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_live.png"> Live</a>
</td></tr>
<tr><td>
<nobr><a id="myResult" onclick="result_gui_href('myResult', 'resultat?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_result.png"> Resultater&nbsp;</a></nobr>
</td></tr>
<tr><td>
<a id="myPhoto" onclick="result_gui_href('myPhoto', 'photos?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_photos.png"> Bilder</a>
</td></tr>
{% else %}
<tr>
<td id="black">{{ event.name }}</td>
<td>&nbsp;</td>
<td id="black">Renn-funksjoner</td>
<td>&nbsp;</td>
<td id="black">Admin-funksjoner</td>
</tr>
<tr>
<td><a id="myStart" onclick="result_gui_href('myStart', 'start?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_start.png"> Startlister</a></td>
<td>&nbsp;</td>
<td><nobr><a id="myNewContestant" onclick="event_gui_href('myNewContestant', 'contestants?event_id={{ event_id }}&action=new_manual')" href=><img id=menu_icon src="../static/icon_new.png"> Etteranmelding</a></nobr></td>
<td>&nbsp;</td>
<td><a id="myAdmF" onclick="event_gui_href('myAdmF', 'tasks?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_event.png"> Admin: Sette renn</a></td>
</tr>
<tr>
<td><a id="myLive" onclick="result_gui_href('myLive', 'live?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_live.png"> Live</a></td>
<td>&nbsp;</td>
<td><a id="myDNS" onclick="result_gui_href('myDNS', 'timing?event_id={{ event_id }}&action=start')" href=><img id=menu_icon src="../static/icon_timing.png"> Start: DNS</a></td>
<td>&nbsp;</td>
<td><nobr><a id="myTimingDash" onclick="result_gui_href('myTimingDash', 'timing_dash?event_id={{ event_id }}&heat=0')" href=><img id=menu_icon src="../static/icon_timing.png"> Admin: Kjøre renn</a></nobr></td>
</tr>
<tr>
<td><nobr><a id="myResult" onclick="result_gui_href('myResult', 'resultat?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_result.png"> Resultater&nbsp;</a></nobr></td>
<td>&nbsp;</td>
<td><a id="myStartEdit" onclick="result_gui_href('myStartEdit', 'start_edit?event_id={{ event_id }}&action=start')" href=><img id=menu_icon src="../static/icon_start.png"> Start: Endre</a></td>
<td>&nbsp;</td>
<td><a id="myAdmB" onclick="result_gui_href('myAdmB', 'photos_edit?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_photos_adm.png"> Admin: Foto</a></td>
</tr>
<tr>
<td><a id="myPhoto" onclick="result_gui_href('myPhoto', 'photos?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_photos.png"> Bilder</a></td>
<td>&nbsp;</td>
<td><a id="myTiming" onclick="result_gui_href('myTiming', 'resultat_edit?event_id={{ event_id }}&heat=0')" href=><img id=menu_icon src="../static/icon_timing.png"> Målpassering</a></td>
<td>&nbsp;</td>
<td></td>
</tr>
<tr>
<td></td>
<td>&nbsp;</td>
<td><a id="myPF" onclick="result_gui_href('myPF', 'photo_finish?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_photos.png"> Målfoto</a></td>
<td>&nbsp;</td>
<td></td>
</tr>
<tr>
<td></td>
<td>&nbsp;</td>
<td><a id="myPrint" onclick="result_gui_href('myPrint', 'print_dash?event_id={{ event_id }}')" href=><img id=menu_icon src="../static/icon_live.png"> Utskrifter</a></td>
<td>&nbsp;</td>
<td></td>
</tr>
{% endif %}
{% endif %}
</td></tr></table>
</table>
</div>
</li>
<li id=topborder class=active>
Expand All @@ -98,7 +157,6 @@
<a href="https://langrenn-sprint.github.io/docs/contestant.html" target="_blank">Docs</a>
{% else %}
<a id="myUsers" onclick="event_gui_href('myUsers', 'users')" href="/users">Brukere</a>
<a id="mySettings" onclick="event_gui_href('mySettings', 'settings')" href="/settings">Globale innstillinger</a>
<a href="https://langrenn-sprint.github.io/docs/" target="_blank">Docs</a>
<a href="/logout">Logg ut</a>
{% endif %}
Expand Down
17 changes: 8 additions & 9 deletions result_service_gui/templates/photo_finish.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,15 @@
{% endblock %}

{% block content %}
<! --- Information --->
<div id=spacer></div>
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Denne siden viser heat resultater og målfoto i read-only modus.<br>
- Klikk på et bilde for å vise det i stort format.
</div>
<div id=spacer></div>
<! --- End Information --->
<script>
/* this function will indicate with red or green colors if entered values are correct or not
if bib exist in heat, the bib will be green,
Expand Down Expand Up @@ -332,13 +340,4 @@
</tr>
</table>
</div>
<! --- Information --->
<div id=spacer></div>
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Denne siden viser heat resultater i read-only modus.<br>
- Klikk på et bilde for å vise det i stort format.
</div>
<div id=spacer></div>
<! --- End Information --->
{% endblock %}
122 changes: 122 additions & 0 deletions result_service_gui/templates/print_dash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{% extends "open_base.html" %}
{% block titlecontainer %}
<div class="w3-container">
{% endblock titlecontainer %}

{% block titleheader %}{{ lopsinfo }}{% endblock titleheader %}
{% block headercontainer %}{{ lopsinfo }} <img id=header_icon src="../static/icon_event.png"> {% endblock %}
{% block refresh %}{% endblock refresh %}
{% block titlemain %} <img id=menu_icon src="../static/icon_event.png"> {{ lopsinfo }}{% endblock titlemain %}
{% block menuitems %}{% endblock menuitems %}

{% block content %}
<! --- Information --->
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Utskrift kommer i eget vindu. Bruk Ctrl+P for å skrive ut.<br>
- Innstillinger som marker, papirtype og topptekst kan justeres i printer-menyen<br>
- Det er også mulighet til å lage PDF. Dette velges i printer-menyen<br>
</div>
<div id=spacer></div>
<! --- End Information --->

<div class="w3-row-padding">
<table cellpadding=4>
<tr>
<td colspan=5 id=spacer>&nbsp;</td>
</tr>
<tr id=headerblue>
<td id=table_border colspan=5>Utskrifter</td>
</tr>
<tr>
<td width=200>
<ul>
<li class=dropdown>
<a href=javascript:void(0) class=dropbtn>Kjøreplan</a>
<div class=dropdown-content>
<a target=_new href=print_lists?event_id={{ event_id }}&action=raceplan>Alle</a>
{% for klasse in raceclasses %}
<a target=_new href=print_lists?klasse={{ klasse.name }}&event_id={{ event_id }}&action=raceplan>{{ klasse.name }}</a>
{% endfor %}
</div>
</li>
</ul>
</td>
<td width=200>
<ul>
<li class=dropdown>
<a href=javascript:void(0) class=dropbtn>Startlister</a>
<div class=dropdown-content>
<table>
<tr><td colspan="5">
<a target=_new href=print_lists?event_id={{ event_id }}&action=start>Alle</a>
</td></tr>
{% for raceclass in raceclasses %}
<tr>
{% if event.competition_format != "Interval Start" %}
<td id="black">{{ raceclass.name }}</td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=start>Alle</a></nobr></td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=start&runde=Q>Kvart</a></nobr></td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=round_start&runde=Q>Semi</a></nobr></td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=round_start&runde=S>Finale</a></nobr></td>
{% else %}
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=start>{{ raceclass.name }}</a></nobr></td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
</li>
</ul>
</td>
<td width=200>
<ul>
<li class=dropdown>
<a href=javascript:void(0) class=dropbtn>Live resultater (heat)</a>
<div class=dropdown-content>
<table>
<tr>
<td><a target=_new href=print_lists?event_id={{ event_id }}&action=live>Alle</a></td>
</tr>
{% for raceclass in raceclasses %}
<tr>
{% if event.competition_format != "Interval Start" %}
<td id="black">{{ raceclass.name }}</td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=live>Alle</a></nobr></td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=live&runde=Q>Kvart</a></nobr></td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=live&runde=S>Semi</a></nobr></td>
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=live&runde=F>Finale</a></nobr></td>
{% else %}
<td><nobr><a target=_new href=print_lists?klasse={{ raceclass.name }}&event_id={{ event_id }}&action=live>{{ raceclass.name }}</a></nobr></td>
{% endif %}
</tr>
{% endfor %}
</table>
</div>
</li>
</ul>
</td>
<td width=200>
<ul>
<li class=dropdown>
<a href=javascript:void(0) class=dropbtn>Resultater (for klassen)</a>
<div class=dropdown-content>
<a target=_new href=print_lists?event_id={{ event_id }}&action=result>Alle</a>
{% for klasse in raceclasses %}
<a target=_new href=print_lists?klasse={{ klasse.name }}&event_id={{ event_id }}&action=result>{{ klasse.name }}</a>
{% endfor %}
</div>
</li>
</ul>
</td>
</tr>
<tr>
<td id=table_border colspan=5>Tips: Utskrift kommer i eget vindu. Bruk Ctrl+P for å skrive ut.</td>
</tr>
<tr>
<td colspan=5 id=spacer>&nbsp;</td>
</tr>
</table>
</div>

{% endblock content %}
17 changes: 8 additions & 9 deletions result_service_gui/templates/resultat_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@
{% endblock %}

{% block content %}
<! --- Information --->
<div id=spacer></div>
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Dokumentasjon her: <a href=https://langrenn-sprint.github.io/docs/timing.html>langrenn-sprint.github.io</a><br>
- Instruksjonsvideo: <a href=https://youtu.be/W3g0TeRBPj4?si=nuQyi_l9La6CUlvi>YouTube</a><br>
</div>
<div id=spacer></div>
<! --- End Information --->
<script>
function checkform(form) {
try {
Expand Down Expand Up @@ -601,13 +609,4 @@
</tr>
</table>
</div>
<! --- Information --->
<div id=spacer></div>
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Dokumentasjon her: <a href=https://langrenn-sprint.github.io/docs/timing.html>langrenn-sprint.github.io</a><br>
- Instruksjonsvideo: <a href=https://youtu.be/W3g0TeRBPj4?si=nuQyi_l9La6CUlvi>YouTube</a><br>
</div>
<div id=spacer></div>
<! --- End Information --->
{% endblock %}
14 changes: 13 additions & 1 deletion result_service_gui/templates/start_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,22 @@
{% endblock %}

{% block content %}
<! --- Information --->
<div id=spacer></div>
<div id=info-header><a id=info-header data-toggle="collapse" href="#info-zone">TIPS</a></div>
<div id=info-zone class="collapse">
- Rediger start brukes til å gjøre endringer i startlistene.<br>
- Legg til: Brukes for å legge til en løper i startlisten. Oppgi startnummer og posisjon i heatet.<br>
- Slett: Brukes for å slette en løper fra startlisten.<br>
- Flytt: Dette er Slett og legg til som en operasjon. Lavest tilgjengelige posisjon velges automatisk.<br>
- OBS: Det er ikke lov å ha flere løpere i samme posisjon. Derfor viktig å ta hensyn til pre-definert oppsett når du tildeler posisjon manuelt.<br>
</div>
<div id=spacer></div>
<! --- End Information --->
<table>
{% for race in next_races %}
<tr>
<td colspan=6>&nbsp;</td>
<td colspan=6 id="spacer"></td>
</tr>
<tr>
<td colspan=3><b>{{ race.raceclass }} {{ race.round }}{{ race.index }} {{ race.heat }}</b> - max antall: {{ race.max_no_of_contestants }}</td>
Expand Down
Loading

0 comments on commit 45ec570

Please sign in to comment.