user_nodes_filter_control

NAML documentation   Watch a video
   Usages of this macro
... in user_nodes_filter_control.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
<override_macro name="user_nodes_filter_control" requires="user_page">
    <n.put_in_head
Binary
Namespace: HtmlNamespace
Parameters: in_head
.>
        <script type="text/javascript">
            $(document).ready(function() {
                function applyFilter() {
                    window.location = $('#filter').val();
                };
                $('#filter').change(applyFilter);
            });
        </script>
    </n.put_in_head.>
    <div class="float-left nowrap" style="margin:.3em .2em">
        <b><t>Show</t></b>
        <n.set_var
Binary
Namespace: BasicNamespace
Parameters: name, value
. name='url'>
            <n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.url
Macro
Requires: user
Parameters: filter, index_record
 filter="[n.user_nodes_filter
Macro
/]"/>
        </n.set_var.>
        <select id="filter">
            <n.select_option
Macro
Parameters: text, selectedValue, value, class
 value="[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.url
Macro
Requires: user
Parameters: filter, index_record
/]" text="[t]All Posts[/t]"/>
            <n.select_option
Macro
Parameters: text, selectedValue, value, class
 value="[n.page_user
Binary
Namespace: UserPageNamespace
Parameters: do
.url
Macro
Requires: user
Parameters: filter, index_record
 filter='topics_only'/]" selectedValue="[n.var
Binary
Namespace: BasicNamespace
Parameters: name
 name='url'/]" text="[t]Topics[/t]"/>
        </select>
        &nbsp;
        <span class="weak-color" style="font-style: italic">
            <t>Total</t>:
            <n.one_or_many
Macro
Parameters: many_text, one_text, n
.user_nodes_count
Macro
Requires: user_page
>
                <one_text><t>post</t></one_text>
                <many_text><t>posts</t></many_text>
            </n.one_or_many.user_nodes_count>
        </span>
    </div>
</override_macro>
Overrides default macro
... in user_nodes.naml
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<macro name="user_nodes_filter_control" requires="user_page">
    <n.put_in_head.>
        <script type="text/javascript">
            $(document).ready(function() {
                function applyFilter() {
                    window.location = $('#filter').val();
                };
                $('#filter').change(applyFilter);
            });
        </script>
    </n.put_in_head.>
    <div class="float-left nowrap" style="margin:.3em .2em">
        <b><t>Show</t></b>
        <n.set_var. name='url'>
            <n.page_user.url filter="[n.user_nodes_filter/]"/>
        </n.set_var.>
        <select id="filter">
            <n.select_option value="[n.page_user.url/]" text="[t]All[/t]"/>
            <n.select_option value="[n.page_user.url filter='apps_only'/]" selectedValue="[n.var name='url'/]" text="[t]Apps[/t]"/>
            <n.select_option value="[n.page_user.url filter='topics_only'/]" selectedValue="[n.var name='url'/]" text="[t]Topics[/t]"/>
        </select>
        &nbsp;
        <span class="weak-color" style="font-style: italic">
            <t>Total</t>:
            <n.one_or_many.user_nodes_count>
                <one_text><t>item</t></one_text>
                <many_text><t>items</t></many_text>
            </n.one_or_many.user_nodes_count>
        </span>
    </div>
</macro>