sub_descendants_user

NAML documentation   Watch a video
   Usages of this macro
... in subscribe_user_top_digest.naml
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<macro name='sub_descendants_user' requires='node' parameters='user'>
    <n.set_local_user
Macro
Parameters: user
.user/>
    <n.set_local_subscription
Macro
Parameters: subscription
.page_node
Binary
Namespace: NodePageNamespace
Parameters: do
.subscription_for
Binary
Namespace: NodeNamespace
Parameters: do, email
 email="[n.local_user
Macro
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/]" />
    <n.this_node
Binary
Namespace: NodeNamespace
Parameters: do
.descendant_apps_list
Binary
Namespace: NodeNamespace
Parameters: do
.>
        <n.loop
Macro
Requires: sequence
Parameters: by, do
.>       
            <n.set_local_subscription
Macro
Parameters: subscription
.current_node
Binary
Namespace: NodeList
Parameters: do
.subscription_for
Binary
Namespace: NodeNamespace
Parameters: do, email
 email="[n.local_user
Macro
Parameters: do
.user_email
Binary
Namespace: UserNamespace
/]" />
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.local_user
Macro
Parameters: do
.can_view
Macro
Requires: user
Parameters: node_attr
.current_node
Binary
Namespace: NodeList
Parameters: do
>
                <then>
                    <n.subscription_type_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/>
                    <n.local_subscription
Macro
Parameters: do
.save
Binary
Namespace: SubscriptionNamespace
Parameters: to, type
                    to="[n.subscription_to_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/]"
                    type="[n.subscription_type_field
Macro
Parameters: do
.value
Binary
Namespace: FieldNamespace
/]"
                    />
                </then>
            </n.if.local_user.can_view.current_node>
        </n.loop.>
    </n.this_node.descendant_apps_list.>
</macro>