1+ <!-- Adapted from the "flaskr" tutorial at http://flask.pocoo.org/ -->
2+
3+ <!doctype html>
4+ < title > JFP Server</ title >
5+ < link rel ="stylesheet " type ="text/css " href ="{{ url_for('static', filename='style.css') }} ">
6+ < div class ="page ">
7+ < h1 > JFP Data</ h1 >
8+ {% if not session.logged_in %}
9+ < h2 > Login</ h2 >
10+ < form action ="{{ url_for('login') }} " method =post >
11+ < dl >
12+ < dt > Username:
13+ < dd > < input type =text name =username >
14+ < dt > Password:
15+ < dd > < input type =password name =password >
16+ < dd > < input type =submit value =Login >
17+ </ dl >
18+ </ form >
19+ {% else %}
20+ < div class ="metanav ">
21+ < a href ="{{ url_for('logout') }} "> log out</ a >
22+ </ div >
23+ < div class ="console ">
24+ < form action ="{{ url_for('add_entry') }} " method ="post " class ="add-entry ">
25+ < ul style ="list-style: none ">
26+ < li > Printer: < textarea name ="printer " rows ="1 " cols ="10 "> </ textarea >
27+ < li > Copies: < textarea name ="copies " rows ="1 " cols ="1 "> </ textarea >
28+ < li > Success: < textarea name ="success " rows ="1 " cols ="1 "> </ textarea >
29+ < li > < input type ="submit " value ="Add ">
30+ </ ul >
31+ </ form >
32+ {% if request.path == "/" %}
33+ < form action ="{{ url_for('hide_successful') }} " method ="post ">
34+ < input type ="submit " value ="Hide Successful Requests ">
35+ </ form >
36+ {% else %}
37+ < form action ="{{ url_for('show_successful') }} " method ="post ">
38+ < input type ="submit " value ="Show Successful Requests ">
39+ </ form >
40+ {% endif %}
41+ </ div >
42+ < script type ="text/javascript ">
43+ document . getElementById ( 'date' ) . value = Date ( ) ;
44+ </ script >
45+ < h4 > Total requests: {{ numrequests }}</ h4 >
46+ < h4 > Requests in the last 24 hours: {{ dayrequests }}</ h4 >
47+ < ul class ="entries ">
48+ {% for entry in entries %}
49+ < li {% if entry.success == 0 %} class ="error " {% endif %} > < h4 > {{ entry.time }}</ h4 > {{ entry.printer }}, copies: {{ entry.copies }}, success: {{ entry.success }}
50+ {% else %}
51+ < li > < em > Database is empty.</ em >
52+ {% endfor %}
53+ </ ul >
54+ < form action ="{{ url_for('clear_database') }} " method ="post ">
55+ < input type ="submit " value ="Clear Database ">
56+ </ form >
57+ {% endif %}
58+ </ div >
0 commit comments