author | Tero Marttila <terom@fixme.fi> |
Mon, 16 Feb 2009 01:03:23 +0200 | |
changeset 133 | 088aa2da1340 |
parent 131 | 67f5d2fdca1d |
permissions | -rw-r--r-- |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
2 |
|
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
3 |
<%def name="menu()"> |
59
8ec729c5d998
ugly, but working, preferences editor
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
4 |
<ul> |
8ec729c5d998
ugly, but working, preferences editor
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
5 |
<li><a href="${urls.index.build(req)}">Home</a></li> |
8ec729c5d998
ugly, but working, preferences editor
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
6 |
<li><a href="${urls.preferences.build(req)}">Preferences</a></li> |
83
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
7 |
|
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
8 |
<li> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
9 |
<span>Channel:</span> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
10 |
</li><li class="join-left"> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
11 |
<form action="${urls.channel_select.build(req)}" method="GET"> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
12 |
<select name="channel"> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
13 |
${h.select_options(((ch.id, ch.title) for ch in channel_list), channel.id if channel else None)} |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
14 |
</select><input type="submit" value="Go »" /> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
15 |
</form> |
a34e9f56ddda
improve parser resilience, improve get_month_days, add 'Channel' item to general menu
Tero Marttila <terom@fixme.fi>
parents:
59
diff
changeset
|
16 |
</li> |
59
8ec729c5d998
ugly, but working, preferences editor
Tero Marttila <terom@fixme.fi>
parents:
50
diff
changeset
|
17 |
</ul> |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
18 |
</%def> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
19 |
|
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
20 |
<%def name="footer_right()"> |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
21 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
22 |
</%def> |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
23 |
|
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
24 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
25 |
<head> |
48 | 26 |
<title>irclogs.qmsk.net${(' :: ' + channel.title) if channel else ''}</title> |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
27 |
<link rel="Stylesheet" type="text/css" href="${req.site_root}/static/irclogs.css" /> |
129
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
28 |
## timezone-autodetect |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
29 |
% if prefs and prefs.is_default('timezone') : |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
30 |
<script language="Javascript" type="text/javascript"> |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
31 |
/* |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
32 |
* Set a preference cookie |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
33 |
*/ |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
34 |
function set_pref (name, value) { |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
35 |
// XXX: expire? |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
36 |
document.cookie = (name + "=" + value + "; path=/"); |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
37 |
} |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
38 |
|
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
39 |
/* |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
40 |
* Set the timezone_offset cookie to the current Date's timezone offset |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
41 |
*/ |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
42 |
function autodetect_tz_offset () { |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
43 |
// current datetime |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
44 |
var now = new Date(); |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
45 |
|
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
46 |
// timezone offset from UTC in minutes |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
47 |
var timezone_offset = -now.getTimezoneOffset() |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
48 |
|
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
49 |
// store cookie with offset in minutes |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
50 |
set_pref('timezone_offset', timezone_offset); |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
51 |
} |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
52 |
|
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
53 |
/* |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
54 |
* Autodetect at load |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
55 |
*/ |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
56 |
window.onload = autodetect_tz_offset; |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
57 |
</script> |
67a30d680f60
Autodetect user timezone using Javascript, this makes the Preferences code a bit more complicated in terms of interaction between default/parse/is_default/build/process/etc, but it should work as intended now
Tero Marttila <terom@fixme.fi>
parents:
119
diff
changeset
|
58 |
% endif |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
59 |
</head> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
60 |
<body> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
61 |
<div id="menu"> |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
62 |
${next.menu()} |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
63 |
</div> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
64 |
|
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
65 |
<div id="content"> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
66 |
${next.body()} |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
67 |
</div> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
68 |
|
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
69 |
<div id="footer"> |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
70 |
<div id="footer-right"> |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
71 |
${next.footer_right()} |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
72 |
</div> |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
73 |
|
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
74 |
<div id="footer-left"> |
131
67f5d2fdca1d
rename config.PREF_TIMEZONE_FALLBACK, add Cookie expire/path info, and move the hg version stuff into the template/helpers
Tero Marttila <terom@fixme.fi>
parents:
129
diff
changeset
|
75 |
<a href="http://projects.qmsk.net/irclogs2">irclogs2</a> version ${h.version_link()} |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
76 |
</div> |
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
77 |
|
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
78 |
<div id="footer-center"> |
50
f13cf27a360b
implement more LogSource features (logs for date, cleanup last_logs), implement irssi parser, formatter, other misc. stuff
Tero Marttila <terom@fixme.fi>
parents:
48
diff
changeset
|
79 |
${h.validation_notice(req.site_host)} |
42
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
80 |
</div> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
81 |
</div> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
82 |
</body> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
83 |
</html> |
5a72c00c4ae4
more fiddling around with the irclogs layout/css, add query args to URL
Tero Marttila <terom@fixme.fi>
parents:
diff
changeset
|
84 |