display_subscriptions

NAML documentation   Watch a video
   Usages of this macro
... in display_subscriptions.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
<macro name="display_subscriptions" requires="servlet">
    <n.root_node
Binary
Namespace: NabbleNamespace
Parameters: do
.descendant_apps_list
Binary
Namespace: NodeNamespace
Parameters: do
.>
        <br/><span style="text-decoration: underline;"><b>Current Subscriptions</b></span>: Remember the overall top SUDSOL level <i>flows down</i> to any lower levels that do not have a subscription set for them.  So if you want to unsubscribe from a particular category, make sure you <b>also</b> unsubscribe from the overall SUDSOL level as well.
        <table class="subscriptions">  
            <tr class="shaded-bg-color">  
                <th class="medium-border-color"><t>Forum Category</t></th>  
                <th class="medium-border-color"><t>Your category email address</t></th>  
                <th class="medium-border-color"><t>Subscription Type</t></th>  
                <th class="medium-border-color"><t>Frequency</t></th>  
                <th class="medium-border-color"></th>  
            </tr>  
            <n.loop
Macro
Requires: sequence
Parameters: by, do
.>
                 <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_view
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
>
                    <then>
                        <tr> 
                            <td class="nowrap"><n.current_node
Binary
Namespace: NodeList
Parameters: do
.subject
Macro
Requires: node
/></td>
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.can_post_under
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
> 
                                <then>
                                    <td class="nowrap"><n.current_node
Binary
Namespace: NodeList
Parameters: do
.user_address
Binary
Namespace: NodeNamespace
Parameters: email
 email="[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/]"/></td>  
                                </then>
                                <else>
                                    <td class="nowrap">You can't post in this section</td>
                                </else>
                            </n.if.visitor.can_post_under.current_node>
                            <n.set_local_subscription
Macro
Parameters: subscription
.current_node
Binary
Namespace: NodeList
Parameters: do
.subscription_for
Binary
Namespace: NodeNamespace
Parameters: do, email
 email="[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/]" />
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_subscription
Macro
Parameters: do
.is_subscribed
Binary
Namespace: SubscriptionNamespace
>
                                <then>
                                    <td class="nowrap"><n.local_subscription
Macro
Parameters: do
.type_label
Macro
Requires: subscription
/></td>
                                    <td class="nowrap"><n.local_subscription
Macro
Parameters: do
.type
Binary
Namespace: SubscriptionNamespace
/></td>                                    
                                </then>
                                <else>
                                    <td class="nowrap">Not subscribed.</td>
                                    <td class="nowrap">Not subscribed.</td>
                                </else>
                            </n.if.local_subscription.is_subscribed>
                            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.visitor
Binary
Namespace: ServletNamespace
Parameters: do
.equals
Binary
Namespace: UserNamespace
Parameters: user
.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
> 
                                <then>
                                    <n.comment
Macro
Parameters: text
.>Use regular subscribe code</n.comment.>
                                    <td class="nowrap"><a href="/template/NamlServlet.jtp?macro=subscribe&node=[n.current_node
Binary
Namespace: NodeList
Parameters: do
.id
Binary
Namespace: NodeNamespace
/]"><t>Edit Subscription</t></a> </td>
                                </then>
                                <else>
                                    <n.comment
Macro
Parameters: text
.>Is site admin, use subscribe_user code</n.comment.>
                                    <td class="nowrap"><a href="/template/NamlServlet.jtp?macro=subscribe_user&node=[n.current_node
Binary
Namespace: NodeList
Parameters: do
.id
Binary
Namespace: NodeNamespace
/]&user=[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.id
Binary
Namespace: UserNamespace
/]"><t>Admin Edit Subscription</t></a> </td>
                                </else>
                            </n.if.visitor.equals.page_user> 
                        </tr>
                     </then>
                 </n.if.visitor.can_view.current_node>              
            </n.loop.>
            <br/>
        </table>
    </n.root_node.descendant_apps_list.>
</macro>