Mercurial Hosting > nabble
comparison src/nabble/view/naml/edit_signature.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="edit_signature" requires="servlet"> | |
2 <n.visitor.as_user_page.> | |
3 <n.if.not.page_user.is_registered> | |
4 <then> | |
5 <n.login.><t>You must login to view this page.</t></n.login.> | |
6 </then> | |
7 </n.if.not.page_user.is_registered> | |
8 <n.if.is_submitted_form> | |
9 <then> | |
10 <n.catch_exception. id="save-signature"> | |
11 <n.edit_page_user.> | |
12 <n.set_signature signature="[n.signature_field.value/]" is_html="[n.html_format_field.value/]"/> | |
13 <n.save_user/> | |
14 </n.edit_page_user.> | |
15 <n.redirect_to.page_user.user_profile_path/> | |
16 </n.catch_exception.> | |
17 </then> | |
18 <else.if.page_user.has_signature> | |
19 <then> | |
20 <n.html_format_field.set_value value="[n.page_user.signature.is_html_format/]" /> | |
21 <n.signature_field.set_value value="[n.page_user.signature.as_editable/]" /> | |
22 </then> | |
23 </else.if.page_user.has_signature> | |
24 </n.if.is_submitted_form> | |
25 <n.html> | |
26 <head> | |
27 <META NAME="robots" CONTENT="noindex,nofollow"/> | |
28 <n.title.><t>Edit Signature</t></n.title.> | |
29 </head> | |
30 <body> | |
31 <h1><t>Edit Signature</t></h1> | |
32 | |
33 <n.show_edit_signature_error/> | |
34 | |
35 <n.if.page_user.has_signature> | |
36 <then.show_current_signature/> | |
37 </n.if.page_user.has_signature> | |
38 | |
39 <n.form.> | |
40 <n.html_format_field.checkbox /> | |
41 <label for="[n.html_format_field.name/]"><t>Signature is in HTML format</t></label><br/> | |
42 <n.signature_field.textarea wrap="SOFT" tabindex="2" style="width:35em;height:7em;" /> | |
43 | |
44 <div style="margin-top:1.4em"> | |
45 <input type="submit" value="[t]Save Signature[/t]" /> | |
46 <t>or</t> <a href="[n.page_user.user_profile_path/]"><t>Cancel</t></a> | |
47 </div> | |
48 </n.form.> | |
49 </body> | |
50 </n.html> | |
51 </n.visitor.as_user_page.> | |
52 </macro> | |
53 | |
54 <macro name="show_current_signature"> | |
55 <div class="medium-border-color border1 rounded" style="width:34em;padding:.5em;margin:2em 0"> | |
56 <div class="second-font field-title" style="margin-top:0"> | |
57 <t>Current Signature</t> | |
58 </div> | |
59 <div class="weak-color" style="margin-left:1em"> | |
60 <n.page_user.signature_as_html/> | |
61 </div> | |
62 </div> | |
63 </macro> | |
64 | |
65 <macro name="signature_field" dot_parameter="do"> | |
66 <n.field. name="signature"><n.do/></n.field.> | |
67 </macro> | |
68 | |
69 <macro name="edit_signature_path"> | |
70 <n.encode_url.> | |
71 /template/NamlServlet.jtp?macro=edit_signature | |
72 </n.encode_url.> | |
73 </macro> | |
74 | |
75 | |
76 <macro name="signature_as_html" requires="user"> | |
77 <n.signature.message_as_html /> | |
78 </macro> | |
79 | |
80 <macro name="show_edit_signature_error"> | |
81 <n.if.is_submitted_form> | |
82 <then.if.has_exception for="save-signature"> | |
83 <then.format_error.handle_exception. for="save-signature"> | |
84 <n.spam_errors/> | |
85 </then.format_error.handle_exception.> | |
86 </then.if.has_exception> | |
87 </n.if.is_submitted_form> | |
88 </macro> |