]> ruin.nu Git - ndwebbie.git/blob - root/src/settings/index.tt2
4e1c96f833135b08ff7f97a8236f46c53c7452d4
[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 <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 <form action="[% c.uri_for('changeTimezone') %]" method="post">
38         <p><input type="text" name="timezone" value="[% timezone.join("/") %]" id="timezone">
39         <input type="submit" value="Change"></p>
40         <p>Remember that GMT stays the same all year, so if you're in the UK you should pick Europe/London.</p>
41 </form></fieldset>
42 [%- site.stylesheets = ['ui/ui.datepicker.css'] %]
43 <script type="text/javascript" src="/static/ui/ui.core.min.js"></script>
44 <script type="text/javascript" src="/static/ui/ui.datepicker.min.js"></script>
45
46 <script type="text/javascript">
47 $(document).ready(function(){
48         $("#birthday").datepicker({
49                 yearRange: "-80:+0",
50                 dateFormat: $.datepicker.ATOM,
51                 firstDay: 1,
52                 showOn: "both"
53         });
54         $("#tzcategory").change(function(){
55                 if ($(this).val() == 'GMT'){
56                         $("#timezone").val($(this).val());
57                         $("#tzcountry").empty();
58                 }else{
59                         $.get("/jsrpc/tzcountries/" + $(this).val(),function(xml){
60                                 $("#tzcountry").empty();
61                                 $("country",xml).each(function(i){
62                                         var opt = $('<option>');
63                                         $("#tzcountry").append(opt);
64                                         opt.attr('value',$(this).text()).text($(this).text());
65                                 });
66                                 $("#tzcountry").change();
67                         });
68                 }
69         });
70         $("#tzcountry").change(function(){
71                 $("#timezone").val($("#tzcategory").val() + '/' + $(this).val());
72         });
73 });
74 </script>