Mercurial Hosting > nabble
comparison src/nabble/view/web/user/ChangeAvatar.jtp @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | 18cf4872fd7f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <% | |
2 package nabble.view.web.user; | |
3 | |
4 import nabble.model.User; | |
5 import nabble.view.lib.Jtp; | |
6 import nabble.view.lib.Shared; | |
7 | |
8 import javax.servlet.ServletException; | |
9 import javax.servlet.http.HttpServlet; | |
10 import javax.servlet.http.HttpServletRequest; | |
11 import javax.servlet.http.HttpServletResponse; | |
12 import java.io.IOException; | |
13 import java.io.PrintWriter; | |
14 | |
15 | |
16 public final class ChangeAvatar extends HttpServlet { | |
17 | |
18 protected void service(HttpServletRequest request,HttpServletResponse response) | |
19 throws ServletException, IOException | |
20 { | |
21 PrintWriter out = response.getWriter(); | |
22 User user = Jtp.getUser(request,response); | |
23 if (user==null) { | |
24 Jtp.login("You must login to change your email.",request,response); | |
25 return; | |
26 } | |
27 | |
28 %> | |
29 <html> | |
30 <head> | |
31 <% Shared.title(request,response,"Change Avatar"); %> | |
32 <script type="text/javascript"> | |
33 function deleteAvatar() { | |
34 if (!confirm('Do you really want to reset your avatar?')) | |
35 return; | |
36 var newLocation = "/user/ChangeAvatar2.jtp?action=delete"; | |
37 Nabble.setTop(newLocation); | |
38 }; | |
39 </script> | |
40 </head> | |
41 <body> | |
42 <% | |
43 Shared.minHeaderGlobal(request,response); | |
44 Shared.profileHeading(request,out,user,"Change Your Picture"); | |
45 %> | |
46 <br/> | |
47 <form action="/user/ChangeAvatar2.jtp" method="POST" enctype="multipart/form-data"> | |
48 <table cellspacing="3"> | |
49 <tr valign="top"> | |
50 <td> | |
51 <img class="avatar light-border-color" src="<%=Shared.getAvatarImageURL(user, false)%>"/><br/> | |
52 <div style="text-align:center"><a href="javascript: deleteAvatar();">Reset Picture</a></div> | |
53 </td> | |
54 <td> | |
55 <span class="form-label">Choose a file to upload:</span><br/> | |
56 <input name="image" id="image" type="file" size="35" /><br/> | |
57 <span style="font-size:80%"><strong>Important:</strong> The file size cannot exceed 4 Mb and the image must be at least 100 x 100 px.</span><br/><br/> | |
58 <input type="submit" value="Upload Image"> | |
59 or <a href="/template/NamlServlet.jtp?macro=user_profile">Cancel</a> | |
60 </td> | |
61 </tr> | |
62 </table> | |
63 </form> | |
64 | |
65 <% Shared.footer(request,response); %> | |
66 <% Shared.analytics(request,response); %> | |
67 </body> | |
68 </html> | |
69 <% | |
70 } | |
71 } | |
72 %> |