From 3431a38f59499008143baca5490f0c1871027b95 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Mon, 3 Oct 2011 11:35:45 -0300 Subject: Fixed issue 96: Add possibility to pre-populate tags when asking question via url parameters. --- askbot/views/writers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/askbot/views/writers.py b/askbot/views/writers.py index fcc98761..2e783da1 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -267,6 +267,17 @@ def ask(request):#view used to ask a new question query = search_state.query form.initial['title'] = query + if 'tags' in request.GET: + #pre-populate tags. + clean_tags = request.GET['tags'].replace(',', ' ') + form.initial['tags'] = clean_tags + else: + #attemp to get tags from search state + search_state = request.session.get('search_state', None) + if search_state.tags: + tags = ' '.join(search_state.tags) + form.initial['tags'] = tags + data = { 'active_tab': 'ask', 'page_class': 'ask-page', -- cgit v1.2.3-1-g7c22 From 91befc92662173d24c64680328e34379268ee7b7 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Mon, 3 Oct 2011 12:52:06 -0300 Subject: Fixes issue 80: make answering own questions harder. --- askbot/skins/default/templates/question.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index 06cd1332..c9d0f61b 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -380,6 +380,9 @@ {% endif %} {% endif %} + {% if request.user == question.author %} + + {%endif%} {% endblock %} {% block sidebar %} @@ -529,6 +532,14 @@ $('#fmanswer textarea').focus(); } {% if settings.ENABLE_SHARING_GOOGLE %}$.getScript("http://apis.google.com/js/plusone.js"){% endif %} + + {% if request.user == question.author%} + $("#fmanswer").hide(); + $("#fmanswer_button").click(function() { + $("#fmanswer").show(); + $("#fmanswer_button").hide(); + }); + {%endif%} }); function initEditor(){ -- cgit v1.2.3-1-g7c22 From 322538fe62637fdf1d84b776fbc0f72636e69b6f Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Mon, 3 Oct 2011 13:24:22 -0300 Subject: Fixes: Tool tip to sort people in "people" page doesn't add much value http://askbot.org/en/question/662 --- askbot/skins/default/templates/users.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/askbot/skins/default/templates/users.html b/askbot/skins/default/templates/users.html index 750b3abb..3c9a7686 100644 --- a/askbot/skins/default/templates/users.html +++ b/askbot/skins/default/templates/users.html @@ -10,25 +10,25 @@ id="sort_reputation" href="{% url users %}?sort=reputation" {% if tab_id == 'reputation' %}class="on"{% endif %} - title="{% trans %}reputation{% endtrans %}" + title="{% trans %}People sorted by reputation{% endtrans %}" >{% trans %}reputation{% endtrans %} {% trans %}recent{% endtrans %} {% trans %}oldest{% endtrans %} {% trans %}by username{% endtrans %} -- cgit v1.2.3-1-g7c22 From 84e75d33a89b34b666abc52dfc1e51f16f82e082 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Tue, 4 Oct 2011 10:33:40 -0300 Subject: Fixes: feature 99. Added bootstrap mode --- askbot/conf/__init__.py | 1 + askbot/conf/site_modes.py | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 askbot/conf/site_modes.py diff --git a/askbot/conf/__init__.py b/askbot/conf/__init__.py index 1d2d7240..64fe41fb 100644 --- a/askbot/conf/__init__.py +++ b/askbot/conf/__init__.py @@ -19,6 +19,7 @@ import askbot.conf.markup import askbot.conf.social_sharing import askbot.conf.badges import askbot.conf.login_providers +import askbot.conf.site_modes #import main settings object from askbot.conf.settings_wrapper import settings diff --git a/askbot/conf/site_modes.py b/askbot/conf/site_modes.py new file mode 100644 index 00000000..73487cd8 --- /dev/null +++ b/askbot/conf/site_modes.py @@ -0,0 +1,67 @@ +""" +Site modes settings: + Support for site modes currently supports + Bootstrap - for sites that are starting and + Default - for sites that already have a momentum. +""" +from askbot.conf.settings_wrapper import settings +from askbot.deps.livesettings import ConfigurationGroup, BooleanValue +from django.utils.translation import ugettext as _ +from askbot.conf import badges, minimum_reputation + +def bootstrap_callback(current_value, new_value): + '''Callback to update settings''' + + if new_value == True: + #minimum reputation settgins. + settings.update('MIN_REP_TO_VOTE_UP', 5) + settings.update('MIN_REP_TO_VOTE_DOWN', 50) + settings.update('MIN_REP_TO_ANSWER_OWN_QUESTION', 5) + settings.update('MIN_REP_TO_ACCEPT_OWN_ANSWER', 20) + settings.update('MIN_REP_TO_FLAG_OFFENSIVE', 5) + settings.update('MIN_REP_TO_LEAVE_COMMENTS', 10) + settings.update('MIN_REP_TO_DELETE_OTHERS_COMMENTS', 200) + settings.update('MIN_REP_TO_DELETE_OTHERS_POSTS', 500) + settings.update('MIN_REP_TO_UPLOAD_FILES', 10) + settings.update('MIN_REP_TO_CLOSE_OWN_QUESTIONS', 25) + settings.update('MIN_REP_TO_RETAG_OTHERS_QUESTIONS', 50) + settings.update('MIN_REP_TO_REOPEN_OWN_QUESTIONS', 50) + settings.update('MIN_REP_TO_EDIT_WIKI', 75) + settings.update('MIN_REP_TO_EDIT_OTHERS_POSTS', 200) + settings.update('MIN_REP_TO_VIEW_OFFENSIVE_FLAGS', 200) + settings.update('MIN_REP_TO_CLOSE_OTHERS_QUESTIONS', 200) + settings.update('MIN_REP_TO_LOCK_POSTS', 400) + settings.update('MIN_REP_TO_HAVE_STRONG_URL', 25) + #badge settings + settings.update('NOTABLE_QUESTION_BADGE_MIN_VIEWS', 25) + settings.update('POPULAR_QUESTION_BADGE_MIN_VIEWS', 15) + settings.update('FAMOUS_QUESTION_BADGE_MIN_VIEWS', 50) + settings.update('ENTHUSIAST_BADGE_MIN_DAYS', 5) + settings.update('TAXONOMIST_BADGE_MIN_USE_COUNT', 5) + else: + for key in badges.BADGES.keys(): + default_value = badges.BADGES[key].default + settings.update(key, default_value) + + for key in minimum_reputation.MIN_REP.keys(): + default_value = minimum_reputation.MIN_REP[key].default + settings.update(key, default_value) + + return new_value + + +SITE_MODES = ConfigurationGroup( + 'SITE_MODES', + _('Reputation & limits mode'), + ) + +settings.register( + BooleanValue( + SITE_MODES, + 'ACTIVATE_BOOTSTRAP_MODE', + default=False, + description=_('Check this value to activate a special "Bootstrap" mode'), + help_text=_("WARNING: your current value for Minimum reputation and Bagde Settings will be changed after you save.."), + update_callback = bootstrap_callback + ) +) -- cgit v1.2.3-1-g7c22 From e8604ae446e1fc2b2add854916b6885574c70836 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Tue, 4 Oct 2011 15:16:02 -0300 Subject: do not overwrite settings in case that the value havent changed --- askbot/conf/site_modes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/askbot/conf/site_modes.py b/askbot/conf/site_modes.py index 73487cd8..45aaec90 100644 --- a/askbot/conf/site_modes.py +++ b/askbot/conf/site_modes.py @@ -12,6 +12,11 @@ from askbot.conf import badges, minimum_reputation def bootstrap_callback(current_value, new_value): '''Callback to update settings''' + if current_value == new_value: + #do not overwrite settings in case that tha value + #is the same + return new_value + if new_value == True: #minimum reputation settgins. settings.update('MIN_REP_TO_VOTE_UP', 5) -- cgit v1.2.3-1-g7c22 From f588f303470aa0a899b6df18d459aa7c3d7479dd Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Wed, 5 Oct 2011 10:11:16 -0300 Subject: fixed: moderation tab is misaligned --- askbot/skins/default/media/style/style.css | 1 + 1 file changed, 1 insertion(+) diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index 478f5116..6297721b 100644 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -887,6 +887,7 @@ a:hover.medal { margin: 5px 0 0 4px; padding: 0 2px; text-decoration: none; + font-size: 12.5px; } .tabsA .label, .tabsC .label { -- cgit v1.2.3-1-g7c22 From b857aae15a810e4b1c87e3d7272a03ed8120ebfa Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Oct 2011 11:40:01 -0300 Subject: small changes to the bugfix branch --- askbot/skins/default/templates/question.html | 18 +++++++++++------- askbot/skins/default/templates/users.html | 8 ++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/askbot/skins/default/templates/question.html b/askbot/skins/default/templates/question.html index dce91566..ae003ef4 100644 --- a/askbot/skins/default/templates/question.html +++ b/askbot/skins/default/templates/question.html @@ -305,7 +305,12 @@ {% trans %}email{% endtrans %}. {% endif %} -
{% csrf_token %} +{% csrf_token %} {% if request.user.is_authenticated() %}

