summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-10-08 10:08:44 +0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2014-10-08 10:08:44 +0400
commit9d0776744b90156bea1be3cd02dfe3c72e955bfd (patch)
tree85428eed85ccc46afed2a805902d52affa2a6f0f
parent70363cf4608506298f77d4ddf99c99896e53037f (diff)
parentbeb55428ac92c60655426461bbaa3c457b18c6b1 (diff)
downloadaskbot-9d0776744b90156bea1be3cd02dfe3c72e955bfd.tar.gz
askbot-9d0776744b90156bea1be3cd02dfe3c72e955bfd.tar.bz2
askbot-9d0776744b90156bea1be3cd02dfe3c72e955bfd.zip
Merge branch 'master' of github.com:ASKBOT/askbot-devel
-rw-r--r--askbot/deps/django_authopenid/models.py2
-rw-r--r--askbot/deps/django_authopenid/views.py1
-rw-r--r--askbot/models/repute.py2
-rw-r--r--askbot/models/widgets.py2
-rw-r--r--askbot/templates/question.html8
-rw-r--r--askbot/templates/question/answer_controls.html2
-rw-r--r--askbot/templates/question/question_controls.html2
-rw-r--r--askbot/tests/page_load_tests.py4
8 files changed, 12 insertions, 11 deletions
diff --git a/askbot/deps/django_authopenid/models.py b/askbot/deps/django_authopenid/models.py
index bc0e6ac4..b931f1e4 100644
--- a/askbot/deps/django_authopenid/models.py
+++ b/askbot/deps/django_authopenid/models.py
@@ -58,7 +58,7 @@ class UserAssociation(models.Model):
)
def __unicode__(self):
- return "Openid %s with user %s" % (self.openid_url, self.user)
+ return u"Openid %s with user %s" % (self.openid_url, self.user)
class UserPasswordQueueManager(models.Manager):
""" manager for UserPasswordQueue object """
diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py
index 1b3e5161..7acaa081 100644
--- a/askbot/deps/django_authopenid/views.py
+++ b/askbot/deps/django_authopenid/views.py
@@ -632,6 +632,7 @@ def signin(request, template_name='authopenid/signin.html'):
redirect_url = util.get_oauth2_starter_url(provider_name, csrf_token)
request.session['oauth2_csrf_token'] = csrf_token
request.session['provider_name'] = provider_name
+ request.session['next_url'] = next_url
return HttpResponseRedirect(redirect_url)
except util.OAuthError, e:
logging.critical(unicode(e))
diff --git a/askbot/models/repute.py b/askbot/models/repute.py
index 515356f0..f2996aa7 100644
--- a/askbot/models/repute.py
+++ b/askbot/models/repute.py
@@ -50,7 +50,7 @@ class Vote(models.Model):
db_table = u'vote'
def __unicode__(self):
- return '[%s] voted at %s: %s' %(self.user, self.voted_at, self.vote)
+ return u'[%s] voted at %s: %s' %(self.user, self.voted_at, self.vote)
def __int__(self):
"""1 if upvote -1 if downvote"""
diff --git a/askbot/models/widgets.py b/askbot/models/widgets.py
index bdec5eb2..8d31a3ee 100644
--- a/askbot/models/widgets.py
+++ b/askbot/models/widgets.py
@@ -18,7 +18,7 @@ class AskWidget(models.Model):
app_label = 'askbot'
def __unicode__(self):
- return "Widget: %s" % self.title
+ return u"Widget: %s" % self.title
class QuestionWidget(models.Model):
diff --git a/askbot/templates/question.html b/askbot/templates/question.html
index 1557eb38..6d5df517 100644
--- a/askbot/templates/question.html
+++ b/askbot/templates/question.html
@@ -202,7 +202,7 @@
};
- function render_post_controls(post_id){
+ function render_post_controls(post_id, is_wiki){
//in this case remove all post controls
if (askbot['settings']['readOnlyModeEnabled'] === true) {
@@ -246,10 +246,10 @@
) {
removeNode(closeBtn[0]);
}
-
- var repLow = (data['userReputation'] < {{settings.MIN_REP_TO_EDIT_OTHERS_POSTS}});
+ var enoughRep = (data['userReputation'] >= {{settings.MIN_REP_TO_EDIT_OTHERS_POSTS}} ||
+ (is_wiki && data['userReputation'] >= {{ settings.MIN_REP_TO_EDIT_WIKI }}));
if (//maybe remove "edit" button
- repLow || data['userIsReadOnly']//only authors edit comments
+ !enoughRep || data['userIsReadOnly']//only authors edit comments
){
var edit_btn = document.getElementById(
'post-' + post_id + '-edit'
diff --git a/askbot/templates/question/answer_controls.html b/askbot/templates/question/answer_controls.html
index 022287a1..e4993c2b 100644
--- a/askbot/templates/question/answer_controls.html
+++ b/askbot/templates/question/answer_controls.html
@@ -93,5 +93,5 @@
<script type="text/javascript">
askbot['functions']['hideConvertAnswerLinks']('{{ answer.id }}');
askbot['functions']['hidePublishAnswerLink']('{{ answer.id }}');
- askbot['functions']['renderPostControls']('{{ answer.id }}');
+ askbot['functions']['renderPostControls']('{{ answer.id }}'{{ ', true' if answer.wiki }});
</script>
diff --git a/askbot/templates/question/question_controls.html b/askbot/templates/question/question_controls.html
index e38157c2..5ebb7a44 100644
--- a/askbot/templates/question/question_controls.html
+++ b/askbot/templates/question/question_controls.html
@@ -36,5 +36,5 @@
class="question-delete"
>{% if question.deleted %}{% trans %}undelete{% endtrans %}{% else %}{% trans %}delete{% endtrans %}{% endif %}</a>
<script type="text/javascript">
- askbot['functions']['renderPostControls']('{{question.id}}');
+ askbot['functions']['renderPostControls']('{{question.id}}'{{ ', true' if question.wiki }});
</script>
diff --git a/askbot/tests/page_load_tests.py b/askbot/tests/page_load_tests.py
index 9b16f58b..a0b2e2cc 100644
--- a/askbot/tests/page_load_tests.py
+++ b/askbot/tests/page_load_tests.py
@@ -774,7 +774,7 @@ class UserProfilePageTests(AskbotTestCase):
def setUp(self):
self.user = self.create_user('user')
- @with_settings(EDITABLE_EMAIL=False)
+ @with_settings(EDITABLE_EMAIL=False, EDITABLE_SCREEN_NAME=True)
def test_user_cannot_change_email(self):
#log in
self.client.login(user_id=self.user.id, method='force')
@@ -791,7 +791,7 @@ class UserProfilePageTests(AskbotTestCase):
self.assertEqual(user.username, 'edited')
self.assertEqual(user.email, email_before)
- @with_settings(EDITABLE_EMAIL=True)
+ @with_settings(EDITABLE_EMAIL=True, EDITABLE_SCREEN_NAME=True)
def test_user_can_change_email(self):
self.client.login(user_id=self.user.id, method='force')
email_before = self.user.email