Mercurial Hosting > nabble
comparison src/nabble/view/naml/widget.naml @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ecd1a4ef557 |
---|---|
1 <macro name="sidebar_widget" requires="node_page,servlet"> | |
2 <n.actions_widget/> | |
3 <n.people_widget/> | |
4 <n.subscribe_widget/> | |
5 <n.categories_widget/> | |
6 <n.archives_widget/> | |
7 </macro> | |
8 | |
9 <macro name="people_widget"> | |
10 <n.put_in_head.> | |
11 <style type="text/css"> | |
12 a.people-small-link { | |
13 float:right; | |
14 font-size:80%; | |
15 padding:.1em .3em; | |
16 } | |
17 </style> | |
18 </n.put_in_head.> | |
19 <n.site_users. length="50"> | |
20 <n.filter_by.current_user.can_be_displayed_in.page_node/> | |
21 <n.if.has_more_elements n="2"> | |
22 <then> | |
23 <n.widget.> | |
24 <h2 class="sidebar-section shaded-bg-color"> | |
25 <n.page_node.people_link text="[t]All Users[/t]" class="people-small-link"/> | |
26 <t>People</t> | |
27 </h2> | |
28 <div id="recent-posters"> | |
29 <n.sub_list. start="0" length="12"> | |
30 <n.people_widget_table/> | |
31 </n.sub_list.> | |
32 </div> | |
33 </n.widget.> | |
34 </then> | |
35 </n.if.has_more_elements> | |
36 </n.site_users.> | |
37 </macro> | |
38 | |
39 <macro name="people_widget_table" requires="user_list"> | |
40 <table style="width:100%"> | |
41 <n.loop.> | |
42 <tr> | |
43 <td><n.current_user.avatar size="small"/></td> | |
44 <n.if.next_user> | |
45 <then><td><n.current_user.avatar size="small"/></td></then> | |
46 </n.if.next_user> | |
47 <n.if.next_user> | |
48 <then><td><n.current_user.avatar size="small"/></td></then> | |
49 </n.if.next_user> | |
50 <n.if.next_user> | |
51 <then><td><n.current_user.avatar size="small"/></td></then> | |
52 </n.if.next_user> | |
53 </tr> | |
54 </n.loop.> | |
55 </table> | |
56 </macro> | |
57 | |
58 <macro name="actions_widget" requires="node_page"> | |
59 <n.widget.> | |
60 <table class="actions" style="border-collapse:collapse;width:100%"> | |
61 <n.new_topic_action_row/> | |
62 <n.app_dropdown_action_row/> | |
63 <n.app_views_action_row/> | |
64 <n.app_feeds_action_row/> | |
65 </table> | |
66 </n.widget.> | |
67 </macro> | |
68 | |
69 <macro name="new_topic_action_row" requires="node_page"> | |
70 <tr> | |
71 <td style="width:20px"> | |
72 <img src="/images/icon_post_message.png" class="image16" border="0"/> | |
73 </td> | |
74 <td class="nowrap" style="padding-left:.2em"> | |
75 <n.page_node.new_topic_link | |
76 text="[t]New Post[/t]" | |
77 title="[t]Post new message in [t.location.page_node.subject/][/t]" | |
78 /> | |
79 </td> | |
80 </tr> | |
81 </macro> | |
82 | |
83 <macro name="app_dropdown_action_row" requires="node_page"> | |
84 <tr> | |
85 <td style="width:20px;padding-top:.5em"> | |
86 <img src="/images/gear.png" class="image16" border="0" /> | |
87 </td> | |
88 <td class="nowrap" style="padding:.5em 0 0 .2em"> | |
89 <n.page_node.app_dropdown/> | |
90 </td> | |
91 </tr> | |
92 </macro> | |
93 | |
94 <macro name="app_views_action_row" requires="node_page"> | |
95 <tr> | |
96 <td style="width:20px;padding-top:.5em"> | |
97 <img src="/images/eye.png" class="image16"/> | |
98 </td> | |
99 <td class="nowrap" style="padding:.5em 0 0 .2em"> | |
100 <n.page_node.views show_text="true"/> | |
101 </td> | |
102 </tr> | |
103 </macro> | |
104 | |
105 <macro name="app_feeds_action_row" requires="node_page"> | |
106 <tr> | |
107 <td style="width:20px;padding-top:.5em"> | |
108 <img src="/images/feeds.png" width="16" height="16" border="0" alt="feeds"/> | |
109 </td> | |
110 <td class="nowrap" style="padding:.5em 0 0 .2em"> | |
111 <n.page_node.feeds_link/> | |
112 </td> | |
113 </tr> | |
114 </macro> | |
115 | |
116 <macro name="subscribe_widget"> | |
117 <n.widget.> | |
118 <div id="subscribe-widget" class="invisible"> | |
119 <h2 class="sidebar-section shaded-bg-color"><t>Subscribe via email</t></h2> | |
120 <ul id="subscribe-widget-form" class="sidebar-section"> | |
121 <n.form. macro="subscribe"> | |
122 <input type="hidden" name="node" value="[n.page_node.id/]"/> | |
123 <input type="hidden" name="action" value="send-anonymous"/> | |
124 <input type="hidden" name="subscription_to" value="CHILDREN"/> | |
125 <table> | |
126 <tr> | |
127 <td><b><t>Email</t></b></td> | |
128 <td><input type="text" size="25" maxlength="80" name="email"/></td> | |
129 </tr> | |
130 <tr> | |
131 <td></td> | |
132 <td><input type="submit" value="[t]Subscribe[/t]" style="margin-top:.5em"/></td> | |
133 </tr> | |
134 </table> | |
135 </n.form.> | |
136 </ul> | |
137 </div> | |
138 <script type="text/javascript"> | |
139 if (!Nabble.userId) | |
140 Nabble.get('subscribe-widget').style.display = 'block'; | |
141 </script> | |
142 </n.widget.> | |
143 </macro> | |
144 | |
145 <macro name="categories_widget"> | |
146 <n.widget.> | |
147 <n.if.page_node.has_subapps> | |
148 <then> | |
149 <h2 class="sidebar-section shaded-bg-color"><t>Subcategories</t></h2> | |
150 <ul class="sidebar-section"> | |
151 <n.page_node.subapps_list.loop.> | |
152 <li class="medium-border-color"><n.current_node.node_link.url/></li> | |
153 </n.page_node.subapps_list.loop.> | |
154 </ul> | |
155 <n.separator/> | |
156 </then> | |
157 </n.if.page_node.has_subapps> | |
158 </n.widget.> | |
159 </macro> | |
160 | |
161 <macro name="archives_widget" requires="node_page,servlet"> | |
162 <n.widget.> | |
163 <h2 class="sidebar-section shaded-bg-color"><t>Archives</t></h2> | |
164 <ul class="sidebar-section"> | |
165 <n.page_node.monthly_archives.> | |
166 <li class="medium-border-color"> | |
167 <a href="[n.page_node.path/]"><t>All</t></a> | |
168 <span class="weak-color">(<n.total/>)</span> | |
169 </li> | |
170 | |
171 <n.year_list.loop.> | |
172 <li class="medium-border-color"> | |
173 <div class="year bold"> | |
174 <span>▸</span> | |
175 <n.current_year.year/> | |
176 </div> | |
177 <div style="margin:.3em 0 .3em 1em; display:none"> | |
178 <n.current_year.month_list.loop.> | |
179 <n.set_var. name="year-month"><n.current_month.year/><n.current_month.month/></n.set_var.> | |
180 <n.set_var. name="class"> | |
181 <n.if.equal value1="[n.var name='year-month'/]" value2="[n.app_date/]"> | |
182 <then>highlight</then> | |
183 </n.if.equal> | |
184 </n.set_var.> | |
185 <n.set_var. name="archive-url"> | |
186 <n.page_node.app_path_by_date date="[n.var name='year-month'/]"/> | |
187 </n.set_var.> | |
188 <div class="[n.var name='class'/]" style="margin:.2em 0; padding: .2em .3em"> | |
189 <a href="[n.var name='archive-url'/]" rel="nofollow"><n.current_month.archive_text/></a> | |
190 <span class="weak-color">(<n.current_month.count/>)</span> | |
191 </div> | |
192 </n.current_year.month_list.loop.> | |
193 </div> | |
194 </li> | |
195 </n.year_list.loop.> | |
196 </n.page_node.monthly_archives.> | |
197 </ul> | |
198 <script type="text/javascript"> | |
199 $(document).ready(function() { | |
200 function collapse(e) { | |
201 $(e).children().first().html('▸'); | |
202 $(e).next().slideUp(); | |
203 }; | |
204 function expand(e) { | |
205 $(e).children().first().html('▾'); | |
206 $(e).next().slideDown(); | |
207 }; | |
208 var $years = $('.year'); | |
209 $years.css('cursor', 'pointer'); | |
210 var expanded = false; | |
211 $years.each(function() { | |
212 var isOpen = $('div.highlight', $(this).next()).size() > 0; | |
213 if (isOpen) { | |
214 expand(this); | |
215 expanded = true; | |
216 } | |
217 $(this).click(function() { | |
218 var isOpen = $(this).next().is(':visible'); | |
219 if (isOpen) | |
220 collapse(this); | |
221 else | |
222 expand(this); | |
223 }); | |
224 }); | |
225 if (!expanded) { | |
226 expand($years.eq(0).get()); | |
227 } | |
228 }); | |
229 </script> | |
230 </n.widget.> | |
231 </macro> | |
232 | |
233 <macro name="archive_text" requires="month_row"> | |
234 <n.if.equal value1="[n.month/]" value2="01"><then><t>January</t></then></n.if.equal> | |
235 <n.if.equal value1="[n.month/]" value2="02"><then><t>February</t></then></n.if.equal> | |
236 <n.if.equal value1="[n.month/]" value2="03"><then><t>March</t></then></n.if.equal> | |
237 <n.if.equal value1="[n.month/]" value2="04"><then><t>April</t></then></n.if.equal> | |
238 <n.if.equal value1="[n.month/]" value2="05"><then><t>May</t></then></n.if.equal> | |
239 <n.if.equal value1="[n.month/]" value2="06"><then><t>June</t></then></n.if.equal> | |
240 <n.if.equal value1="[n.month/]" value2="07"><then><t>July</t></then></n.if.equal> | |
241 <n.if.equal value1="[n.month/]" value2="08"><then><t>August</t></then></n.if.equal> | |
242 <n.if.equal value1="[n.month/]" value2="09"><then><t>September</t></then></n.if.equal> | |
243 <n.if.equal value1="[n.month/]" value2="10"><then><t>October</t></then></n.if.equal> | |
244 <n.if.equal value1="[n.month/]" value2="11"><then><t>November</t></then></n.if.equal> | |
245 <n.if.equal value1="[n.month/]" value2="12"><then><t>December</t></then></n.if.equal> | |
246 </macro> |