Mercurial Hosting > nabble
comparison src/nabble/view/naml/people.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children | 18cf4872fd7f |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <macro name="app_people" requires="servlet"> | |
2 <n.app_people_caching/> | |
3 <n.node_page.> | |
4 <n.html> | |
5 <head> | |
6 <n.people_head/> | |
7 </head> | |
8 <body> | |
9 <n.people_header/> | |
10 <n.people_tabbed_pane/> | |
11 </body> | |
12 </n.html> | |
13 </n.node_page.> | |
14 </macro> | |
15 | |
16 <macro name="app_people_caching"> | |
17 <n.if.not.is_online_users> | |
18 <then.uncache_for.> | |
19 <n.new_user/> | |
20 <n.user_group_change/> | |
21 </then.uncache_for.> | |
22 </n.if.not.is_online_users> | |
23 </macro> | |
24 | |
25 <macro name="people_head"> | |
26 <n.people_title/> | |
27 <n.if.is_null.people_filter> | |
28 <then> | |
29 <META NAME="description" CONTENT="[t]People in [t.location.page_node.subject/][/t]"/> | |
30 <META NAME="keywords" CONTENT="[n.page_node.subject/], users, posters, members, administrators, community"/> | |
31 </then> | |
32 </n.if.is_null.people_filter> | |
33 </macro> | |
34 | |
35 <macro name="people_title"> | |
36 <n.title.> | |
37 <t>People in <t.location.page_node.subject/></t> | |
38 <n.if.not.is_null.people_filter> | |
39 <then>(<n.people_filter/>)</then> | |
40 </n.if.not.is_null.people_filter> | |
41 </n.title.> | |
42 </macro> | |
43 | |
44 <macro name="people_header"> | |
45 <h2 class="weak-color"> | |
46 <img src="/images/people.png" class="image24" alt="[t]People[/t]"/> | |
47 <t>People in <t.location.page_node.subject/></t> | |
48 </h2> | |
49 </macro> | |
50 | |
51 <macro name="people_tabbed_pane"> | |
52 <div style="margin:.5em 0"> | |
53 <n.horizontal_tab_control.> | |
54 <n.add_horizontal_tab | |
55 url="[n.page_node.people_path/]" | |
56 text="[t]Users & Groups[/t]" | |
57 selected="[n.not.is_online_users/]" | |
58 details="[n.visible_users_table.people_columns/]" | |
59 /> | |
60 <n.add_horizontal_tab | |
61 url="[n.page_node.people_path filter='online-users'/]" | |
62 text="[t]Online Users[/t]" | |
63 selected="[n.is_online_users/]" | |
64 details="[n.online_users_table.people_columns/]" | |
65 /> | |
66 </n.horizontal_tab_control.> | |
67 </div> | |
68 </macro> | |
69 | |
70 <macro name="people_columns"> | |
71 <n.set_visitor_online/> | |
72 <n.user_column width="70%"/> | |
73 <n.user_state_column/> | |
74 <n.user_post_count_column/> | |
75 </macro> | |
76 | |
77 <macro name="online_users_table" dot_parameter="columns" requires="node_page"> | |
78 <n.online_users. include_invisible_users="[n.visitor.is_site_admin/]"> | |
79 <n.filter_by.current_user.can_view.page_node/> | |
80 <n.sort_by_node_count_desc/> | |
81 <n.people_table.> | |
82 <n.columns/> | |
83 </n.people_table.> | |
84 </n.online_users.> | |
85 | |
86 <div class="weak-color" style="margin-top:1em"> | |
87 <n.one_or_many.online_anonymous_users_count> | |
88 <one_text><t>anonymous user</t></one_text> | |
89 <many_text><t>anonymous users</t></many_text> | |
90 </n.one_or_many.online_anonymous_users_count> | |
91 <br/> | |
92 <n.one_or_many.online_invisible_users_count> | |
93 <one_text><t>invisible user</t></one_text> | |
94 <many_text><t>invisible users</t></many_text> | |
95 </n.one_or_many.online_invisible_users_count> | |
96 </div> | |
97 </macro> | |
98 | |
99 <macro name="visible_users_list" dot_parameter="do" requires="node_page"> | |
100 <n.if.is_null.people_filter> | |
101 <then> | |
102 <n.if.page_node.allows_showing_members_of.registered_group> | |
103 <then> | |
104 <n.site_users. start="0" length="99999" filter="[n.registered_filter/]"> | |
105 <n.filter_by.current_user.not.is_banned/> | |
106 <n.do/> | |
107 </n.site_users.> | |
108 </then> | |
109 <else> | |
110 <!-- get the first group available --> | |
111 <n.available_groups.> | |
112 <n.if.next_element> | |
113 <then> | |
114 <n.users_in_group. group="[n.current_group/]"> | |
115 <n.filter_by.current_user.both condition1="[n.not.is_deactivated/]" condition2="[n.not.is_banned/]"/> | |
116 <n.sort_by_node_count_desc/> | |
117 <n.do/> | |
118 </n.users_in_group.> | |
119 </then> | |
120 <else.empty_users_list.do/> | |
121 </n.if.next_element> | |
122 </n.available_groups.> | |
123 </else> | |
124 </n.if.page_node.allows_showing_members_of.registered_group> | |
125 </then> | |
126 <else> | |
127 <!-- get the filtered group --> | |
128 <n.if.page_node.allows_showing_members_of.people_filter> | |
129 <then> | |
130 <n.users_in_group. group="[n.people_filter/]"> | |
131 <n.filter_by.current_user.both condition1="[n.not.is_deactivated/]" condition2="[n.not.is_banned/]"/> | |
132 <n.sort_by_node_count_desc/> | |
133 <n.do/> | |
134 </n.users_in_group.> | |
135 </then> | |
136 <else.empty_users_list.do/> | |
137 </n.if.page_node.allows_showing_members_of.people_filter> | |
138 </else> | |
139 </n.if.is_null.people_filter> | |
140 </macro> | |
141 | |
142 <macro name="visible_users_table" dot_parameter="columns" requires="node_page"> | |
143 <n.visible_users_list.> | |
144 <n.show_people_filter total_rows="[n.element_count/]"/> | |
145 <n.people_pagination total_rows="[n.element_count/]" /> | |
146 <n.sub_list. start="[n.people_page_index_record/]" length="[n.people_page_length/]"> | |
147 <n.people_table.> | |
148 <n.columns/> | |
149 </n.people_table.> | |
150 </n.sub_list.> | |
151 </n.visible_users_list.> | |
152 </macro> | |
153 | |
154 <macro name="show_people_filter" parameters="total_rows" requires="node_page"> | |
155 <n.put_in_head.> | |
156 <script type="text/javascript"> | |
157 $(document).ready(function() { | |
158 function applyFilter() { | |
159 window.location = $('#filter').val(); | |
160 }; | |
161 $('#filter').change(applyFilter); | |
162 }); | |
163 </script> | |
164 </n.put_in_head.> | |
165 <div class="nowrap float-left" style="margin-bottom:.3em"> | |
166 <b><t>Filter by group</t></b> | |
167 <select id="filter"> | |
168 <n.if.page_node.allows_showing_members_of.registered_group> | |
169 <then.select_option value="[n.page_node.people_path/]" text="[t]Registered Users[/t]"/> | |
170 </n.if.page_node.allows_showing_members_of.registered_group> | |
171 | |
172 <n.available_groups.loop.> | |
173 <n.select_option value="[n.page_node.people_path.current_group/]" selectedValue="[n.page_node.people_path.people_filter/]" text="[n.current_group/]"/> | |
174 </n.available_groups.loop.> | |
175 </select> | |
176 | |
177 <span class="bold" style="padding-left:1em"> | |
178 <n.one_or_many.total_rows> | |
179 <one_text><t>user</t></one_text> | |
180 <many_text><t>users</t></many_text> | |
181 </n.one_or_many.total_rows> | |
182 </span> | |
183 </div> | |
184 </macro> | |
185 | |
186 <macro name="available_groups" dot_parameter="do" requires="node_page"> | |
187 <n.page_node.groups_with_permission. permission="[n.show_group_members_permission/]"> | |
188 <n.remove.registered_group/> | |
189 <n.sort/> | |
190 <n.do/> | |
191 </n.page_node.groups_with_permission.> | |
192 </macro> | |
193 | |
194 <macro name="people_table" dot_parameter="columns" requires="user_list"> | |
195 <n.put_in_head.> | |
196 <style type="text/css"> | |
197 table.people { | |
198 width:100%; | |
199 border-collapse:collapse; | |
200 clear:both; | |
201 } | |
202 table.people td { | |
203 padding:.1em .3em; | |
204 } | |
205 tr.header-row td { | |
206 font-weight:bold; | |
207 padding: .3em; | |
208 } | |
209 </style> | |
210 </n.put_in_head.> | |
211 <n.zebra_table_javascript table_selector="table.people"/> | |
212 | |
213 <table class="people"> | |
214 <n.table_header.> | |
215 <tr class="header-row shaded-bg-color"> | |
216 <n.columns/> | |
217 </tr> | |
218 </n.table_header.> | |
219 <n.loop.> | |
220 <tr class="people-row"> | |
221 <n.columns/> | |
222 </tr> | |
223 </n.loop.> | |
224 </table> | |
225 </macro> | |
226 | |
227 <macro name="user_column" parameters="title,width" requires="user_list"> | |
228 <n.table_column> | |
229 <head> | |
230 <td style="[n.width_style.width/]"> | |
231 <n.default. to="[t]Name[/t]"><n.title/></n.default.> | |
232 </td> | |
233 </head> | |
234 <body> | |
235 <td class="weak-color"> | |
236 <table class="avatar-table"> | |
237 <tr> | |
238 <td style="padding:0;vertical-align:top"> | |
239 <n.current_user.avatar size="small"/> | |
240 </td> | |
241 <td class="nowrap" style="width:100%;padding:0 .3em"> | |
242 <n.current_user.user_link/> | |
243 </td> | |
244 </tr> | |
245 </table> | |
246 </td> | |
247 </body> | |
248 </n.table_column> | |
249 </macro> | |
250 | |
251 <macro name="user_state_column" parameters="title,width" requires="user_list"> | |
252 <n.table_column> | |
253 <head> | |
254 <td></td> | |
255 </head> | |
256 <body> | |
257 <td class="weak-color"> | |
258 <n.if.current_user.is_anonymous> | |
259 <then><t>Anonymous</t></then> | |
260 <else> | |
261 <n.if.current_user.is_registered> | |
262 <then><t>Registered</t></then> | |
263 <else> | |
264 <n.if.current_user.is_deactivated> | |
265 <then><t>Unregistered / Deactivated</t></then> | |
266 <else><t>Unregistered</t></else> | |
267 </n.if.current_user.is_deactivated> | |
268 </else> | |
269 </n.if.current_user.is_registered> | |
270 </else> | |
271 </n.if.current_user.is_anonymous> | |
272 </td> | |
273 </body> | |
274 </n.table_column> | |
275 </macro> | |
276 | |
277 <macro name="user_post_count_column" parameters="title,width" requires="user_list"> | |
278 <n.table_column> | |
279 <head> | |
280 <td class="nowrap" style="text-align:center;[n.width_style.width/]"> | |
281 <n.default. to="[t]Post Count[/t]"><n.title/></n.default.> | |
282 </td> | |
283 </head> | |
284 <body> | |
285 <td class="weak-color" style="text-align:center"> | |
286 <n.current_user.node_count/> | |
287 </td> | |
288 </body> | |
289 </n.table_column> | |
290 </macro> | |
291 | |
292 <macro name="people_pagination" parameters="total_rows" requires="node_page"> | |
293 <n.paging. | |
294 total_rows="[n.total_rows/]" | |
295 current_row="[n.people_page_index_record/]" | |
296 rows_per_page="[n.people_page_length/]" | |
297 > | |
298 <n.generic_paging> | |
299 <margin>.55em .2em</margin> | |
300 <url><n.page_node.people_path filter="[n.people_filter/]" index_record="[n.page_row/]"/></url> | |
301 </n.generic_paging> | |
302 </n.paging.> | |
303 </macro> | |
304 | |
305 <macro name="people_path" requires="node" dot_parameter="filter" parameters="index_record"> | |
306 <n.encode_url.remove_spaces.> | |
307 /template/NamlServlet.jtp?macro=app_people&node=<n.id/> | |
308 <n.add_to_path name="filter" value="[n.filter/]"/> | |
309 <n.add_to_path name="i" value="[n.index_record/]" default_value="0"/> | |
310 </n.encode_url.remove_spaces.> | |
311 </macro> | |
312 | |
313 <macro name="people_filter" requires="servlet"> | |
314 <n.get_parameter name="filter"/> | |
315 </macro> | |
316 | |
317 <macro name="people_page_index_record"> | |
318 <n.get_parameter name="i"/> | |
319 </macro> | |
320 | |
321 <macro name="people_page_length"> | |
322 20 | |
323 </macro> | |
324 | |
325 <macro name="is_online_users"> | |
326 <n.is_people_filter value='online-users' /> | |
327 </macro> | |
328 | |
329 <macro name="is_people_filter" parameters="value"> | |
330 <n.equal value1="[n.people_filter/]" value2="[n.value/]" /> | |
331 </macro> | |
332 | |
333 <macro name="empty_users_list" dot_parameter="do"> | |
334 <n.site_users. start="0" length="0"> | |
335 <n.do/> | |
336 </n.site_users.> | |
337 </macro> |