check_omitted_nodes

NAML documentation   Watch a video
   Usages of this macro
... in user_nodes.naml
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<macro name="check_omitted_nodes" requires="node_list, user_page">
    <n.comment
Macro
Parameters: text
.>
        Here we check if this page contains the correct number of rows. If this is not the case,
        it is because the visitor doesn't have permission to view them and we must display a message.
        The check is simple: we get the number of rows this page is meant to show (current_page_rows
        command in pagination namespace) and subtract the number of rows displayed (current_index
        of the node_list loop). If the result if greater than zero, then some rows were not displayed and
        we show the message.
    </n.comment.>
    <n.paging
Binary
Namespace: NabbleNamespace
Parameters: rows_per_page, total_rows, do, current_row
.
        total_rows="[n.user_nodes_count
Macro
Requires: user_page
/]"
        current_row="[n.user_nodes_index_record
Macro
/]"
        rows_per_page="[n.user_nodes_length
Macro
/]"
    >
        <n.int
Binary
Namespace: BasicNamespace
Parameters: i, do
. i="[n.current_page_rows
Binary
Namespace: PagingNamespace
/]">
            <n.no_output
Binary
Namespace: BasicNamespace
Parameters: text
.minus
Binary
Namespace: IntegerNamespace
Parameters: i
 i="[n.current_index
Binary
Namespace: ListSequence
/]"/>
            <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.is_greater_than
Binary
Namespace: IntegerNamespace
Parameters: i
 i="0">
                <then>
                    <div class="info-message" style="margin-top:.2em;padding:.7em .5em">
                        <t>Some private items have been omitted because you don't have permission to view them.</t>
                    </div>
                </then>
            </n.if.is_greater_than>
        </n.int.>
    </n.paging.>
</macro>