Mercurial Hosting > nabble
comparison src/nabble/view/naml/ban_user.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="ban_user" requires="servlet"> | |
2 <n.user_page.> | |
3 <n.if.not.visitor.can_manage_banned_users> | |
4 <then> | |
5 <n.login.><t>Only authorized users can proceed in this area.</t></n.login.> | |
6 </then> | |
7 </n.if.not.visitor.can_manage_banned_users> | |
8 <n.if.is_submitted_form> | |
9 <then> | |
10 <n.if.ban_user_field.is_checked> | |
11 <then><n.page_user.ban/></then> | |
12 </n.if.ban_user_field.is_checked> | |
13 | |
14 <n.if.delete_posts_field.is_checked> | |
15 <then><n.page_user.delete_user_nodes/></then> | |
16 </n.if.delete_posts_field.is_checked> | |
17 </then> | |
18 </n.if.is_submitted_form> | |
19 <n.html> | |
20 <head> | |
21 <META NAME="robots" CONTENT="noindex,nofollow"/> | |
22 <n.title.><t>Ban User</t></n.title.> | |
23 <script type="text/javascript"> | |
24 $(document).ready(function() { | |
25 function enableButton() { | |
26 var $submit = $('input[type="submit"]'); | |
27 var disabled = !$('#ban_this_user').is(':checked') && !$('#delete_posts').is(':checked'); | |
28 if (disabled) | |
29 $submit.attr('disabled','true'); | |
30 else | |
31 $submit.removeAttr('disabled'); | |
32 } | |
33 $('input[type="checkbox"]').click(enableButton); | |
34 enableButton(); | |
35 }); | |
36 </script> | |
37 <n.bold_label_style/> | |
38 </head> | |
39 <body> | |
40 <n.edit_header first_text="[t]Ban User[/t]" second_text="[n.page_user.name/]" /> | |
41 | |
42 <n.form.> | |
43 <table style="margin-bottom: .5em"> | |
44 <tr valign="top"> | |
45 <td><n.page_user.avatar size="big"/></td> | |
46 <td> | |
47 <div style="padding:.3em .5em"> | |
48 <t>Select below the actions you want to take:</t> | |
49 </div> | |
50 <n.ban_user_control/> | |
51 <n.delete_posts_control/> | |
52 </td> | |
53 </tr> | |
54 </table> | |
55 | |
56 <n.if.not.is_submitted_form> | |
57 <then> | |
58 <div style="margin-top:1.4em"> | |
59 <input type="submit" value="[t]Take Action[/t]" disabled="true"/> | |
60 <t>or</t> <a href="[n.page_user.url/]"><t>Cancel</t></a> | |
61 </div> | |
62 </then> | |
63 </n.if.not.is_submitted_form> | |
64 </n.form.> | |
65 | |
66 <p><t>You can also <n.manage_banned_users_link.>manage banned users</n.manage_banned_users_link.> in <t.location.root_node.subject/>.</t></p> | |
67 </body> | |
68 </n.html> | |
69 </n.user_page.> | |
70 </macro> | |
71 | |
72 <macro name="ban_user_control"> | |
73 <n.if.page_user.is_authenticated> | |
74 <then> | |
75 <table style="margin-bottom:1em"> | |
76 <tr valign="top"> | |
77 <n.ban_user_field.> | |
78 <n.if.not.is_submitted_form> | |
79 <then> | |
80 <td><n.checkbox/></td> | |
81 <td> | |
82 <label for="[n.name/]"><t>Ban this user</t></label> | |
83 <div class="weak-color" style="margin-top:.3em"> | |
84 <t>If you ban this user, he/she won't be able to do anything in <t.location.root_node.subject/>.</t> | |
85 <t>Remember that the banning action isn't efficient because the user can always come back with a different account.</t> | |
86 </div> | |
87 </td> | |
88 </then> | |
89 <else> | |
90 <n.if.is_checked> | |
91 <then> | |
92 <td><img src="/images/success.png" class="image16"/></td> | |
93 <td><t><t.author><b><n.page_user.name/></b></t.author> has been successfully banned.</t></td> | |
94 </then> | |
95 </n.if.is_checked> | |
96 </else> | |
97 </n.if.not.is_submitted_form> | |
98 </n.ban_user_field.> | |
99 </tr> | |
100 </table> | |
101 </then> | |
102 </n.if.page_user.is_authenticated> | |
103 </macro> | |
104 | |
105 <macro name="delete_posts_control"> | |
106 <table style="margin-bottom:1em"> | |
107 <tr valign="top"> | |
108 <n.delete_posts_field.> | |
109 <n.if.not.is_submitted_form> | |
110 <then> | |
111 <td><n.checkbox/></td> | |
112 <td> | |
113 <label for="[n.name/]"><t>Delete all posts from this user</t></label> | |
114 <div class="weak-color" style="margin-top:.3em"> | |
115 <t>The user will receive a copy of all delete posts by email, so that he/she can have a chance to save them.</t> | |
116 </div> | |
117 </td> | |
118 </then> | |
119 <else> | |
120 <n.if.is_checked> | |
121 <then> | |
122 <td><img src="/images/success.png" class="image16"/></td> | |
123 <td><t>All posts from <t.author><b><n.page_user.name/></b></t.author> have been successfully removed.</t></td> | |
124 </then> | |
125 </n.if.is_checked> | |
126 </else> | |
127 </n.if.not.is_submitted_form> | |
128 </n.delete_posts_field.> | |
129 </tr> | |
130 </table> | |
131 </macro> | |
132 | |
133 <macro name="ban_user_field" dot_parameter="do"> | |
134 <n.field. name="ban_this_user"><n.do/></n.field.> | |
135 </macro> | |
136 | |
137 <macro name="delete_posts_field" dot_parameter="do"> | |
138 <n.field. name="delete_posts"><n.do/></n.field.> | |
139 </macro> |