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