0
|
1 <subroutine name="view_category" requires="basic,nabble,servlet">
|
|
2 <n.view_category_page/>
|
|
3 </subroutine>
|
|
4
|
|
5 <macro name="view_category_page">
|
|
6 <n.app_html>
|
|
7 <head>
|
|
8 <n.app_title/>
|
|
9 <n.category_table_stylesheet/>
|
|
10 </head>
|
|
11 <body>
|
|
12 <n.topics_action_link/>
|
|
13 <n.people_action_link/>
|
|
14 <n.options_action_menu/>
|
|
15
|
|
16 <n.category_table.>
|
|
17 <n.subcategories_column/>
|
|
18 <n.topic_count_column width="5em"/>
|
|
19 <n.post_count_column width="5em"/>
|
|
20 <n.last_post_column/>
|
|
21 </n.category_table.>
|
|
22
|
|
23 <n.forum_footer/>
|
|
24 </body>
|
|
25 </n.app_html>
|
|
26 </macro>
|
|
27
|
|
28 <macro name="category_table_stylesheet">
|
|
29 <style type="text/css">
|
|
30 table.main {
|
|
31 margin-top:.2em;
|
|
32 border-collapse:collapse;
|
|
33 width:100%;
|
|
34 border-width:1px;
|
|
35 border-style:solid;
|
|
36 }
|
|
37 table.main tr.header-row td {
|
|
38 padding: .3em .4em;
|
|
39 font-weight: bold;
|
|
40 border-bottom-width: 1px;
|
|
41 border-bottom-style: solid;
|
|
42 }
|
|
43 table.main tr.main-row td {
|
|
44 padding:.3em .5em;
|
|
45 border-bottom-width: 1px;
|
|
46 border-bottom-style: dotted;
|
|
47 }
|
|
48 table.main tr.main-row,
|
|
49 table.avatar-table tr {
|
|
50 vertical-align:top;
|
|
51 }
|
|
52 div.sub-forums {
|
|
53 margin-top:.8em;
|
|
54 font-size:90%;
|
|
55 clear:both;
|
|
56 }
|
|
57 </style>
|
|
58 </macro>
|
|
59
|
|
60 <macro name="category_table" dot_parameter="columns">
|
|
61 <div style="clear:both"></div>
|
|
62 <table class="main medium-border-color">
|
|
63 <n.table_header.>
|
|
64 <tr class="header-row shaded-bg-color">
|
|
65 <n.columns/>
|
|
66 </tr>
|
|
67 </n.table_header.>
|
|
68 <n.if.page_node.has_children>
|
|
69 <then>
|
|
70 <n.page_node.children_list. length="80">
|
|
71 <n.preload_messages/>
|
|
72 <n.loop.>
|
|
73 <n.current_node.>
|
|
74 <tr class="main-row [n.category_row_classes/]" node="[n.id/]">
|
|
75 <n.columns/>
|
|
76 </tr>
|
|
77 </n.current_node.>
|
|
78 </n.loop.>
|
|
79 <n.if.there_is_more>
|
|
80 <then>
|
|
81 <tr>
|
|
82 <td></td>
|
|
83 <td><n.page_node.node_link href="[n.url template='view_standard'/]" text="[t]View more[/t]"/> »</td>
|
|
84 </tr>
|
|
85 </then>
|
|
86 </n.if.there_is_more>
|
|
87 </n.page_node.children_list.>
|
|
88 </then>
|
|
89 <else>
|
|
90 <tr>
|
|
91 <td><t>Empty</t></td>
|
|
92 </tr>
|
|
93 </else>
|
|
94 </n.if.page_node.has_children>
|
|
95 </table>
|
|
96 <div style="clear:both"></div>
|
|
97
|
|
98 <n.if.page_node.has_private_subapps>
|
|
99 <then.category_privacy_js/>
|
|
100 </n.if.page_node.has_private_subapps>
|
|
101 </macro>
|
|
102
|
|
103 <macro name="category_row_classes" requires="node">
|
|
104 <n.if.is_private>
|
|
105 <then>
|
|
106 private private<n.id/> invisible
|
|
107 </then>
|
|
108 </n.if.is_private>
|
|
109 </macro>
|
|
110
|
|
111 <macro name="category_privacy_js">
|
|
112 <script type="text/javascript">
|
|
113 var url = '/template/NamlServlet.jtp?macro=category_ajax&node=<n.root_node.id/>';
|
|
114 $(document).ready(function() {
|
|
115 function showPrivateRows() {
|
|
116 $('tr.private').each(function() {
|
|
117 var nodeId = $(this).attr('node');
|
|
118 url += '&node=' + nodeId;
|
|
119 });
|
|
120 $.getScript(url);
|
|
121 }
|
|
122 if (Nabble.userId)
|
|
123 showPrivateRows();
|
|
124 });
|
|
125 </script>
|
|
126 </macro>
|
|
127
|
|
128 <macro name="category_ajax" requires="servlet">
|
|
129 <n.javascript_response/>
|
|
130 <n.get_parameter_values. name="node">
|
|
131 <n.loop.>
|
|
132 <n.get_node_from_id. node_id="[n.current_parameter_value/]">
|
|
133 <n.set_local_node.this_node />
|
|
134 <n.if.visitor.can_view.local_node>
|
|
135 <then>
|
|
136 $('tr.private<n.local_node.id/>').show();
|
|
137 </then>
|
|
138 </n.if.visitor.can_view.local_node>
|
|
139 </n.get_node_from_id.>
|
|
140 </n.loop.>
|
|
141 </n.get_parameter_values.>
|
|
142 </macro> |