post_by_email_page

NAML documentation   Watch a video
   Usages of this macro
... in post_by_email_page.naml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<macro name="post_by_email_page" requires="servlet">
    <n.node_page
Macro
Requires: servlet
Parameters: do
.>
        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_submitted_form
Macro
Requires: servlet
>
            <then>
                <n.catch_exception
Binary
Namespace: BasicNamespace
Parameters: id, do
. id="send-email-block">
                    <n.send_email_address
Macro
Requires: node_page, servlet
/>
                </n.catch_exception.>
            </then>
        </n.if.is_submitted_form>
        <n.html
Macro
Parameters: head, body
>
            <head>
                <n.title
Macro
Parameters: text
.><t>Post by Email</t></n.title.>
            </head>
            <body>
                <n.edit_header
Macro
Parameters: first_text, second_text
 first_text="[t]Post by Email[/t]" second_text="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.subject
Macro
Requires: node
/]" />
    
                <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_submitted_form
Macro
Requires: servlet
>
                    <then>
                        <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_exception
Binary
Namespace: BasicNamespace
Parameters: for
 for="send-email-block">
                            <then>
                                <n.show_email_error
Macro
/>
                            </then>
                            <else>
                                <table class="info-message" style="width:100%;padding:.5em">
                                    <tr>
                                        <td><img src="/images/success.png"/></td>
                                        <td style="width:100%;font-weight:bold"><t>An email has been sent to you.</t></td>
                                    </tr>
                                </table>
                            </else>
                        </n.if.has_exception>
                    </then>
                </n.if.is_submitted_form>
    
                <div style="margin:1em 0 2em">
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.is_anonymous
Binary
Namespace: UserNamespace
>
                        <then>
                            <t>To prevent spam, the email address to use when posting by email is <b>unique</b> for each user.</t>
                            <t>To see which email address you should use to post, please <n.login_link
Macro
Parameters: text
.>login</n.login_link.> or <n.register_link
Macro
Parameters: text, title
.>register</n.register_link.>.</t>
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.only_members_can_create_topics
Macro
Requires: node
>
                                <then>
                                    <t>You will need authorization to post new topics in <t.location.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.subject
Macro
Requires: node
/>, so in addition to registering you will have to be
                                    approved by the administrators.</t>
                                </then>
                                <else>
                                    <t>If you don't want to register yet, just enter the email address from which you intend to post,
                                    and your personal address will be emailed to you.</t>
                                    <div class="second-font big-title" style="margin:1.2em 0 .2em">
                                        <t>Enter your email address</t>
                                    </div>
                                    <n.form
Macro
Requires: servlet
Parameters: macro, method, onsubmit, content
.>
                                        <input type="hidden" name="node" value="[n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.id
Binary
Namespace: NodeNamespace
/]"/>
                                        <input type="hidden" name="action" value="send"/>
                                        <input type="text" size="40" maxlength="80" name="email"/><br/>
                                        <input type="submit" value="[t]Send email to me[/t]" style="margin-top:.5em"/>
                                    </n.form.>
                                </else>
                            </n.if.page_node.only_members_can_create_topics>
                        </then>
                        <else> 
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.either
Binary
Namespace: BasicNamespace
Parameters: condition1, condition2
 condition1="[n.not
Binary
Namespace: BasicNamespace
Parameters: condition
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.only_members_can_create_topics
Macro
Requires: node
/]" condition2="[n.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_create_topic_in
Macro
Requires: user
Parameters: node_attr
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
/]">
                                <then>
                                    <t>Instead of posting via the web interface, you can also post new topics by sending emails to the following email address:</t>
                                    <div style="padding:1em">
                                        <span class="info-message rounded bold" style="padding:.4em .3em">
                                            <n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.subject
Macro
Requires: node
/>
                                            &lt;<span class="weak-color" style="font-weight:bold"><n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.user_address
Binary
Namespace: NodeNamespace
Parameters: email
 email="[n.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/]"/></span>&gt;
                                        </span>
                                    </div>
                                    <table style="width:60em">
                                        <tr valign="top">
                                            <td><img src="/images/icon_alert_sm.png"/></td>
                                            <td>
                                                <t>Note that this address is unique to you and only accepts emails sent from <t.address><b><n.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/></b></t.address>.
                                                The purpose of this design is to help prevent spam.</t>
                                            </td>
                                        </tr>
                                    </table>
                                </then>
                                <else>
                                    <t>Sorry, but only members can post messages under <t.app.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.subject
Macro
Requires: node
/>.</t><br/>
                                    <t>Please contact the administrators if you need help.</t>
                                </else>
                            </n.if.either>
                        </else>
                    </n.if.visitor.is_anonymous>
                </div>
                &laquo; <n.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.node_link
Macro
Requires: node
Parameters: text, href, title, class, target
 text="[t]Go back[/t]"/>
            </body>
        </n.html>
    </n.node_page.>
</macro>