\r
def save(self, *args, **kwargs):\r
super(ActionRepute, self).save(*args, **kwargs)\r
- self.user.reputation = models.F('reputation') + self.value\r
+ self.user.reputation += self.value\r
self.user.save()\r
\r
def delete(self):\r
- self.user.reputation = models.F('reputation') - self.value\r
+ self.user.reputation -= self.value\r
self.user.save()\r
super(ActionRepute, self).delete()\r
\r
$('div#editor_side_bar').hide();
$('div#tags_side_bar').hide();
- $('input#id_title').focus(function(){changeSideBar('div#title_side_bar')});
- $('textarea#editor').focus(function(){changeSideBar('div#editor_side_bar')});
- $('input#id_tags').focus(function(){changeSideBar('div#tags_side_bar')});
+ $('#id_title').focus(function(){changeSideBar('div#title_side_bar')});
+ $('#editor').focus(function(){changeSideBar('div#editor_side_bar')});
+ $('#id_tags').focus(function(){changeSideBar('div#tags_side_bar')});
});
$(function() {
}\r
}\r
\r
-function show_message(object, msg, callback) {\r
- var div = $('<div class="vote-notification"><h3>' + msg + '</h3>(' +\r
- 'click to close' + ')</div>');\r
-\r
- div.click(function(event) {\r
- $(".vote-notification").fadeOut("fast", function() {\r
- $(this).remove();\r
- if (callback) {\r
- callback();\r
- }\r
+function show_dialog (extern) {\r
+ var default_close_function = function($diag) {\r
+ $diag.fadeOut('fast', function() {\r
+ $diag.remove();\r
});\r
- });\r
+ }\r
\r
- object.parent().append(div);\r
- div.fadeIn("fast");\r
-}\r
+ var options = {\r
+ extra_class: '',\r
+ pos: {\r
+ x: ($(window).width() / 2) + $(window).scrollLeft(),\r
+ y: ($(window).height() / 2) + $(window).scrollTop()\r
+ },\r
+ dim: false, \r
+ yes_text: messages.ok,\r
+ yes_callback: default_close_function,\r
+ no_text: messages.cancel,\r
+ show_no: false,\r
+ close_on_clickoutside: false\r
+ }\r
\r
-function load_prompt(object, url) {\r
- var $box = $('<div class="vote-notification">' +\r
- '<img src="/m/default/media/images/indicator.gif" />' +\r
- '</div>');\r
+ $.extend(options, extern);\r
\r
+ if (options.event != undefined) {\r
+ options.pos = {x: options.event.pageX, y: options.event.pageY};\r
+ }\r
\r
- object.parent().append($box);\r
- $box.fadeIn("fast");\r
+ var html = '<div class="dialog ' + options.extra_class + '" style="display: none;">'\r
+ + '<div class="dialog-content">' + options.html + '</div><div class="dialog-buttons">';\r
\r
- $box.load(url, function() {\r
- $box.find('.prompt-cancel').click(function() {\r
- $box.fadeOut('fast', function() {\r
- $box.remove();\r
- });\r
- return false;\r
+ if (options.show_no) {\r
+ html += '<button class="dialog-no">' + options.no_text + '</button>';\r
+ }\r
+\r
+ html += '<button class="dialog-yes">' + options.yes_text + '</button>'\r
+ + '</div></div>';\r
+\r
+ $dialog = $(html);\r
+ $('body').append($dialog);\r
+\r
+ if (options.dim === false) {\r
+ $dialog.css({\r
+ visibility: 'hidden',\r
+ display: 'block'\r
});\r
\r
- $box.find('.prompt-submit').click(function() {\r
- start_command();\r
- $.post(url, {prompt: $box.find('textarea').val()}, function(data) {\r
- $box.fadeOut('fast', function() {\r
- $box.remove();\r
- });\r
- process_ajax_response(data, object);\r
- }, 'json');\r
- return false;\r
+ options.dim = {w: $dialog.width(), h: $dialog.height()};\r
+\r
+ $dialog.css({\r
+ width: 1,\r
+ height: 1,\r
+ visibility: 'visible'\r
});\r
+ }\r
+\r
+ $dialog.css({\r
+ top: options.pos.y,\r
+ left: options.pos.x\r
+ });\r
+\r
+ $dialog.animate({\r
+ top: "-=" + (options.dim.h / 2),\r
+ left: "-=" + (options.dim.w / 2),\r
+ width: options.dim.w,\r
+ height: options.dim.h\r
+ }, 200);\r
+ \r
+ $dialog.find('.dialog-no').click(function() {\r
+ default_close_function($dialog);\r
});\r
-}\r
\r
-function show_prompt(object, msg, callback) {\r
- var div = $('<div class="vote-notification">' + msg + '<br />' +\r
- '<textarea class="command-prompt"></textarea><br />' +\r
- '<button class="prompt-cancel">Cancel</button>' +\r
- '<button class="prompt-ok">OK</button>' +\r
- '</div>');\r
+ $dialog.find('.dialog-yes').click(function() {\r
+ options.yes_callback($dialog);\r
+ });\r
\r
- function fade_out() {\r
- div.fadeOut("fast", function() { div.remove(); });\r
+ if (options.close_on_clickoutside) {\r
+ $dialog.one('clickoutside', function() {\r
+ default_close_function($dialog);\r
+ });\r
}\r
\r
- div.find('.prompt-cancel').click(fade_out);\r
+ return $dialog;\r
+}\r
\r
- div.find('.prompt-ok').click(function(event) {\r
- callback(div.find('.command-prompt').val());\r
- fade_out();\r
+function show_message(evt, msg, callback) {\r
+ var $dialog = show_dialog({\r
+ html: msg,\r
+ extra_class: 'warning',\r
+ event: evt,\r
+ yes_callback: function() {\r
+ $dialog.fadeOut('fast', function() {\r
+ $dialog.remove();\r
+ });\r
+ if (callback) {\r
+ callback();\r
+ }\r
+ },\r
+ close_on_clickoutside: true\r
});\r
+}\r
\r
- object.parent().append(div);\r
- div.fadeIn("fast"); \r
+function load_prompt(evt, url) {\r
+ $.get(url, function(data) {\r
+ var $dialog = show_dialog({\r
+ html: data,\r
+ //extra_class: 'warning',\r
+ event: evt,\r
+ yes_callback: function() {\r
+ $.post(url, {prompt: $dialog.find('.prompt-return').val()}, function(data) {\r
+ $dialog.fadeOut('fast', function() {\r
+ $dialog.remove();\r
+ });\r
+ process_ajax_response(data, evt);\r
+ }, 'json');\r
+ },\r
+ show_no: true\r
+ });\r
+ });\r
}\r
\r
-function process_ajax_response(data, el, callback) {\r
+function process_ajax_response(data, evt, callback) {\r
if (!data.success && data['error_message'] != undefined) {\r
- show_message(el, data.error_message, function() {if (callback) callback(true);});\r
+ show_message(evt, data.error_message, function() {if (callback) callback(true);});\r
end_command(false);\r
} else if (typeof data['commands'] != undefined){\r
for (var command in data.commands) {\r
}\r
\r
if (data['message'] != undefined) {\r
- show_message(el, data.message, function() {if (callback) callback(false);})\r
+ show_message(evt, data.message, function() {if (callback) callback(false);})\r
} else {\r
if (callback) callback(false);\r
}\r
}\r
\r
$(function() {\r
- $('a.ajax-command').live('click', function() {\r
+ $('a.ajax-command').live('click', function(evt) {\r
if (running) return false;\r
\r
var el = $(this);\r
\r
if (el.is('.withprompt')) {\r
- load_prompt(el, el.attr('href'));\r
+ load_prompt(evt, el.attr('href'));\r
} else {\r
start_command();\r
$.getJSON(el.attr('href'), function(data) {\r
- process_ajax_response(data, el);\r
+ process_ajax_response(data, evt);\r
});\r
}\r
\r
return false;\r
});\r
\r
- $button.click(function() {\r
+ $button.click(function(evt) {\r
if (running) return false;\r
\r
var post_data = {\r
\r
start_command();\r
$.post($form.attr('action'), post_data, function(data) {\r
- process_ajax_response(data, $button, function(error) {\r
+ process_ajax_response(data, evt, function(error) {\r
if (!error) {\r
cleanup_form();\r
hide_comment_form();\r
visible = true;\r
},\r
close: function(doPostback) {\r
- if (doPostback) {\r
- $.post(scriptUrl + $.i18n._("messages/") +\r
- $.i18n._("markread/"), { formdata: "required" });\r
- }\r
$(".notify").fadeOut("fast");\r
$("body").css("margin-top", "0");\r
visible = false;\r
isVisible: function() { return visible; }\r
};\r
} ();\r
+\r
+/*\r
+ * jQuery outside events - v1.1 - 3/16/2010\r
+ * http://benalman.com/projects/jquery-outside-events-plugin/\r
+ *\r
+ * Copyright (c) 2010 "Cowboy" Ben Alman\r
+ * Dual licensed under the MIT and GPL licenses.\r
+ * http://benalman.com/about/license/\r
+ */\r
+(function($,c,b){$.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),function(d){a(d)});a("focusin","focus"+b);a("focusout","blur"+b);$.addOutsideEvent=a;function a(g,e){e=e||g+b;var d=$(),h=g+"."+e+"-special-event";$.event.special[e]={setup:function(){d=d.add(this);if(d.length===1){$(c).bind(h,f)}},teardown:function(){d=d.not(this);if(d.length===0){$(c).unbind(h)}},add:function(i){var j=i.handler;i.handler=function(l,k){l.target=k;j.apply(this,arguments)}}};function f(i){$(d).each(function(){var j=$(this);if(this!==i.target&&!j.has(i.target).length){j.triggerHandler(e,[i.target])}})}}})(jQuery,document,"outside");
\ No newline at end of file
-
-function show_dialog (html, extra_class, pos, dim, yes, no_text) {
- $dialog = $('<div class="dialog ' + extra_class + '" style="width: 1px; height: 1px;">'
- + '<div class="dialog-content">' + html + '</div><div class="dialog-buttons">'
- + '<button class="dialog-no">' + no_text + '</button>'
- + '<button class="dialog-yes">' + yes.text + '</button>'
- + '</div></div>');
-
- $('body').append($dialog);
-
- $dialog.css({
- top: pos.y,
- left: pos.x
- });
-
- $dialog.animate({
- top: "-=" + (dim.h / 2),
- left: "-=" + (dim.w / 2),
- width: dim.w,
- height: dim.h
- }, 200, function() {
- $dialog.find('.dialog-no').click(function() {
- $dialog.fadeOut('fast');
- });
- $dialog.find('.dialog-yes').click(function() {
- yes.callback($dialog);
- });
- });
-
-}
-
-
$().ready(function() {
var $dropdown = $('#user-menu-dropdown');
$('#user-menu').click(function(){
- $('.dialog').fadeOut('fast');
- $dropdown.slideToggle('fast');
+ $('.dialog').fadeOut('fast', function() {
+ $dialog.remove();
+ });
+ $dropdown.slideToggle('fast', function() {
+ if ($dropdown.is(':visible')) {
+ $dropdown.one('clickoutside', function() {
+ $dropdown.slideUp('fast')
+ });
+ }
+ });
});
$('.confirm').each(function() {
$link.click(function(e) {
$dropdown.slideUp('fast');
- var html = messages.confirm;
- show_dialog(html, 'confirm', {x: e.pageX, y: e.pageY}, {w: 200, h: 100}, {
- text: messages.yes,
- callback: function() {
+ show_dialog({
+ html: messages.confirm,
+ extra_class: 'confirm',
+ event: e,
+ yes_callback: function() {
window.location = $link.attr('href');
- }
- }, messages.no);
+ },
+ yes_text: messages.yes,
+ show_no: true,
+ no_text: messages.no
+ });
return false;
});
$('#award-rep-points').click(function(e) {
$dropdown.slideUp('fast');
- var html = '<table><tr><th>' + messages.points + '</th><td><input type="text" id="points-to-award" value="1" /></td></tr>'
+ var table = '<table><tr><th>' + messages.points + '</th><td><input type="text" id="points-to-award" value="1" /></td></tr>'
+ '<tr><th>' + messages.message + '</th><td><textarea id="award-message"></textarea></td></tr></table>';
- show_dialog(html, 'award-rep-points', {x: e.pageX, y: e.pageY}, {w: 300, h: 125}, {
- text: messages.award,
- callback: function($dialog) {
- var $points_input = $('#points-to-award');
- var _points = parseInt($points_input.val());
-
- if(!isNaN(_points)) {
- $dialog.fadeOut('fast');
- var _message = $('#award-message').val();
- $.post($('#award-rep-points').attr('href'), {points: _points, message: _message}, function(data) {
- if (data.success) {
- $('#user-reputation').css('background', 'yellow');
- $('#user-reputation').html(data.reputation);
-
- $('#user-reputation').animate({ backgroundColor: "transparent" }, 1000);
-
- }
- }, 'json')
- }
- }
- }, messages.cancel);
-
+ show_dialog({
+ html: table,
+ extra_class: 'award-rep-points',
+ event: e,
+ yes_callback: function($dialog) {
+ var $points_input = $('#points-to-award');
+ var _points = parseInt($points_input.val());
+
+ if(!isNaN(_points)) {
+ $dialog.fadeOut('fast');
+ var _message = $('#award-message').val();
+ $.post($('#award-rep-points').attr('href'), {points: _points, message: _message}, function(data) {
+ if (data.success) {
+ $('#user-reputation').css('background', 'yellow');
+ $('#user-reputation').html(data.reputation);
+
+ $('#user-reputation').animate({ backgroundColor: "transparent" }, 1000);
+
+ }
+ }, 'json')
+ }
+ },
+ show_no: true
+ });
return false;
});
#ask-related-questions {
max-height: 150px;
overflow-y: auto;
+}
+
+div.dialog {
+ position: absolute;
+ background-color: #EEEEEE;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-box-shadow: 2px 2px 5px #3060A8;
+ -webkit-box-shadow: 2px 2px 5px #3060A8;
+}
+
+div.dialog .dialog-content {
+ padding: 12px 12px 37px 12px;
+}
+
+div.dialog .dialog-buttons {
+ margin: 0px;
+ height: 25px;
+ text-align: center;
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+ width: 100%;
+}
+
+.dialog-yes, .dialog-no {
+ margin: 0 3px 5px 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ background-color: #3060A8;
+ color: white;
+ height: 20px;
+ line-height: 20px;
+ font-weight: bold;
+ border: 0;
+}
+
+div.dialog.confirm, div.dialog.warning {
+ text-align: center;
+}
+
+div.dialog.confirm {
+ font-size: 140%;
+ font-weight: bold;
}
\ No newline at end of file
color: #3060A8;
}
-#user-menu-dropdown, div.dialog {
+#user-menu-dropdown {
position: absolute;
- background-color: #B6C4E2;
+ background-color: #EEEEEE;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 2px 2px 5px #3060A8;
-webkit-box-shadow: 2px 2px 5px #3060A8;
}
-div.dialog .dialog-buttons {
- margin: 0px;
- height: 25px;
- text-align: center;
- position: absolute;
- bottom: 0px;
- left: 0px;
- width: 100%;
-}
-
-.dialog-yes, .dialog-no {
- margin: 0 3px 5px 3px;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- background-color: #3060A8;
- color: white;
- height: 20px;
- line-height: 20px;
- font-weight: bold;
- border: 0;
-}
-
-div.dialog.confirm {
- text-align: center;
- line-height: 75px;
- font-size: 140%;
- font-weight: bold;
-}
-
div.dialog.award-rep-points table {
margin: auto;
margin-top: 8px;
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- template base.html -->
-{% load extra_filters %}
-{% load extra_tags %}
-{% load i18n %}
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>{% block fulltitle %}{% block title %}{% endblock %} - {{ settings.APP_SHORT_NAME }}{% endblock %}</title>
- {% spaceless %}
- {% block meta %}{% endblock %}
- {% endspaceless %}
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- {% if settings.GOOGLE_SITEMAP_CODE %}
- <meta name="google-site-verification" content="{{settings.GOOGLE_SITEMAP_CODE}}" />
- {% endif %}
- <link rel="shortcut icon" href="{{ settings.APP_FAVICON }}" />
- <link href="{% media "/media/style/style.css" %}" rel="stylesheet" type="text/css" />
- <script src="http://www.google.com/jsapi" type="text/javascript"></script>
- <script type="text/javascript">google.load("jquery", "1.4.2");</script>
- <script type="text/javascript">
- /* <![CDATA[ */
- var i18nLang = '{{settings.LANGUAGE_CODE}}';
- var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}'
- var osqaSkin = '{{settings.OSQA_SKIN}}';
- /* ]] */
- </script>
- <script type='text/javascript' src='{% media "/media/js/osqa.main.js" %}'></script>
- {% if user_messages %}
- <style type="text/css">
- body { margin-top:2.4em; }
- </style>
- <script type="text/javascript">
- $(document).ready(function() {
- $('#validate_email_alert').click(function(){notify.close(true)})
- notify.show();
- });
- </script>
- {% endif %}
- {% block forejs %}{% endblock %}
+{% extends "base_content.html" %}
+{% block page_center %}
+<div id="wrapper">
+ <div id="room">
+ <div id="CALeft">
+ {% block content%}
+ {% endblock%}
- <link rel="search" type="application/opensearchdescription+xml" href="{% url opensearch %}" title="{{ settings.APP_SHORT_NAME }} Search" />
-
- {% if settings.GOOGLE_ANALYTICS_KEY %}
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '{{ settings.GOOGLE_ANALYTICS_KEY }}']);
- _gaq.push(['_trackPageview']);
-
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- {% endif %}
- </head>
- <body>
- <div class="notify" style="display:none">
- {% autoescape off %}
- {% if user_messages %}
- {% for message in user_messages %}
- <p class="darkred">{{ message }}</p>
- {% endfor %}
- {% endif %}
- {% endautoescape %}
- <a id="close-notify" onclick="notify.close(true)">×</a>
</div>
- {% include "header.html" %}
- <div id="wrapper">
- <div id="room">
- <div id="CALeft">
- {% block content%}
- {% endblock%}
-
- </div>
- <div id="CARight">
- {% block sidebar%}
- {% endblock%}
+ <div id="CARight">
+ {% block sidebar%}
+ {% endblock%}
- </div>
- <div id="tail" style="clear:both;">
- {% block tail %}
- {% endblock %}
- </div>
- </div>
- <div class="spacer3"></div>
</div>
- {% include "footer.html" %}
- {% block endjs %}
- {% endblock %}
- </body>
-</html>
- <!-- end template base.html -->
+ <div id="tail" style="clear:both;">
+ {% block tail %}
+ {% endblock %}
+ </div>
+ </div>
+ <div class="spacer3"></div>
+</div>
+{% endblock %}
+
{% load extra_tags %}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>{% block title %}{% endblock %} - {{ settings.APP_TITLE }}</title>
+ <title>{% block fulltitle %}{% block title %}{% endblock %} - {{ settings.APP_SHORT_NAME }}{% endblock %}</title>
+ {% block meta %}{% endblock %}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
{% if settings.GOOGLE_SITEMAP_CODE %}
<meta name="google-site-verification" content="{{ settings.GOOGLE_SITEMAP_CODE }}" />
{% endif %}
<link rel="shortcut icon" href="{{ settings.APP_FAVICON }}" />
<link href="{% media "/media/style/style.css" %}" rel="stylesheet" type="text/css" />
- {% spaceless %}
{% block forestyle %}{% endblock %}
- {% endspaceless %}
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">google.load("jquery", "1.4.2");</script>
<script type="text/javascript">
var i18nLang = '{{settings.LANGUAGE_CODE}}';
var scriptUrl = '/{{settings.FORUM_SCRIPT_ALIAS}}'
var osqaSkin = '{{settings.OSQA_SKIN}}';
+
+ var messages = {
+ username: '{{ user.username }}',
+ confirm: "{% trans "Are you sure?" %}",
+ yes: "{% trans "Yes" %}",
+ no: "{% trans "No" %}",
+ message: "{% trans "Message:" %}",
+ cancel: "{% trans "Cancel" %}",
+ close: "{% trans "Close" %}",
+ ok: "{% trans "Ok" %}"
+ }
/* ]] */
</script>
- <script type='text/javascript' src='{% media "/media/js/osqa.main.min.js" %}'></script>
+ <script type='text/javascript' src='{% media "/media/js/osqa.main.js" %}'></script>
{% if user_messages %}
<style type="text/css">
body { margin-top:2.4em; }
</style>
<script type="text/javascript">
$(document).ready(function() {
- var element = $('#validate_email_alert')
- element.click(function(){notify.close(true);setTimeout(function(){},1000)})
+ var element = $('#validate_email_alert');
+ element.click(function(){notify.close(true);})
notify.show();
});
</script>
{% endif %}
-
- {% block forejs %}
- {% endblock %}
+ {% block forejs %}{% endblock %}
+ <link rel="search" type="application/opensearchdescription+xml" href="{% url opensearch %}" title="{{ settings.APP_SHORT_NAME }} Search" />
</head>
<body>
<div class="notify" style="display:none">
<a id="close-notify" onclick="notify.close(true)">×</a>
</div>
{% include "header.html" %}
+ {% block page_center %}
<div id="wrapper">
<div id="room">
<div id="CAFull">
</div>
<div class="spacer3"></div>
</div>
+ {% endblock %}
{% include "footer.html" %}
{% block endjs %}
{% endblock %}
+ {% if settings.GOOGLE_ANALYTICS_KEY %}
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', '{{ settings.GOOGLE_ANALYTICS_KEY }}']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+ {% endif %}
</body>
</html>
<!-- end template base_content.html -->
<div class="comment-form-buttons">\r
<span id="comment-{{ post.id }}-chars-left" class="comment-chars-left">\r
<span class="comments-char-left-count">{{ min_length }}|{{ max_length }}</span>\r
- <span class="comments-chars-togo-msg">{% trans "characters to go" %}</span>\r
+ <span class="comments-chars-togo-msg">{% trans "characters needed" %}</span>\r
<span class="comments-chars-left-msg">{% trans "characters left" %}</span>\r
</span>\r
<input type="submit" class="comment-submit" value="{% trans " comment" %}" />\r
<option value="{{ type }}">{{ type }}</option>\r
{% endfor %}\r
</select>\r
- <textarea>{{ types|first }}</textarea>\r
- <div class="prompt-buttons">\r
- <button class="prompt-cancel">{% trans "Cancel" %}</button><button class="prompt-submit">{% trans "Send" %}</button>\r
- </div>\r
+ <textarea class="prompt-return">{{ types|first }}</textarea>\r
</div>\r
<script>\r
$('.user-prompt .prompt-examples').change(function() {\r
{% endblock %}
{% block forejs %}
{% if request.user.is_superuser or request.user == view_user %}
- <script type='text/javascript' src='{% media "/media/js/jquery.form.js" %}'></script>
<script type="text/javascript">google.load("jquery", "1.4.2");google.load("jqueryui", "1.8.1");</script>
<script src="{% media "/media/js/osqa.user.js" %}" type="text/javascript"></script>
{% load i18n %}\r
{% load smart_if %}\r
\r
-<script type="text/javascript">\r
-var messages = {\r
- username: '{{ user.username }}}',\r
- confirm: "{% trans "Are you sure?" %}",\r
- yes: "{% trans "Yes" %}",\r
- no: "{% trans "No" %}",\r
- points: "{% trans "Points to award:" %}",\r
- message: "{% trans "Message:" %}",\r
- award: "{% trans "Award" %}",\r
- cancel: "{% trans "Cancel" %}"\r
-}\r
-</script>\r
-\r
<div id="user-menu-container">\r
<span id="user-menu">{% trans "User tools" %} ▼</span>\r
<ul id="user-menu-dropdown">\r