generic_paging

NAML documentation   Watch a video
   Usages of this macro
... in app.naml
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
<macro name="generic_paging" requires="paging" parameters="margin,url">
    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.has_paging
Binary
Namespace: PagingNamespace
>
        <then>
            <n.put_in_head
Binary
Namespace: HtmlNamespace
Parameters: in_head
.>
                <style type="text/css">
                    span.current-page { padding: .1em .4em; }
                    span.page { padding: .1em; }
                    span.pages a { padding: .1em .4em; }
                    span.current-page { border-width:1px; border-style:solid; }
                    span.pages {
                        float:right;
                        white-space:nowrap;
                        font-weight:normal;
                    }
                </style>
            </n.put_in_head.>
            <n.remove_spaces_between_tags
Macro
Parameters: text
.>
                <span class="pages" style="padding:[n.margin/]">
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.is_at_beginning
Binary
Namespace: PagingNamespace
>
                        <then>
                            <n.first_page
Binary
Namespace: PagingNamespace
Parameters: do
.link
Macro
Requires: paging_page
Parameters: url
 url="[n.url/]" /> ...
                        </then>
                    </n.if.not.is_at_beginning>
                    <n.neighboring_pages
Binary
Namespace: PagingNamespace
Parameters: do
.show
Macro
Requires: paging_page
Parameters: url
 url="[n.url/]" />
                    <n.if
Binary
Namespace: BasicNamespace
Parameters: condition, else, then
.not
Binary
Namespace: BasicNamespace
Parameters: condition
.is_at_end
Binary
Namespace: PagingNamespace
>
                        <then>
                            ... <n.last_page
Binary
Namespace: PagingNamespace
Parameters: do
.link
Macro
Requires: paging_page
Parameters: url
 url="[n.url/]" />
                        </then>
                    </n.if.not.is_at_end>
                </span>
            </n.remove_spaces_between_tags.>
        </then>
    </n.if.has_paging>
</macro>