]> ruin.nu Git - ndwebbie.git/blob - root/src/settings/index.tt2
2b5041918192a5c3accf003b2b347932a52b83bc
[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('changeEmail') %]" method="post"><fieldset> <legend>Email</legend>
13         <input type="text" name="email" value="[% email | html %]" class="email">
14         <br><input type="submit" value="Change">
15 </fieldset></form>
16 <form action="[% c.uri_for('changeBirthday') %]" method="post"><fieldset> <legend>Birthday</legend>
17         YYYY-MM-DD:
18         <input type="text" name="birthday" value="[% birthday %]" id="birthday">
19         <br><input type="submit" value="Change">
20 </fieldset></form>
21 <form action="[% c.uri_for('changePassword') %]" method="post"> <fieldset> <legend>Change password</legend>
22         <p>Old password: 
23         <input type="password" name="oldpass" value="">
24         New password: 
25         <input type="password" name="pass" value="">
26         <input type="submit" value="Submit">
27         </p>
28 </fieldset>
29 </form>
30 <fieldset> <legend>Timezone</legend>
31         <select name="category" id="tzcategory">
32 [% FOR cat IN tzcategories %]
33                 <option value="[% cat %]" [% IF cat == timezone.0 %]selected[% END %]>[% cat %]</option>
34 [% END %]
35         </select>
36         <select name="country" id="tzcountry">
37 [% FOR country IN tzcountries %]
38                 <option value="[% country %]" [% IF country == timezone.1 %]selected[% END %]>[% country %]</option>
39 [% END %]
40         </select>
41 <form action="[% c.uri_for('changeTimezone') %]" method="post">
42         <p><input type="text" name="timezone" value="[% timezone.join("/") %]" id="timezone">
43         <input type="submit" value="Change"></p>
44         <p>Remember that GMT stays the same all year, so if you're in the UK you should pick Europe/London.</p>
45 </form></fieldset>
46 [%- site.stylesheets = ['ui/ui.datepicker.css'] %]
47 <script type="text/javascript" src="/static/ui/ui.core.min.js"></script>
48 <script type="text/javascript" src="/static/ui/ui.datepicker.min.js"></script>
49
50 <script type="text/javascript">
51 $(document).ready(function(){
52         $("#birthday").datepicker({
53                 yearRange: "-80:+0",
54                 dateFormat: $.datepicker.ATOM,
55                 firstDay: 1,
56                 showOn: "both"
57         });
58         $("#tzcategory").change(function(){
59                 if ($(this).val() == 'GMT'){
60                         $("#timezone").val($(this).val());
61                         $("#tzcountry").empty();
62                 }else{
63                         $.get("/jsrpc/tzcountries/" + $(this).val(),function(xml){
64                                 $("#tzcountry").empty();
65                                 $("country",xml).each(function(i){
66                                         var opt = $('<option>');
67                                         $("#tzcountry").append(opt);
68                                         opt.attr('value',$(this).text()).text($(this).text());
69                                 });
70                                 $("#tzcountry").change();
71                         });
72                 }
73         });
74         $("#tzcountry").change(function(){
75                 $("#timezone").val($("#tzcategory").val() + '/' + $(this).val());
76         });
77 });
78 </script>