diff src/nabble/view/naml/login.naml @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/nabble/view/naml/login.naml	Thu Mar 21 19:15:52 2019 -0600
@@ -0,0 +1,125 @@
+<macro name="login_page" requires="servlet">
+	<n.set_var. name="error"><n.false/></n.set_var.>
+	<n.if.is_submitted_form>
+		<then>
+			<n.do_login>
+				<email><n.email_field.value/></email>
+				<password><n.password_field.value/></password>
+				<nextUrl><n.nextUrl_field.value/></nextUrl>
+			</n.do_login>
+			<n.set_var. name="error"><n.true/></n.set_var.>
+		</then>
+	</n.if.is_submitted_form>
+	<n.html>
+		<head>
+			<meta name="robots" content="noindex,nofollow"/>
+			<n.title.><t>Login</t></n.title.>
+			<n.email_field.focus/>
+			<script type="text/javascript">
+				var loginNextUrl = '<n.default. to="/"><n.nextUrl_field.value/></n.default.>';
+			</script>
+		</head>
+		<body>
+			<h1 class="weak-color"><t>Login</t></h1>
+
+			<n.login_message/>
+
+			<n.if.var name="error">
+				<then.format_error
+					message="[t]Incorrect Login![/t]"
+					prompt="[t]Please re-enter your email/password and click Login.[/t]"
+				/>
+			</n.if.var>
+
+			<n.login_form/>
+			<n.register_now_section/>
+		</body>
+	</n.html>
+</macro>
+
+<macro name="login_message">
+	<div style="margin:.2em 0 1em">
+		<n.hide_null.message_field.value/>
+	</div>
+</macro>
+
+<macro name="login_form">
+	<n.put_in_head.>
+		<style type="text/css">
+			input[type=text],input[type=password] {
+				padding:.4em 0;
+			}
+			div.field-title {
+				margin:.1em .3em 0 1.5em;
+				white-space:nowrap;
+				text-align:right;
+			}
+		</style>
+	</n.put_in_head.>
+	<n.form. macro="login_page">
+		<n.message_field.hidden/>
+		<n.nextUrl_field.hidden/>
+		<table>
+			<tr>
+				<td>
+					<div class="second-font field-title">
+						<t>Email</t>
+					</div>
+				</td>
+				<td><n.email_field.input type="text" size="40" /> <div class="weak-color" style="display:inline;font-size:80%"><t>Example: johnsmith@domain.com</t></div></td>
+			</tr>
+			<tr>
+				<td>
+					<div class="second-font field-title">
+						<t>Password</t>
+					</div>
+				</td>
+				<td><n.password_field.input type="password" size="20" /></td>
+			</tr>
+			<tr>
+				<td align="right" style="padding-right:.3em"><img src="/images/lock.png" width="30" height="46"/></td>
+				<td>
+					<input type="submit" value="[t]Login[/t]" />
+					<div style="padding-top:.2em"><a href="[n.forgot_password_path/]"><t>Forgot your password?</t></a></div>
+				</td>
+			</tr>
+		</table>
+	</n.form.>
+</macro>
+
+<macro name="register_now_section">
+	<div class="light-bg-color rounded" style="padding: .7em .5em;margin-top:1.4em">
+		<div class="second-font big-title"><t>Register</t></div>
+		<div style="margin-top:.5em">
+			<t>If you are still not a member, you can <n.register_link.><b>register now</b></n.register_link.>.</t>
+		</div>
+	</div>
+</macro>
+
+<macro name="email_field" dot_parameter="do">
+	<n.field. name="email"><n.do/></n.field.>
+</macro>
+
+<macro name="password_field" dot_parameter="do">
+	<n.field. name="password"><n.do/></n.field.>
+</macro>
+
+<macro name="nextUrl_field" dot_parameter="do">
+	<n.field. name="nextUrl"><n.do/></n.field.>
+</macro>
+
+<macro name="login_path" parameters="message,nextUrl">
+	<n.encode_url.remove_spaces.>
+		/template/NamlServlet.jtp?macro=login_page
+		<n.add_to_path name="message" value="[n.message/]" />
+		<n.add_to_path name="nextUrl" value="[n.nextUrl/]" />
+	</n.encode_url.remove_spaces.>
+</macro>
+
+<macro name="login" dot_parameter="message" requires="servlet">
+	<n.redirect_to.login_path message="[n.message/]" nextUrl="[n.current_path/]" />
+</macro>
+
+<macro name="login_link" dot_parameter="text">
+	<a id="login-link" href="[n.login_path/]"><n.text/></a>
+</macro>
\ No newline at end of file