@@ -4,12 +4,16 @@ Base template, with site layout and style.
4
4
Template arguments:
5
5
title page title, if any
6
6
base main content
7
+ days list of available days
8
+ input "mouse"|"keyboard"
9
+ table events table shown, moves|clicks|scrolls|keys|combos
7
10
8
11
@author Erki Suurjaak
9
12
@created 07.04.2015
10
13
@modified 23.04.2015
11
14
%"""
12
15
%WEBROOT = get_url("/")
16
+ %days = get("days", [])
13
17
<!DOCTYPE html>
14
18
<html >
15
19
<head >
@@ -21,11 +25,39 @@ Template arguments:
21
25
<script src =" { { WEBROOT} } static/heatmap.min.js" ></script >
22
26
</head >
23
27
<body >
24
- <div id =" header" >
25
- <a href =" { { WEBROOT} } " id =" indexlink" >{ {conf.Title} }</a >
28
+ <div id =" header" style =" position : relative ;" >
29
+
30
+ <span id =" headerlinks" >
31
+ <a href =" { { WEBROOT} } " id =" indexlink" >{ {conf.Title} }</a >
32
+ <span id =" inputlinks" >
33
+ %for x in ["mouse", "keyboard"]:
34
+ <a href =" { { get_url(" /<input>" , input= x)} } " >{ {x} }</a >
35
+ %end # for x
36
+ </span >
37
+ </span >
38
+
39
+ %if days:
40
+ <span id =" daysection" >
41
+ %dayidx = next((i for i, x in enumerate(days) if x["day"] == day), None)
42
+ %prevday, nextday = (days[x]["day"] if 0 <= x < len(days) else None for x in [dayidx-1, dayidx+1]) if dayidx is not None else [None]*2
43
+ <a href =" { { get_url(" /%s/<table>/<day>" % input, table= table, day= prevday)} } " >{ {" < %s" % prevday if prevday else " " } }</a >
44
+
45
+ <select id =" dayselector" >
46
+ %if not day:
47
+ <option >- day -</option >
48
+ %end # if not day
49
+ %for d in days:
50
+ <option { { ' selected="selected"' if day == d[" day" ] else " " } } >{ {d[" day" ]} }</option >
51
+ %end # for d
52
+ </select >
53
+
54
+ <a href =" { { get_url(" /%s/<table>/<day>" % input, table= table, day= nextday)} } " >{ {" %s >" % nextday if nextday else " " } }</a >
55
+ </span >
56
+ %end # if days
57
+
26
58
</div >
27
59
28
- <div id =" content" >
60
+ <div id =" content" style = " position : relative ; " >
29
61
{ {! base} }
30
62
</div >
31
63
@@ -35,5 +67,15 @@ Template arguments:
35
67
</div >
36
68
</div >
37
69
70
+
71
+ %if days:
72
+ <script type =" text/javascript" >
73
+ window .addEventListener (" load" , function () {
74
+ document.getElementById(" dayselector" ).addEventListener(" change" , function() {
75
+ window.location.href = " { { get_url(" /%s/<table>" % input, table= table)} } /" + this.value;
76
+ } );
77
+ } );
78
+ </script >
79
+ %end # if days
38
80
</body >
39
81
</html >
0 commit comments