11{% extends "utils/layout.html" %}
2+
3+ {% block scripts %}
4+ < script >
5+ function updateImagePreview ( input ) {
6+ file = input . files [ 0 ] ;
7+ console . log ( file ) ;
8+ if ( file . type == "image/png" ) {
9+ document . getElementById ( "filename" ) . innerText = file . name ;
10+ document . getElementById ( "imagepreview" ) . src = URL . createObjectURL ( file ) ;
11+ }
12+ }
13+ </ script >
14+ {% endblock %}
15+
216{% block body %}
317< div class ="contentw admindiv ">
418 < h1 > Edit UI Settings</ h1 >
@@ -8,16 +22,20 @@ <h1>Edit UI Settings</h1>
822 < form method ="post " enctype ="multipart/form-data ">
923 < label for ="colour "> Colour:</ label >
1024 < input id ="colour " name ="colour " type ="color " value ="{{colourString}} "> < br />
11- < label for ="bigimage "> Big image:</ label >
12- < input id ="bigimage " name ="bigimage " type ="file " accept =".png "> < br />
1325 < label for ="appname "> App name:</ label >
1426 < input id ="appname " name ="appName " type ="text " value ="{{app_name()}} "> < br />
1527 < input id ="hidedayleaderboard " name ="hideDayLeaderboard " type ="checkbox " {% if ui_settings[ "hideDayLeaderboard"] %}checked{% endif %}>
16- < label for ="hidedayleaderboard "> Hide day leaderboard</ label > < br />
28+ < label for ="hidedayleaderboard "> Hide daily leaderboard</ label > < br />
1729 < input id ="enablestrava " name ="enableStrava " type ="checkbox " {% if ui_settings[ "enableStrava"] %}checked{% endif %}>
1830 < label for ="enablestrava "> Enable Strava</ label > < br />
1931 < input id ="showwalksbyhour " name ="showWalksByHour " type ="checkbox " {% if ui_settings[ "showWalksByHour"] %}checked{% endif %}>
2032 < label for ="showwalksbyhour "> Show walks by hour</ label > < br />
33+ < hr >
34+ < label for ="bigimage "> Select Main Image< br >
35+ < div class ="filepreview ">
36+ < img id ="imagepreview " src ="/bigimage.png "> < p id ="filename "> Current Logo</ p >
37+ </ div > </ label >
38+ < input id ="bigimage " name ="bigimage " type ="file " accept =".png " style ="display:none; " onchange ="updateImagePreview(this) "> < br />
2139 < input type ="submit " value ="Apply ">
2240 </ form >
2341</ div >
0 commit comments