]> ruin.nu Git - ndwebbie.git/blob - root/src/settings/index.tt2
Allow users to store their time zone
[ndwebbie.git] / root / src / settings / index.tt2
1 [% META title = 'Site preferences' %]
2
3 <form action="[% c.uri_for('changeStylesheet') %]" method="post"><fieldset> <legend>Style</legend>
4         Stylesheet: <select name="stylesheet">
5 [% FOR style IN stylesheets %]
6                 <option value="[% style %]" [% IF style == user.css %]selected[% END %]>[% style %]</option>
7 [% END %]
8         </select>
9         <br>
10         <input type="submit" value="Change">
11 </fieldset></form>
12 <form action="[% c.uri_for('changeBirthday') %]" method="post"><fieldset> <legend>Birthday</legend>
13         YYYY-MM-DD:
14         <input type="text" name="birthday" value="[% birthday %]" id="birthday">
15         <br><input type="submit" value="Change">
16 </fieldset></form>
17 <form action="[% c.uri_for('changePassword') %]" method="post"> <fieldset> <legend>Change password</legend>
18         <p>Old password: 
19         <input type="password" name="oldpass" value="">
20         New password: 
21         <input type="password" name="pass" value="">
22         <input type="submit" value="Submit">
23         </p>
24 </fieldset>
25 </form>
26 <form action="[% c.uri_for('changeTimezone') %]" method="post"><fieldset> <legend>Timezone</legend>
27         <select name="category" id="tzcategory">
28 [% FOR cat IN tzcategories %]
29                 <option value="[% cat %]" [% IF cat == timezone.0 %]selected[% END %]>[% cat %]</option>
30 [% END %]
31         </select>
32         <select name="country" id="tzcountry">
33 [% FOR country IN tzcountries %]
34                 <option value="[% country %]" [% IF country == timezone.1 %]selected[% END %]>[% country %]</option>
35 [% END %]
36         </select>
37         <br><input type="submit" value="Change">
38         <p>Remember that GMT stays the same all year, so if you're in the UK you should pick Europe/London.</p>
39 </fieldset></form>
40 [%- site.stylesheets = ['ui/ui.datepicker.css'] %]
41 <script type="text/javascript" src="/static/ui/ui.core.min.js"></script>
42 <script type="text/javascript" src="/static/ui/ui.datepicker.min.js"></script>
43
44 <script type="text/javascript">
45 $(document).ready(function(){
46         $("#birthday").datepicker({
47                 yearRange: "-80:+0",
48                 dateFormat: $.datepicker.ATOM,
49                 firstDay: 1,
50                 showOn: "both"
51         });
52         $("#tzcategory").change(function(){
53                 $.get("/jsrpc/tzcountries/" + $(this).val(),function(xml){
54                         $("#tzcountry").empty();
55                         $("country",xml).each(function(i){
56                                 $("#tzcountry").append('<option value="'+$(this).text()+'">'+$(this).text()+'</option>');
57                         });
58                 });
59         });
60 });
61 </script>