4 <script type="text/javascript">
\r
6 username: '{{ user.username }}}',
\r
7 confirm: "{% trans "Are you sure?" %}",
\r
8 yes: "{% trans "Yes" %}",
\r
9 no: "{% trans "No" %}",
\r
10 points: "{% trans "Points to award:" %}",
\r
11 message: "{% trans "Message:" %}",
\r
12 award: "{% trans "Award" %}",
\r
13 cancel: "{% trans "Cancel" %}"
\r
17 <div id="user-menu-container">
\r
18 <span id="user-menu">{% trans "User tools" %} ▼</span>
\r
19 <ul id="user-menu-dropdown">
\r
20 <li class="item"><span class="user-edit"></span><a href="{% url edit_user id=user.id %}">{% trans "edit profile" %}</a></li>
\r
21 <li class="item"><span class="user-auth"></span><a href="{% url user_authsettings id=user.id %}">{% trans "authentication settings" %}</a></li>
\r
22 <li class="item"><span class="user-subscriptions"></span><a href="{% url user_subscriptions id=user.id %}">{% trans "email notification settings" %}</a></li>
\r
23 {% ifnotequal user viewer %}
\r
24 {% if viewer.is_superuser %}
\r
25 <li class="separator">{% trans "Moderation tools" %}</li>
\r
26 <li class="item"><span class="user-award_rep"></span><a href="{% url user_award_points id=user.id %}" id="award-rep-points">{% trans "reputation bonus" %}</a></li>
\r
27 {% if not user.is_superuser %}
\r
28 {% if not user.is_staff %}
\r
29 <li class="item"><span class="user-moderator"></span>
\r
30 <a class="confirm" href="{% url user_powers id=user.id,action="grant",status="staff" %}">{% trans "grant moderator status" %}</a>
\r
33 <li class="item"><span class="user-moderator"></span>
\r
34 <a class="confirm" href="{% url user_powers id=user.id,action="remove",status="staff" %}">{% trans "remove moderator status" %}</a>
\r
37 <li class="item"><span class="user-superuser"></span>
\r
38 <a class="confirm" href="{% url user_powers id=user.id,action="grant",status="super" %}">{% trans "grant super user status" %}</a>
\r
41 {% ifequal viewer.id 1 %}
\r
42 <li class="item"><span class="user-superuser"></span>
\r
43 <a class="confirm" href="{% url user_powers id=user.id,action="remove",status="super" %}">{% trans "remove super user status" %}</a>
\r
53 <h3>{% trans "Moderation tools" %}</h3>
\r
54 <p><a href="#" id="point-award-action">{% trans "Reputation bonus" %}</a></p>
\r
55 <form action="" method="POST">
\r
56 <table style="display: none" id="award-points-table" class="moderation-table">
\r
57 {{ awardform.as_table }}
\r
58 <tr><td colspan="2" class="moderation-table-footer"><input type="submit" id="award-points-submit" value="{% trans "Send" %}" /></td></tr>
\r
63 $('#point-award-action').click(function() {
\r
64 $('#award-points-table').slideToggle('slow');
\r
67 $('#award-points-submit').click(function() {
\r
68 $('#award-points-table').find('.error').remove();
\r
69 var $points_input = $('#award-points-table').find('input[type=text]');
\r
70 var points = parseInt($points_input.val());
\r
72 if (isNaN(points) || points < 1) {
\r
73 $points_input.before('<p class="error">{% trans "Sorry but that\'s not a valid input" %}</p>');
\r
77 $.post('{% url user_award_points id=user.id %}')
\r
81 {% if not user.is_superuser %}
\r
82 <p><a href="{% url user_powers id=user.id,action="grant",status="super" %}">{% trans "Grant super user status" %}</a></p>
\r
83 {% if not user.is_staff %}
\r
84 <p><a href="{% url user_powers id=user.id,action="grant",status="staff" %}">{% trans "Grant moderator status" %}</a></p>
\r
86 <p><a href="{% url user_powers id=user.id,action="remove",status="staff" %}" class="">{% trans "Remove moderator status" %}</a></p>
\r
89 {% ifequal moderator.id 1 %}
\r
90 {% ifnotequal user.id 1 %}
\r
91 <p><a href="{% url user_powers id=user.id,action="remove",status="super" %}">{% trans "Remove super user status" %}</a></p>
\r