MentaTutorials

Rev

Rev 53 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16 soliveira 1
<%@ page contentType="text/html; charset=UTF-8" %>
53 robertwgil 2
<%@taglib prefix="mtw" uri="http://www.mentaframework.org/tags-mtw/"%>
16 soliveira 3
 
4
<mtw:useI18N prefix="user.edit" />
5
 
6
<mtw:requiresAuthentication />
7
 
8
<html>
9
	<head>
10
 
11
		<title><mtw:i18n key="title" noPrefix="true" /></title>
12
 
13
		<script type="text/javascript" src="<mtw:contextPath />/jquery/jquery-1.4.4.min.js"></script>
14
 
15
		<script type="text/javascript">
16
 
17
		$(document).ready(function() {
18
 
19
			$('#usernameLoading').hide();
20
 
21
			$('#username').blur(function() {
22
 
23
				  $('#usernameMessage').hide();
24
 
25
				  if ($('#username').val().trim() != '') {
26
 
27
					  $('#usernameLoading').show();
28
 
29
					  if ($('#username').val() == '<mtw:out value="user.username" />') {
30
						    $('#usernameMessage').fadeOut();
31
				       	    setTimeout("usernameResult('same')", 400);
32
				       	    return false;
33
					  }
34
 
35
				      $.post("<mtw:contextPath />/User.check.mtw", { username: $('#username').val() }, function(response) {
36
				        	$('#usernameMessage').fadeOut();
37
				        	setTimeout("usernameResult('" + escape(response) + "')", 400);
38
				      });
39
 
40
				  }
41
 
42
				  return false;
43
			});
44
		});
45
 
46
		function usernameResult(response) {
47
 
48
			$('#usernameLoading').hide();
49
 
50
			var res = unescape(response);
51
 
52
			if (res == "error") {
53
 
54
				$('#usernameMessage').html('<font color="red"><b><mtw:i18n key="username_error" /></b></font>');
55
				$('#usernameMessage').fadeIn();
56
 
57
			} else if (res == "same") {
58
 
59
				$('#usernameMessage').html('');
60
				$('#usernameMessage').fadeIn();
61
 
62
 
63
			} else if (res == "success") {
64
 
65
				$('#usernameMessage').html('<img src="<mtw:contextPath />/images/chk.gif" />');
66
				$('#usernameMessage').fadeIn();
67
 
68
			} else if (res == "already") {
69
 
70
				$('#usernameMessage').html('<font color="red"><b><mtw:i18n key="username_already" /></b></font>');
71
				$('#usernameMessage').fadeIn();
72
			}
73
		}
74
 
75
		</script>
76
 
77
	</head>
78
 
79
	<body>
80
 
81
		<h3><mtw:i18n key="account" /></h3>
82
 
83
		<form action="<mtw:contextPath />/User.edit.mtw" method="post">
54 robertwgil 84
 
16 soliveira 85
			<mtw:bean value="user">
54 robertwgil 86
 
87
				<label>
88
					Open ID
89
					<mtw:input name="id" />
90
				</label>
91
				<label>
92
					Cripted ID
93
					<mtw:input name="id" cript="true" />
94
					<span id="usernameMessage">
95
						<mtw:outError field="id">
96
							<font color="red"><b><mtw:out /></b></font>
97
						</mtw:outError>
98
					</span>
99
				</label>
100
 
16 soliveira 101
				<table>
102
					<tr>
103
						<td><mtw:i18n key="username" /></td>
104
						<td>
105
							<mtw:input name="username" size="30" maxlength="30" id="username" />
106
							<span id="usernameLoading">
107
								<img src="<mtw:contextPath />/images/loading.gif" />
108
							</span>
109
							<span id="usernameMessage">
110
								<mtw:outError field="username">
111
									<font color="red"><b><mtw:out /></b></font>
112
								</mtw:outError>
113
							</span>
114
						</td>
115
					</tr>
116
					<tr>
117
						<td><mtw:i18n key="email" /></td>
118
						<td><mtw:input name="email" size="30" maxlength="100" />
119
							<mtw:outError field="email">
120
								<font color="red"> <b><mtw:out /></b> </font>
121
							</mtw:outError>
122
						</td>
123
					</tr>
124
					<tr>
53 robertwgil 125
						<td><mtw:i18n key="sexo" /></td>
126
						<td>
127
							<mtw:input type="radio" name="sexo" value="MASCULINO" cript="true" /> Masculino
128
							&nbsp;
129
							<mtw:input type="radio" name="sexo" value="FEMININO" cript="true" /> Feminino
130
 
131
							<mtw:outError field="sexo">
132
								<font color="red"> <b><mtw:out /></b> </font>
133
							</mtw:outError>
134
						</td>
135
					</tr>
136
					<tr>
16 soliveira 137
						<td><mtw:i18n key="group" /></td>
138
						<td>
53 robertwgil 139
							<mtw:select name="groupId" list="groups" cript="true" />
16 soliveira 140
							<mtw:outError field="groupId">
141
								<font color="red"> <b><mtw:out /></b> </font>
142
							</mtw:outError></td>
143
					</tr>
144
					<tr>
145
						<td><mtw:i18n key="language" /></td>
53 robertwgil 146
						<td><mtw:radiobuttons name="languageId" list="languages" cript="true" />
16 soliveira 147
							<mtw:outError field="languageId">
148
								<font color="red"> <b><mtw:out /></b> </font>
149
							</mtw:outError>
150
						</td>
151
					</tr>
152
 
153
					<tr>
154
						<td colspan="2">
155
							<input type="submit" value="<mtw:i18n key="save" />" />
156
						</td>
157
					</tr>
158
				</table>
159
			</mtw:bean>
160
		</form>
161
 
162
		<p>
163
			<a href="<mtw:contextPath />/jsp/index.jsp"><mtw:i18n key="back" /></a>
164
		</p>
165
 
166
	</body>
167
</html>
168