Tidy up login reporting.
[disorder] / templates / login.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <!--
3 This file is part of DisOrder.
4 Copyright (C) 2007 Richard Kettlewell
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA
20 -->
21 <html>
22 <head>
23 @include:stdhead@
24 <title>@label:login.title@</title>
25 </head>
26 <body>
27 @include{topbar}@
28 <h1 class=title>@label:login.title@</h1>
29
30 @if{@ne{@label:error@}{error}@}{
31 @#{error reporting from some earlier operation}@
32 <!-- TODO make error string visually intrusive, also error.html -->
33 <p>@label{error.@label:error@}@</p>
34 }@
35
36 @if{@ne{@label:status@}{status}@}{
37 @#{some action succeeded}@
38 <p class=loginstatus>@label{login.@label:status@}@</p>
39 }@
40
41 <p>User: @user@</p>
42
43 @if{@eq{@user@}{guest}@}{
44 @#{guest user, allow login and registration}@
45 <h2>Existing users</h2>
46
47 <p>If you have a username, use this form to log in.</p>
48
49 <form class=login action="@url@" method=POST
50 enctype="multipart/form-data" accept-charset=utf-8>
51 <table class=login>
52 <tr>
53 <td>@label:login.username@</td>
54 <td>
55 <input class=username name=username type=text value="@arg:username@" size=32>
56 </td>
57 </tr>
58 <tr>
59 <td>@label:login.password@</td>
60 <td><input class=password name=password type=password value=""
61 size=32></td>
62 <td>
63 <button class=login name=action type=submit value=login>
64 @label:login.login@
65 </button>
66 </td>
67 </tr>
68 </table>
69 <input name=nonce type=hidden value="@nonce@">
70 <input name=back type=hidden value="@arg:back@">
71 </form>
72
73 <!-- TODO disable registration button if guest doesn't have
74 register right -->
75
76 <h2>New Users</h2>
77
78 <p>If you do not have a login enter a username, a password and your
79 email address here. You will be sent an email containing a URL,
80 which you must visit to activate your login before you can use
81 it.<p>
82
83 <form class=register action="@url@" method=POST
84 enctype="multipart/form-data" accept-charset=utf-8>
85 <table class=register>
86 <tr>
87 <td>@label:login.username@</td>
88 <td>
89 <input class=username name=username type=text value="" size=32>
90 </td>
91 </tr>
92 <tr>
93 <td>@label:login.email@</td>
94 <td>
95 <input class=email name=email type=text value="" size=32>
96 </td>
97 </tr>
98 <tr>
99 <td>@label:login.password@</td>
100 <td><input class=password name=password type=password value=""
101 size=32></td>
102 <td>
103 <button class=register name=action type=submit value=register>
104 @label:login.register@
105 </button>
106 </td>
107 </tr>
108 </table>
109 <input name=nonce type=hidden value="@nonce@">
110 </form>
111 }{
112 @#{not the guest user, allow change of details and logout}@
113
114 <h2>Logged in as @user@</h2>
115
116 <p>TODO none of this stuff works yet</p>
117
118 <p>Use this form to change your email address and/or password.</p>
119
120 <form class=register action="@url@" method=POST
121 enctype="multipart/form-data" accept-charset=utf-8>
122 <table class=edituser>
123 <tr>
124 <td>@label:login.email@</td>
125 <td>
126 <input class=email name=email type=text value="TODO" size=32>
127 </td>
128 </tr>
129 <tr>
130 <td>@label:login.password@</td>
131 <td><input class=password name=password type=password value=""
132 size=32></td>
133 <td>
134 <button class=edituser name=action type=submit value=edituser>
135 @label:login.edituser@
136 </button>
137 </td>
138 </tr>
139 </table>
140 <input name=nonce type=hidden value="@nonce@">
141 </form>
142
143 <p>Use this button to log out @user@.</p>
144
145 <form class=register action="@url@" method=POST
146 enctype="multipart/form-data" accept-charset=utf-8>
147 <div class=logout>
148 <button class=logout name=action type=submit value=logout>
149 @label:login.logout@
150 </button>
151 </div>
152 <input name=nonce type=hidden value="@nonce@">
153 </form>
154
155 }@
156
157 @include{topbarend}@
158 </body>
159 </html>
160 @@
161 <!--
162 Local variables:
163 mode:sgml
164 sgml-always-quote-attributes:nil
165 sgml-indent-step:1
166 sgml-indent-data:t
167 End:
168 -->