comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:7ecd1a4ef557
1 <macro name="login_page" requires="servlet">
2 <n.set_var. name="error"><n.false/></n.set_var.>
3 <n.if.is_submitted_form>
4 <then>
5 <n.do_login>
6 <email><n.email_field.value/></email>
7 <password><n.password_field.value/></password>
8 <nextUrl><n.nextUrl_field.value/></nextUrl>
9 </n.do_login>
10 <n.set_var. name="error"><n.true/></n.set_var.>
11 </then>
12 </n.if.is_submitted_form>
13 <n.html>
14 <head>
15 <meta name="robots" content="noindex,nofollow"/>
16 <n.title.><t>Login</t></n.title.>
17 <n.email_field.focus/>
18 <script type="text/javascript">
19 var loginNextUrl = '<n.default. to="/"><n.nextUrl_field.value/></n.default.>';
20 </script>
21 </head>
22 <body>
23 <h1 class="weak-color"><t>Login</t></h1>
24
25 <n.login_message/>
26
27 <n.if.var name="error">
28 <then.format_error
29 message="[t]Incorrect Login![/t]"
30 prompt="[t]Please re-enter your email/password and click Login.[/t]"
31 />
32 </n.if.var>
33
34 <n.login_form/>
35 <n.register_now_section/>
36 </body>
37 </n.html>
38 </macro>
39
40 <macro name="login_message">
41 <div style="margin:.2em 0 1em">
42 <n.hide_null.message_field.value/>
43 </div>
44 </macro>
45
46 <macro name="login_form">
47 <n.put_in_head.>
48 <style type="text/css">
49 input[type=text],input[type=password] {
50 padding:.4em 0;
51 }
52 div.field-title {
53 margin:.1em .3em 0 1.5em;
54 white-space:nowrap;
55 text-align:right;
56 }
57 </style>
58 </n.put_in_head.>
59 <n.form. macro="login_page">
60 <n.message_field.hidden/>
61 <n.nextUrl_field.hidden/>
62 <table>
63 <tr>
64 <td>
65 <div class="second-font field-title">
66 <t>Email</t>
67 </div>
68 </td>
69 <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>
70 </tr>
71 <tr>
72 <td>
73 <div class="second-font field-title">
74 <t>Password</t>
75 </div>
76 </td>
77 <td><n.password_field.input type="password" size="20" /></td>
78 </tr>
79 <tr>
80 <td align="right" style="padding-right:.3em"><img src="/images/lock.png" width="30" height="46"/></td>
81 <td>
82 <input type="submit" value="[t]Login[/t]" />
83 <div style="padding-top:.2em"><a href="[n.forgot_password_path/]"><t>Forgot your password?</t></a></div>
84 </td>
85 </tr>
86 </table>
87 </n.form.>
88 </macro>
89
90 <macro name="register_now_section">
91 <div class="light-bg-color rounded" style="padding: .7em .5em;margin-top:1.4em">
92 <div class="second-font big-title"><t>Register</t></div>
93 <div style="margin-top:.5em">
94 <t>If you are still not a member, you can <n.register_link.><b>register now</b></n.register_link.>.</t>
95 </div>
96 </div>
97 </macro>
98
99 <macro name="email_field" dot_parameter="do">
100 <n.field. name="email"><n.do/></n.field.>
101 </macro>
102
103 <macro name="password_field" dot_parameter="do">
104 <n.field. name="password"><n.do/></n.field.>
105 </macro>
106
107 <macro name="nextUrl_field" dot_parameter="do">
108 <n.field. name="nextUrl"><n.do/></n.field.>
109 </macro>
110
111 <macro name="login_path" parameters="message,nextUrl">
112 <n.encode_url.remove_spaces.>
113 /template/NamlServlet.jtp?macro=login_page
114 <n.add_to_path name="message" value="[n.message/]" />
115 <n.add_to_path name="nextUrl" value="[n.nextUrl/]" />
116 </n.encode_url.remove_spaces.>
117 </macro>
118
119 <macro name="login" dot_parameter="message" requires="servlet">
120 <n.redirect_to.login_path message="[n.message/]" nextUrl="[n.current_path/]" />
121 </macro>
122
123 <macro name="login_link" dot_parameter="text">
124 <a id="login-link" href="[n.login_path/]"><n.text/></a>
125 </macro>