comparison src/nabble/modules/naml/spam_searcher.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 <namespace name="searcher_tool"/>
2
3 <macro name="searcher" requires="servlet">
4 <n.searcher_tool.>
5 <n.if.not.visitor.is_sysadmin>
6 <then>
7 <n.login.><t>Only authorized users can proceed in this area.</t></n.login.>
8 </then>
9 </n.if.not.visitor.is_sysadmin>
10
11 <n.if.both condition1="[n.is_submitted_form/]" condition2="[n.not.is_null.get_parameter name='results'/]">
12 <then>
13 <n.get_parameter_values. name="results">
14 <n.if.has_more_strings>
15 <then>
16 <n.loop.>
17 <n.if.is_valid_node node_id="[n.current_parameter_value/]">
18 <then>
19 <n.get_node_from_id. node_id="[n.current_parameter_value/]">
20 <n.log.>Deleted <n.id/></n.log.>
21 <n.delete_recursively/>
22 </n.get_node_from_id.>
23 </then>
24 </n.if.is_valid_node>
25 </n.loop.>
26 <n.redirect_to.get_parameter name='url'/>
27 </then>
28 </n.if.has_more_strings>
29 </n.get_parameter_values.>
30 </then>
31 </n.if.both>
32
33 <n.define_search_query_field/>
34 <n.node_page.search_namespace.>
35 <n.set_var name='didSearch' value="false" />
36 <n.catch_exception. id="search-block">
37 <n.do_search_using_params />
38 <n.set_var name='didSearch' value="true" />
39 </n.catch_exception.>
40 <n.html>
41 <head>
42 <meta name="robots" content="noindex,nofollow"/>
43 <n.search_page_title/>
44 <n.set_cookies did_search="[n.var name='didSearch'/]" />
45 <n.search_page_style/>
46
47 <script type="text/javascript">
48 $(document).ready(function() {
49 $('div.clickable').each(function() {
50 var $this = $(this);
51 var $checkbox = $this.prev().children().eq(0);
52 $this.click(function() {
53 var checked = $checkbox.attr('checked');
54 if (checked) {
55 $this.removeClass('info-message');
56 $checkbox.removeAttr('checked');
57 } else {
58 $this.addClass('info-message');
59 $checkbox.attr('checked', true);
60 }
61 });
62 });
63 });
64 function selectAll() {
65 $('input[type=checkbox]').attr('checked', true).parent().next().addClass('info-message');
66 };
67 </script>
68 </head>
69 <body>
70 <n.show_search_form/>
71 <n.show_search_error/>
72
73 <div class="search-results-header">
74 <n.if.has_resort>
75 <then.sort_controls/>
76 </n.if.has_resort>
77
78 <img src="/images/search.png" class="image16"/>
79 Found <n.total_posts/>
80 <n.search_description/>
81 </div>
82
83 <button onclick="selectAll()">Select all</button>
84 <n.form.>
85 <n.results.loop.current_node.>
86 <div style="margin-bottom:1.5em">
87 <div style="margin-bottom:.2em">
88 <input type="checkbox" name="results" value="[n.id/]"/>
89 <n.search_result_topic_subject/>
90 <n.search_result_post_subject/>
91 </div>
92 <div class="clickable">
93 <div style="margin-bottom:.2em">
94 <n.search_result_message_fragment/>
95 </div>
96
97 <div class="weak-color" style="font-size:80%">
98 <n.search_result_in_app/>
99 <n.search_result_on_date/>
100 <n.if.not.is_author_search>
101 <then>
102 by
103 <n.owner.user_link/>
104 User's Posts: <n.owner.node_count/>
105 </then>
106 </n.if.not.is_author_search>
107 &mdash;
108 <n.topic_node.replies/> replies in thread
109 </div>
110 </div>
111 </div>
112 </n.results.loop.current_node.>
113
114 <input type="submit" value="Delete Posts Recursively"/>
115 <input type="hidden" name="url" value="[n.current_url/]"/>
116 </n.form.>
117
118 <n.search_pagination/>
119
120 <n.if.not.lucene_is_ready>
121 <then.index_rebuilt_notice/>
122 </n.if.not.lucene_is_ready>
123 </body>
124 </n.html>
125 </n.node_page.search_namespace.>
126 </n.searcher_tool.>
127 </macro>
128
129 <macro name="search_path" parameters="query,author,starrer,days,index_record,sort" requires="node, searcher_tool">
130 <n.encode_url.remove_spaces.>
131 /template/NamlServlet.jtp?macro=searcher&node=<n.id/>
132 <n.add_to_path name="query" value="[n.query/]" />
133 <n.add_to_path name="author" value="[n.author/]" />
134 <n.add_to_path name="starrer" value="[n.starrer/]" />
135 <n.add_to_path name="days" value="[n.days/]" />
136 <n.add_to_path name="i" value="[n.index_record/]" default_value="0" />
137 <n.add_to_path name="sort" value="[n.sort/]" default_value="relevance" />
138 </n.encode_url.remove_spaces.>
139 </macro>
140
141 <macro name="search_form" dot_parameter="do" parameters="style,query,author,starrer,days" requires="node,searcher_tool">
142 <form style="[n.style/]" action="/template/NamlServlet.jtp">
143 <input type="hidden" name="macro" value="searcher" />
144 <input type="hidden" name="node" value="[n.id/]" />
145 <n.hidden_field name="query" value="[n.query/]" />
146 <n.hidden_field name="author" value="[n.author/]" />
147 <n.hidden_field name="starrer" value="[n.starrer/]" />
148 <n.hidden_field name="days" value="[n.days/]" />
149 <n.do/>
150 </form>
151 </macro>
152
153 <macro name="search_page_length" requires="searcher_tool">
154 100
155 </macro>
156
157 <macro name="search_result_message_fragment" requires="node,search,searcher_tool">
158 <n.highlight.hide_emails.fragment. size="400">
159 <n.message.as_text/>
160 </n.highlight.hide_emails.fragment.>
161 </macro>