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