{{ answer.email_notify }} @@ -539,12 +544,11 @@ } {% if settings.ENABLE_SHARING_GOOGLE %}$.getScript("http://apis.google.com/js/plusone.js"){% endif %} - {% if request.user == question.author%} - $("#fmanswer").hide(); - $("#fmanswer_button").click(function() { - $("#fmanswer").show(); - $("#fmanswer_button").hide(); - }); + {% if request.user == question.author %} + $("#fmanswer_button").click(function() { + $("#fmanswer").show(); + $("#fmanswer_button").hide(); + }); {%endif%} }); diff --git a/askbot/skins/default/templates/users.html b/askbot/skins/default/templates/users.html index 3c9a7686..1d7d02dd 100644 --- a/askbot/skins/default/templates/users.html +++ b/askbot/skins/default/templates/users.html @@ -10,25 +10,25 @@ id="sort_reputation" href="{% url users %}?sort=reputation" {% if tab_id == 'reputation' %}class="on"{% endif %} - title="{% trans %}People sorted by reputation{% endtrans %}" + title="{% trans %}see people with the highest reputation{% endtrans %}" >{% trans %}reputation{% endtrans %} {% trans %}recent{% endtrans %} {% trans %}oldest{% endtrans %} {% trans %}by username{% endtrans %} -- cgit v1.2.3-1-g7c22 From b8d9d95c7b244a2584be3abdf542d744e84a6926 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Oct 2011 11:48:18 -0300 Subject: updated changelog --- askbot/doc/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index 77ff4a45..dd1488a0 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -4,6 +4,8 @@ Changes in Askbot Development version (Not yet released) -------------------------------------- * RSS feed for individual question (Sayan Chowdhury) +* Allow pre-population of tags via ask a questios link (Adolfo) +* Make answering own question one click harder (Adolfo) 0.7.24 (Current Version) ------------------------ -- cgit v1.2.3-1-g7c22 From 9e006ba11567b8860929436cdbf1394e4274f902 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Oct 2011 13:02:42 -0300 Subject: some changes to the bootstrap mode feature --- askbot/conf/settings_wrapper.py | 8 ++++ askbot/conf/site_modes.py | 85 ++++++++++++++++++++++++----------------- askbot/doc/source/changelog.rst | 3 +- 3 files changed, 59 insertions(+), 37 deletions(-) diff --git a/askbot/conf/settings_wrapper.py b/askbot/conf/settings_wrapper.py index aac8f071..2e0d8db2 100644 --- a/askbot/conf/settings_wrapper.py +++ b/askbot/conf/settings_wrapper.py @@ -49,6 +49,14 @@ class ConfigSettings(object): """ return getattr(self.__instance, key).value + def get_default(self, key): + """return the defalut value for the setting""" + return getattr(self.__instance, key).default + + def reset(self, key): + """returns setting to the default value""" + self.update(key, self.get_default(key)) + def update(self, key, value): setting = config_get(self.__group_map[key], key) setting.update(value) diff --git a/askbot/conf/site_modes.py b/askbot/conf/site_modes.py index 45aaec90..e79169e7 100644 --- a/askbot/conf/site_modes.py +++ b/askbot/conf/site_modes.py @@ -7,7 +7,37 @@ Site modes settings: from askbot.conf.settings_wrapper import settings from askbot.deps.livesettings import ConfigurationGroup, BooleanValue from django.utils.translation import ugettext as _ -from askbot.conf import badges, minimum_reputation + +BOOTSTRAP_MODE_SETTINGS = { + #minimum reputation settins. + 'MIN_REP_TO_VOTE_UP': 5, + 'MIN_REP_TO_VOTE_DOWN': 50, + 'MIN_REP_TO_ANSWER_OWN_QUESTION': 5, + 'MIN_REP_TO_ACCEPT_OWN_ANSWER': 20, + 'MIN_REP_TO_FLAG_OFFENSIVE': 5, + 'MIN_REP_TO_LEAVE_COMMENTS': 10, + 'MIN_REP_TO_DELETE_OTHERS_COMMENTS': 200, + 'MIN_REP_TO_DELETE_OTHERS_POSTS': 500, + 'MIN_REP_TO_UPLOAD_FILES': 10, + 'MIN_REP_TO_CLOSE_OWN_QUESTIONS': 25, + 'MIN_REP_TO_RETAG_OTHERS_QUESTIONS': 50, + 'MIN_REP_TO_REOPEN_OWN_QUESTIONS': 50, + 'MIN_REP_TO_EDIT_WIKI': 75, + 'MIN_REP_TO_EDIT_OTHERS_POSTS': 200, + 'MIN_REP_TO_VIEW_OFFENSIVE_FLAGS': 200, + 'MIN_REP_TO_CLOSE_OTHERS_QUESTIONS': 200, + 'MIN_REP_TO_LOCK_POSTS': 400, + 'MIN_REP_TO_HAVE_STRONG_URL': 25, + #badge settings + 'NOTABLE_QUESTION_BADGE_MIN_VIEWS': 25, + 'POPULAR_QUESTION_BADGE_MIN_VIEWS': 15, + 'FAMOUS_QUESTION_BADGE_MIN_VIEWS': 50, + 'ENTHUSIAST_BADGE_MIN_DAYS': 5, + 'TAXONOMIST_BADGE_MIN_USE_COUNT': 5, + #moderation rule settings + 'MIN_FLAGS_TO_HIDE_POST': 2, + 'MIN_FLAGS_TO_DELETE_POST': 3, +} def bootstrap_callback(current_value, new_value): '''Callback to update settings''' @@ -18,46 +48,19 @@ def bootstrap_callback(current_value, new_value): return new_value if new_value == True: - #minimum reputation settgins. - settings.update('MIN_REP_TO_VOTE_UP', 5) - settings.update('MIN_REP_TO_VOTE_DOWN', 50) - settings.update('MIN_REP_TO_ANSWER_OWN_QUESTION', 5) - settings.update('MIN_REP_TO_ACCEPT_OWN_ANSWER', 20) - settings.update('MIN_REP_TO_FLAG_OFFENSIVE', 5) - settings.update('MIN_REP_TO_LEAVE_COMMENTS', 10) - settings.update('MIN_REP_TO_DELETE_OTHERS_COMMENTS', 200) - settings.update('MIN_REP_TO_DELETE_OTHERS_POSTS', 500) - settings.update('MIN_REP_TO_UPLOAD_FILES', 10) - settings.update('MIN_REP_TO_CLOSE_OWN_QUESTIONS', 25) - settings.update('MIN_REP_TO_RETAG_OTHERS_QUESTIONS', 50) - settings.update('MIN_REP_TO_REOPEN_OWN_QUESTIONS', 50) - settings.update('MIN_REP_TO_EDIT_WIKI', 75) - settings.update('MIN_REP_TO_EDIT_OTHERS_POSTS', 200) - settings.update('MIN_REP_TO_VIEW_OFFENSIVE_FLAGS', 200) - settings.update('MIN_REP_TO_CLOSE_OTHERS_QUESTIONS', 200) - settings.update('MIN_REP_TO_LOCK_POSTS', 400) - settings.update('MIN_REP_TO_HAVE_STRONG_URL', 25) - #badge settings - settings.update('NOTABLE_QUESTION_BADGE_MIN_VIEWS', 25) - settings.update('POPULAR_QUESTION_BADGE_MIN_VIEWS', 15) - settings.update('FAMOUS_QUESTION_BADGE_MIN_VIEWS', 50) - settings.update('ENTHUSIAST_BADGE_MIN_DAYS', 5) - settings.update('TAXONOMIST_BADGE_MIN_USE_COUNT', 5) - else: - for key in badges.BADGES.keys(): - default_value = badges.BADGES[key].default - settings.update(key, default_value) + for key, value in BOOTSTRAP_MODE_SETTINGS.items(): + settings.update(key, value) - for key in minimum_reputation.MIN_REP.keys(): - default_value = minimum_reputation.MIN_REP[key].default - settings.update(key, default_value) + else: + for key in BOOTSTRAP_MODE_SETTINGS: + settings.reset(key) return new_value SITE_MODES = ConfigurationGroup( 'SITE_MODES', - _('Reputation & limits mode'), + _('Site modes'), ) settings.register( @@ -65,8 +68,18 @@ settings.register( SITE_MODES, 'ACTIVATE_BOOTSTRAP_MODE', default=False, - description=_('Check this value to activate a special "Bootstrap" mode'), - help_text=_("WARNING: your current value for Minimum reputation and Bagde Settings will be changed after you save.."), + description=_( + 'Activate a "Bootstrap" mode'), + help_text=_( + "Bootstrap mode lowers reputation and certain badge " + "thresholds, to values, more suitable " + "for the smaller communities, " + "WARNING: your current value for " + "Minimum reputation, " + "Bagde Settings and " + "Vote Rules will " + "be changed after you modify this setting." + ), update_callback = bootstrap_callback ) ) diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index dd1488a0..0592cc54 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -4,8 +4,9 @@ Changes in Askbot Development version (Not yet released) -------------------------------------- * RSS feed for individual question (Sayan Chowdhury) -* Allow pre-population of tags via ask a questios link (Adolfo) +* Allow pre-population of tags via ask a questions link (Adolfo) * Make answering own question one click harder (Adolfo) +* Bootstrap mode (Adolfo, Evgeny) 0.7.24 (Current Version) ------------------------ -- cgit v1.2.3-1-g7c22 From 6f9e8eca777065cb737eb0027d1e609f0d0e46ef Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Oct 2011 17:25:45 -0300 Subject: bumped version to 0.7.25 due to a bug not entirely fixed by 0.7.24 --- askbot/__init__.py | 2 +- askbot/doc/source/changelog.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/askbot/__init__.py b/askbot/__init__.py index b4889f92..ef784c3b 100644 --- a/askbot/__init__.py +++ b/askbot/__init__.py @@ -9,7 +9,7 @@ import smtplib import sys import logging -VERSION = (0, 7, 24) +VERSION = (0, 7, 25) #necessary for interoperability of django and coffin try: diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index 0592cc54..d58b415f 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -1,15 +1,15 @@ Changes in Askbot ================= -Development version (Not yet released) --------------------------------------- +0.7.25 (Current Version) +------------------------ * RSS feed for individual question (Sayan Chowdhury) * Allow pre-population of tags via ask a questions link (Adolfo) * Make answering own question one click harder (Adolfo) * Bootstrap mode (Adolfo, Evgeny) -0.7.24 (Current Version) ------------------------- +0.7.24 +------ * Made it possible to disable the anonymous user greeting alltogether (Raghu Udiyar) * Added annotations for the meanings of user levels on the "moderation" page. (Jishnu) * Auto-link patterns - e.g. to bug databases - are configurable from settings. (Arun SAG) -- cgit v1.2.3-1-g7c22 From 115e4b6316c7821f03abf14211551ea0269ea2aa Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Oct 2011 17:32:13 -0300 Subject: added db to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 15b8d802..0375e009 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.pyc *.swp *.log +db cache/?? run *.wsgi -- cgit v1.2.3-1-g7c22