From e9b89aa46f8ea267efda095f406755c0d2a1edd5 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 15 Apr 2012 10:58:01 -0500 Subject: added "meta" class to the customized versions of the meta pages --- askbot/views/meta.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/askbot/views/meta.py b/askbot/views/meta.py index b2f09cf4..73cb494f 100644 --- a/askbot/views/meta.py +++ b/askbot/views/meta.py @@ -37,6 +37,7 @@ def about(request, template='about.html'): title = _('About %(site)s') % {'site': askbot_settings.APP_SHORT_NAME} data = { 'title': title, + 'page_class': 'meta', 'content': askbot_settings.FORUM_ABOUT } return render_into_skin('static_page.html', data, request) @@ -56,9 +57,14 @@ def help(request): def faq(request): if askbot_settings.FORUM_FAQ.strip() != '': + data = { + 'title': _('FAQ'), + 'content': askbot_settings.FORUM_FAQ, + 'page_class': 'meta', + } return render_into_skin( 'static_page.html', - {'title': _('FAQ'), 'content': askbot_settings.FORUM_FAQ}, + data, request ) else: @@ -98,6 +104,7 @@ feedback.CANCEL_MESSAGE=_('We look forward to hearing your feedback! Please, giv def privacy(request): data = { 'title': _('Privacy policy'), + 'page_class': 'meta', 'content': askbot_settings.FORUM_PRIVACY } return render_into_skin('static_page.html', data, request) -- cgit v1.2.3-1-g7c22 From bb1a73f353ddfc15b31ad78e4778bd9bdc3abd22 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 15 Apr 2012 11:02:50 -0500 Subject: changed the expander arrow style in the post revision page --- askbot/skins/default/templates/revisions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/skins/default/templates/revisions.html b/askbot/skins/default/templates/revisions.html index 07b98b5b..fd7dbf0c 100644 --- a/askbot/skins/default/templates/revisions.html +++ b/askbot/skins/default/templates/revisions.html @@ -19,7 +19,7 @@ {% trans %}click to hide/show revision{% endtrans %} -- cgit v1.2.3-1-g7c22 From c4b1d9152ecd66fdc89be21a819f70633235f551 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 15 Apr 2012 15:56:10 -0500 Subject: removed empty box on the registration page when login buttons are disabled --- askbot/auth.py | 42 +++++++----- askbot/skins/common/media/jquery-openid/openid.css | 3 +- .../templates/authopenid/authopenid_macros.html | 77 ++++++++++++---------- .../skins/common/templates/authopenid/signin.html | 17 +++-- 4 files changed, 84 insertions(+), 55 deletions(-) diff --git a/askbot/auth.py b/askbot/auth.py index 5c0f7bd9..eba24c80 100644 --- a/askbot/auth.py +++ b/askbot/auth.py @@ -199,6 +199,11 @@ def onAnswerAccept(answer, user, timestamp=None): reputation=answer.author.reputation) reputation.save() + if answer.author == question.author and user == question.author: + #a plug to prevent reputation gaming by posting a question + #then answering and accepting as best all by the same person + return + user.receive_reputation(askbot_settings.REP_GAIN_FOR_ACCEPTING_ANSWER) user.save() reputation = Repute(user=user, @@ -214,24 +219,29 @@ def onAnswerAcceptCanceled(answer, user, timestamp=None): if timestamp is None: timestamp = datetime.datetime.now() answer.thread.set_accepted_answer(answer=None, timestamp=None) - - answer.author.receive_reputation( - askbot_settings.REP_LOSS_FOR_RECEIVING_CANCELATION_OF_ANSWER_ACCEPTANCE - ) - answer.author.save() - question = answer.thread._question_post() - reputation = Repute( - user=answer.author, - negative=\ - askbot_settings.REP_LOSS_FOR_RECEIVING_CANCELATION_OF_ANSWER_ACCEPTANCE, - question=question, - reputed_at=timestamp, - reputation_type=-2, - reputation=answer.author.reputation - ) - reputation.save() + if user != answer.author: + answer.author.receive_reputation( + askbot_settings.REP_LOSS_FOR_RECEIVING_CANCELATION_OF_ANSWER_ACCEPTANCE + ) + answer.author.save() + reputation = Repute( + user=answer.author, + negative=\ + askbot_settings.REP_LOSS_FOR_RECEIVING_CANCELATION_OF_ANSWER_ACCEPTANCE, + question=question, + reputed_at=timestamp, + reputation_type=-2, + reputation=answer.author.reputation + ) + reputation.save() + + if answer.author == question.author and user == question.author: + #a symmettric measure for the reputation gaming plug + #as in the onAnswerAccept function + #here it protects the user from uwanted reputation loss + return user.receive_reputation( askbot_settings.REP_LOSS_FOR_CANCELING_ANSWER_ACCEPTANCE diff --git a/askbot/skins/common/media/jquery-openid/openid.css b/askbot/skins/common/media/jquery-openid/openid.css index 00287224..f9430108 100644 --- a/askbot/skins/common/media/jquery-openid/openid.css +++ b/askbot/skins/common/media/jquery-openid/openid.css @@ -1,7 +1,8 @@ -div#login-icons {margin:10px 0 0 0;padding:10px;border:#eee 1px solid;} +div#login-icons {padding:20px 0 0 0;} ul.login-icons {width: 450px; margin:0;padding:0;text-align:left; list-style-type:none; display:block;} ul.login-icons li {display:inline;} ul.large input {height: 40px; width: 90px;border:1px solid #ccc;margin:0 5px 5px 0;} +.openid-signin h1 {margin-top: -15px; padding-bottom: 10px;} .openid-signin h2 {margin-top:15px;} .openid-signin h2#account-recovery-heading {margin-bottom:2px;} #account-recovery-form p.hint a {color:#1b79bd; text-decoration: none;} diff --git a/askbot/skins/common/templates/authopenid/authopenid_macros.html b/askbot/skins/common/templates/authopenid/authopenid_macros.html index 477d277c..9d35ac6f 100644 --- a/askbot/skins/common/templates/authopenid/authopenid_macros.html +++ b/askbot/skins/common/templates/authopenid/authopenid_macros.html @@ -15,44 +15,55 @@ minor_login_providers = None, hide_local_login = False, settings = None, - logged_in = False + logged_in = False, + show_buttons = True ) %} -
- + {% endif %} +
+ + {% endif %} {% endmacro %} diff --git a/askbot/skins/common/templates/authopenid/signin.html b/askbot/skins/common/templates/authopenid/signin.html index f4bf82c9..e849db20 100644 --- a/askbot/skins/common/templates/authopenid/signin.html +++ b/askbot/skins/common/templates/authopenid/signin.html @@ -25,7 +25,7 @@ {% endif %}

{% if view_subtype == 'default' and have_buttons %} - {% trans %}Take a pick of your favorite service below to sign in using secure OpenID or similar technology. Your external service password always stays confidential and you don't have to rememeber or create another one.{% endtrans %} + {% trans %}Choose your favorite service below to sign in using secure OpenID or similar technology. Your external service password always stays confidential and you don't have to rememeber or create another one.{% endtrans %} {% elif view_subtype == 'add_openid' and have_buttons %} {% if existing_login_methods %} {% trans %}It's a good idea to make sure that your existing login methods still work, or add a new one. Please click any of the icons below to check/change or add new login methods.{% endtrans %} @@ -61,7 +61,8 @@ minor_login_providers = minor_login_providers, hide_local_login = settings.SIGNIN_ALWAYS_SHOW_LOCAL_LOGIN, settings = settings, - logged_in = user.is_authenticated() + logged_in = user.is_authenticated(), + show_buttons = have_buttons ) }} {% if use_password_login == True %} @@ -83,9 +84,15 @@ > {{login_form.password_action}} {% if user.is_anonymous() %} -

- {% trans %}Please enter your user name and password, then sign in{% endtrans %} -

+ {% if have_buttons %} +

+ {% trans %}or enter your user name and password, then sign in{% endtrans %} +

+ {% else %} +

+ {% trans %}Please, sign in{% endtrans %} +

+ {% endif %} {% if have_buttons %}

{% trans %}(or select another login method above){% endtrans %}

{% endif %} -- cgit v1.2.3-1-g7c22 From d82b8b2cd182a83cbcc12ec12612495c2e531019 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 15 Apr 2012 17:08:15 -0500 Subject: added required setting RECAPTCHA_USE_SSL = True --- askbot/setup_templates/settings.py | 2 ++ askbot/setup_templates/settings.py.mustache | 2 ++ askbot/startup_procedures.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index b1d7dd06..f9920bca 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -226,3 +226,5 @@ CSRF_COOKIE_NAME = 'askbot_csrf' #CSRF_COOKIE_DOMAIN = '' STATICFILES_DIRS = ( os.path.join(ASKBOT_ROOT, 'skins'),) + +RECAPTCHA_USE_SSL = True diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index 855e6294..e39231f0 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -227,3 +227,5 @@ CSRF_COOKIE_NAME = '{{domain_name}}_csrf' STATIC_ROOT = os.path.join(PROJECT_ROOT, "static") STATICFILES_DIRS = (os.path.join(ASKBOT_ROOT, 'skins'),) + +RECAPTCHA_USE_SSL = True diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py index b4b36e35..e890fb89 100644 --- a/askbot/startup_procedures.py +++ b/askbot/startup_procedures.py @@ -508,6 +508,10 @@ def run_startup_tests(): 'test_for_absence': True, 'message': 'Please replace setting ASKBOT_UPLOADED_FILES_URL ', 'replace_hint': "with MEDIA_URL = '/%s'" + }, + 'RECAPTCHA_USE_SSL': { + 'value': True, + 'message': 'Please add: RECAPTCHA_USE_SSL = True' } }) settings_tester.run() -- cgit v1.2.3-1-g7c22 From 0cc46ac6698f1ae73d31400e2787ea0940b6abec Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 15 Apr 2012 18:59:53 -0500 Subject: fixed urls from the tag cloud --- askbot/search/state_manager.py | 5 +++++ askbot/skins/common/templates/widgets/related_tags.html | 8 +++++++- askbot/skins/default/templates/macros.html | 8 ++++++-- askbot/skins/default/templates/tags.html | 2 +- askbot/views/readers.py | 3 ++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/askbot/search/state_manager.py b/askbot/search/state_manager.py index ee46501e..8096cbdd 100644 --- a/askbot/search/state_manager.py +++ b/askbot/search/state_manager.py @@ -241,8 +241,13 @@ class SearchState(object): class DummySearchState(object): # Used for caching question/thread summaries + def add_tag(self, tag): self.tag = tag return self + + def change_scope(self, new_scope): + return self + def full_url(self): return '<<<%s>>>' % self.tag diff --git a/askbot/skins/common/templates/widgets/related_tags.html b/askbot/skins/common/templates/widgets/related_tags.html index 39873437..05520998 100644 --- a/askbot/skins/common/templates/widgets/related_tags.html +++ b/askbot/skins/common/templates/widgets/related_tags.html @@ -16,7 +16,13 @@ {% endfor %} {% else %} - {{ macros.tag_cloud(tags = tags, font_sizes = font_size) }} + {{ + macros.tag_cloud( + tags = tags, + font_sizes = font_size, + search_state = search_state + ) + }} {% endif %} {% endcache %} diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index 20e2055c..1c6b925c 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -137,10 +137,14 @@ poor design of the data or methods on data objects #} {%- endif -%} {%- endmacro -%} -{%- macro tag_cloud(tags = None, font_sizes = None) -%} +{%- macro tag_cloud(tags = None, font_sizes = None, search_state = None) -%} {% for tag in tags %} - {{ tag.name }} + {{ tag.name }} {% endfor %} {%- endmacro -%} diff --git a/askbot/skins/default/templates/tags.html b/askbot/skins/default/templates/tags.html index 0f0c1fc6..2bd4b2ec 100644 --- a/askbot/skins/default/templates/tags.html +++ b/askbot/skins/default/templates/tags.html @@ -55,7 +55,7 @@ {% if not tags %} {% trans %}Nothing found{% endtrans %} {% endif %} - {{ macros.tag_cloud(tags = tags, font_sizes = font_size) }} + {{ macros.tag_cloud(tags = tags, font_sizes = font_size, search_state = search_state) }} {% endif %} {% endblock %} diff --git a/askbot/views/readers.py b/askbot/views/readers.py index 7886439c..2a81f5c2 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -34,7 +34,7 @@ from askbot.models.tag import Tag from askbot import const from askbot.utils import functions from askbot.utils.decorators import anonymous_forbidden, ajax_only, get_only -from askbot.search.state_manager import SearchState +from askbot.search.state_manager import SearchState, DummySearchState from askbot.templatetags import extra_tags import askbot.conf from askbot.conf import settings as askbot_settings @@ -295,6 +295,7 @@ def tags(request):#view showing a listing of available tags - plain list 'stag' : stag, 'tab_id' : sortby, 'keywords' : stag, + 'search_state': SearchState(*[None for x in range(7)]) } return render_into_skin('tags.html', data, request) -- cgit v1.2.3-1-g7c22