From 012e6a275bc2ba50fae73dd4664054241d6dc7a8 Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Sat, 3 Nov 2012 03:31:07 -0400 Subject: Adds overflow:hidden to .box selector. Without it, the .box would not be as tall as its content. While that works fine for Askbot's default skin (boxes are white on a white background), it will fail on skins in which boxes have a border or a different background color. There's no reason not to fix this in the default skin. --- askbot/media/style/style.css | 1 + askbot/media/style/style.less | 1 + 2 files changed, 2 insertions(+) diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css index 79bc422b..dc4190b7 100644 --- a/askbot/media/style/style.css +++ b/askbot/media/style/style.css @@ -580,6 +580,7 @@ body.anon #searchBar .searchInputCancelable { background: #fff; padding: 4px 0px 10px 0px; width: 200px; + overflow: hidden; /* widgets for question template */ /* notify by email box */ diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less index 828bf996..1404b4c0 100644 --- a/askbot/media/style/style.less +++ b/askbot/media/style/style.less @@ -579,6 +579,7 @@ body.anon { background: #fff; padding: 4px 0px 10px 0px; width:200px; + overflow: hidden; p { margin-bottom: 4px; -- cgit v1.2.3-1-g7c22 From 5c97c839bec32595a1f633d38cfd5aa0d4f76eb2 Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Sat, 3 Nov 2012 03:52:47 -0400 Subject: Prevents sidebar footer from showing, if it's not defined. --- askbot/templates/question/sidebar.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/askbot/templates/question/sidebar.html b/askbot/templates/question/sidebar.html index 4d431ef2..b3c33709 100644 --- a/askbot/templates/question/sidebar.html +++ b/askbot/templates/question/sidebar.html @@ -171,6 +171,8 @@ {#% endcache %#} {% endif %} -
- {{ settings.SIDEBAR_QUESTION_FOOTER }} -
+{% if settings.SIDEBAR_QUESTION_FOOTER %} +
+ {{ settings.SIDEBAR_QUESTION_FOOTER }} +
+{% endif %} -- cgit v1.2.3-1-g7c22 From cab49ee6f0a896fe51d15a0af0978b340a3b03a8 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 24 Dec 2012 21:39:53 +0000 Subject: Add MySQL support for safe_add_column. --- askbot/migrations_api/__init__.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/askbot/migrations_api/__init__.py b/askbot/migrations_api/__init__.py index 0260f51b..3ea250f2 100644 --- a/askbot/migrations_api/__init__.py +++ b/askbot/migrations_api/__init__.py @@ -13,14 +13,19 @@ def safe_add_column(table, column, column_data, keep_default = False): so, we need to add these columns here in separate transactions and roll back if they fail, if we want we could also record - which columns clash """ - try: - db.start_transaction() - db.add_column(table, column, column_data, keep_default = keep_default) - db.commit_transaction() - return True - except: - db.rollback_transaction() - return False + if db.backend_name=='mysql': + if len(db.execute('select column_name from information_schema.columns where table_name=%s and column_name=%s', params=[table, column])) == 0: + db.add_column(table, column, column_data, keep_default = keep_default) + + else: + try: + db.start_transaction() + db.add_column(table, column, column_data, keep_default = keep_default) + db.commit_transaction() + return True + except: + db.rollback_transaction() + return False def mysql_table_supports_full_text_search(table_name): -- cgit v1.2.3-1-g7c22 From 13823c0ed6e0ec54e3068efa62b2fe889ef8d799 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 24 Dec 2012 21:39:27 +0000 Subject: Make column changes actually work with InnoDB --- askbot/migrations/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/askbot/migrations/__init__.py b/askbot/migrations/__init__.py index 86377b7b..b9683daf 100644 --- a/askbot/migrations/__init__.py +++ b/askbot/migrations/__init__.py @@ -1,5 +1,9 @@ from south.db import db from south.utils import ask_for_it_by_name +from south.v2 import SchemaMigration + +if not db.has_ddl_transactions: + SchemaMigration.no_dry_run = True # Terminal ANSI codes for printing colored text: # - http://code.google.com/p/testoob/source/browse/trunk/src/testoob/reporting/colored.py#20 @@ -67,3 +71,4 @@ def innodb_ready_rename_column(orm, models, table, old_column_name, new_column_n # INFO: ask_for_it_by_name() if equivalent to self.gf() which is usually used in migrations, e.g.: # db.alter_column('askbot_badgedata', 'slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)) db.alter_column(table, new_column_name, field) + db.clear_deferred_sql() -- cgit v1.2.3-1-g7c22 From 2f8e4244747948e6bf2fe967d326dfa2d6f6366c Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 24 Dec 2012 21:40:01 +0000 Subject: Fix fake migration errors so we can find the real ones. --- .../migrations/0013_add_response_count__to_user.py | 17 +++++------- .../0014_rename_schema_from_forum_to_askbot.py | 21 +++++++------- .../0018_add___status__field_to_user_model.py | 16 +++++------ ...026_add_seen_and_new_response_counts_to_user.py | 8 ++---- ..._consecutive_days_visit_count__to__auth_user.py | 16 +++++------ .../migrations/0035_add_country_fields_to_user.py | 8 ++---- .../0037_add_marked_tags_to_user_profile.py | 12 ++++---- .../migrations/0038_add_tag_filter_strategies.py | 32 ++++++++++------------ ..._add_temporal_extra_column_for_datamigration.py | 6 ++-- .../0122_auth_user__add_subscribed_tag_field.py | 8 ++---- ...private__add_field_replyaddress_reply_action.py | 15 +++++----- .../migrations/0125_add_show_tags_field_to_user.py | 18 ++++++------ .../0126_add_field__auth_user__is_fake.py | 11 +++----- 13 files changed, 83 insertions(+), 105 deletions(-) diff --git a/askbot/migrations/0013_add_response_count__to_user.py b/askbot/migrations/0013_add_response_count__to_user.py index f3d724e3..68ac0c3c 100644 --- a/askbot/migrations/0013_add_response_count__to_user.py +++ b/askbot/migrations/0013_add_response_count__to_user.py @@ -3,6 +3,7 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): @@ -13,16 +14,12 @@ class Migration(SchemaMigration): a bit hacky but we have to do it as long as we keep patching auth models within the forum application """ - try: - db.add_column( - u'auth_user', - 'response_count', - self.gf('django.db.models.fields.IntegerField')(default=0, ), - keep_default=False - ) - except: - print 'probably already have column User.response_count' - pass + safe_add_column( + u'auth_user', + 'response_count', + self.gf('django.db.models.fields.IntegerField')(default=0, ), + keep_default=False + ) def backwards(self, orm): diff --git a/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py b/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py index f5f913da..f9a5b739 100644 --- a/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py +++ b/askbot/migrations/0014_rename_schema_from_forum_to_askbot.py @@ -10,19 +10,20 @@ app_dir_name = os.path.basename(os.path.dirname(os.path.dirname(__file__))) class Migration(SchemaMigration): def forwards(self, orm): - try: - db.rename_table('forum_anonymousanswer', 'askbot_anonymousanswer') - db.rename_table('forum_anonymousquestion', 'askbot_anonymousquestion') - db.rename_table('forum_emailfeedsetting', 'askbot_emailfeedsetting') - db.rename_table('forum_markedtag', 'askbot_markedtag') - db.rename_table('forum_questionview', 'askbot_questionview') - db.rename_table('forum_validationhash', 'askbot_validationhash') - except: - pass + if app_dir_name == 'forum': + try: + db.rename_table('forum_anonymousanswer', 'askbot_anonymousanswer') + db.rename_table('forum_anonymousquestion', 'askbot_anonymousquestion') + db.rename_table('forum_emailfeedsetting', 'askbot_emailfeedsetting') + db.rename_table('forum_markedtag', 'askbot_markedtag') + db.rename_table('forum_questionview', 'askbot_questionview') + db.rename_table('forum_validationhash', 'askbot_validationhash') + except: + pass def backwards(self, orm): - if app_dirname == 'forum': + if app_dir_name == 'forum': db.rename_table('askbot_anonymousanswer', 'forum_anonymousanswer') db.rename_table('askbot_anonymousquestion', 'forum_anonymousquestion') db.rename_table('askbot_emailfeedsetting', 'forum_emailfeedsetting') diff --git a/askbot/migrations/0018_add___status__field_to_user_model.py b/askbot/migrations/0018_add___status__field_to_user_model.py index 5a713866..b30f30d7 100644 --- a/askbot/migrations/0018_add___status__field_to_user_model.py +++ b/askbot/migrations/0018_add___status__field_to_user_model.py @@ -3,21 +3,19 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'User.status' - try: - db.add_column( - u'auth_user', - 'status', - self.gf('django.db.models.fields.CharField')(default ='w', max_length = 2), - keep_default=False - ) - except: - pass + safe_add_column( + u'auth_user', + 'status', + self.gf('django.db.models.fields.CharField')(default ='w', max_length = 2), + keep_default=False + ) def backwards(self, orm): diff --git a/askbot/migrations/0026_add_seen_and_new_response_counts_to_user.py b/askbot/migrations/0026_add_seen_and_new_response_counts_to_user.py index 4cd05f83..8b6002bf 100644 --- a/askbot/migrations/0026_add_seen_and_new_response_counts_to_user.py +++ b/askbot/migrations/0026_add_seen_and_new_response_counts_to_user.py @@ -3,16 +3,14 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): # Adding fields - try: - db.add_column('auth_user', 'new_response_count', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False) - db.add_column('auth_user', 'seen_response_count', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False) - except: - pass + safe_add_column('auth_user', 'new_response_count', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False) + safe_add_column('auth_user', 'seen_response_count', self.gf('django.db.models.fields.IntegerField')(default=0), keep_default=False) def backwards(self, orm): # Deleting fields diff --git a/askbot/migrations/0033_add__consecutive_days_visit_count__to__auth_user.py b/askbot/migrations/0033_add__consecutive_days_visit_count__to__auth_user.py index 580c2f25..e5a10faf 100644 --- a/askbot/migrations/0033_add__consecutive_days_visit_count__to__auth_user.py +++ b/askbot/migrations/0033_add__consecutive_days_visit_count__to__auth_user.py @@ -3,21 +3,19 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'User.consecutive_days_visit_count' - try: - db.add_column( - u'auth_user', - 'consecutive_days_visit_count', - self.gf('django.db.models.fields.IntegerField')(default = 0, max_length = 2), - keep_default=False - ) - except: - pass + safe_add_column( + u'auth_user', + 'consecutive_days_visit_count', + self.gf('django.db.models.fields.IntegerField')(default = 0, max_length = 2), + keep_default=False + ) def backwards(self, orm): diff --git a/askbot/migrations/0035_add_country_fields_to_user.py b/askbot/migrations/0035_add_country_fields_to_user.py index 02dd404c..340883ba 100644 --- a/askbot/migrations/0035_add_country_fields_to_user.py +++ b/askbot/migrations/0035_add_country_fields_to_user.py @@ -3,17 +3,15 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): # Adding model country fields to the model auth_user - try: - db.add_column(u'auth_user', 'country', self.gf('django_countries.fields.CountryField')(max_length=2, blank=True, null=True)) - db.add_column(u'auth_user', 'show_country', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)) - except: - pass + safe_add_column(u'auth_user', 'country', self.gf('django_countries.fields.CountryField')(max_length=2, blank=True, null=True)) + safe_add_column(u'auth_user', 'show_country', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)) def backwards(self, orm): diff --git a/askbot/migrations/0037_add_marked_tags_to_user_profile.py b/askbot/migrations/0037_add_marked_tags_to_user_profile.py index f10f53be..306e16e6 100644 --- a/askbot/migrations/0037_add_marked_tags_to_user_profile.py +++ b/askbot/migrations/0037_add_marked_tags_to_user_profile.py @@ -3,18 +3,16 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): - try: - # Adding field 'User.interesting_tags' - db.add_column(u'auth_user', 'interesting_tags', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) - # Adding field 'User.ignored_tags' - db.add_column(u'auth_user', 'ignored_tags', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) - except: - pass + # Adding field 'User.interesting_tags' + safe_add_column(u'auth_user', 'interesting_tags', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) + # Adding field 'User.ignored_tags' + safe_add_column(u'auth_user', 'ignored_tags', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) def backwards(self, orm): diff --git a/askbot/migrations/0038_add_tag_filter_strategies.py b/askbot/migrations/0038_add_tag_filter_strategies.py index c2596366..a24d12bf 100644 --- a/askbot/migrations/0038_add_tag_filter_strategies.py +++ b/askbot/migrations/0038_add_tag_filter_strategies.py @@ -4,29 +4,27 @@ from south.db import db from south.v2 import SchemaMigration from django.db import models from askbot import const +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): # Adding model country fields to the model auth_user - try: - db.add_column( - u'auth_user', - 'email_tag_filter_strategy', - self.gf( - 'django.db.models.fields.SmallIntegerField' - )(default = const.EXCLUDE_IGNORED) - ) - db.add_column( - u'auth_user', - 'display_tag_filter_strategy', - self.gf( - 'django.db.models.fields.SmallIntegerField' - )(default = const.INCLUDE_ALL) - ) - except: - pass + safe_add_column( + u'auth_user', + 'email_tag_filter_strategy', + self.gf( + 'django.db.models.fields.SmallIntegerField' + )(default = const.EXCLUDE_IGNORED) + ) + safe_add_column( + u'auth_user', + 'display_tag_filter_strategy', + self.gf( + 'django.db.models.fields.SmallIntegerField' + )(default = const.INCLUDE_ALL) + ) def backwards(self, orm): diff --git a/askbot/migrations/0043_add_temporal_extra_column_for_datamigration.py b/askbot/migrations/0043_add_temporal_extra_column_for_datamigration.py index 4a8140a4..7582dc04 100644 --- a/askbot/migrations/0043_add_temporal_extra_column_for_datamigration.py +++ b/askbot/migrations/0043_add_temporal_extra_column_for_datamigration.py @@ -3,14 +3,12 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): - try: - db.add_column(u'auth_user', 'avatar_type', self.gf('django.db.models.fields.CharField')(max_length=1, default='n'), keep_default=False) - except: - pass + safe_add_column(u'auth_user', 'avatar_type', self.gf('django.db.models.fields.CharField')(max_length=1, default='n'), keep_default=False) def backwards(self, orm): db.delete_column(u'auth_user', 'avatar_type') diff --git a/askbot/migrations/0122_auth_user__add_subscribed_tag_field.py b/askbot/migrations/0122_auth_user__add_subscribed_tag_field.py index d84666fb..7f7ff971 100644 --- a/askbot/migrations/0122_auth_user__add_subscribed_tag_field.py +++ b/askbot/migrations/0122_auth_user__add_subscribed_tag_field.py @@ -3,15 +3,13 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): - try: - # Adding field 'User.interesting_tags' - db.add_column(u'auth_user', 'subscribed_tags', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) - except: - pass + # Adding field 'User.interesting_tags' + safe_add_column(u'auth_user', 'subscribed_tags', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) def backwards(self, orm): # Deleting field 'User.interesting_tags' diff --git a/askbot/migrations/0124_auto__add_field_post_is_private__add_field_replyaddress_reply_action.py b/askbot/migrations/0124_auto__add_field_post_is_private__add_field_replyaddress_reply_action.py index b5a1e0c9..11b891da 100644 --- a/askbot/migrations/0124_auto__add_field_post_is_private__add_field_replyaddress_reply_action.py +++ b/askbot/migrations/0124_auto__add_field_post_is_private__add_field_replyaddress_reply_action.py @@ -3,6 +3,7 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): @@ -10,14 +11,14 @@ class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Post.is_private' db.start_transaction() - db.add_column('askbot_post', 'is_private', - self.gf('django.db.models.fields.BooleanField')(default=False), - keep_default=False) + safe_add_column('askbot_post', 'is_private', + self.gf('django.db.models.fields.BooleanField')(default=False), + keep_default=False) # Adding field 'ReplyAddress.reply_action' - db.add_column('askbot_replyaddress', 'reply_action', - self.gf('django.db.models.fields.CharField')(default='auto_answer_or_comment', max_length=32), - keep_default=False) + safe_add_column('askbot_replyaddress', 'reply_action', + self.gf('django.db.models.fields.CharField')(default='auto_answer_or_comment', max_length=32), + keep_default=False) # Changing field 'ReplyAddress.post' db.alter_column('askbot_replyaddress', 'post_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['askbot.Post'])) @@ -26,7 +27,7 @@ class Migration(SchemaMigration): try: db.start_transaction() # Adding field 'User.interesting_tags' - db.add_column(u'auth_user', 'email_signature', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) + safe_add_column(u'auth_user', 'email_signature', self.gf('django.db.models.fields.TextField')(blank=True, default = ''), keep_default=False) db.commit_transaction() except: db.rollback_transaction() diff --git a/askbot/migrations/0125_add_show_tags_field_to_user.py b/askbot/migrations/0125_add_show_tags_field_to_user.py index cb7ab2bd..fc299d18 100644 --- a/askbot/migrations/0125_add_show_tags_field_to_user.py +++ b/askbot/migrations/0125_add_show_tags_field_to_user.py @@ -3,6 +3,7 @@ import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): @@ -10,16 +11,13 @@ class Migration(SchemaMigration): def forwards(self, orm): # Adding model show_marked_tags fields to the model auth_user - try: - db.add_column( - u'auth_user', - 'show_marked_tags', - self.gf( - 'django.db.models.fields.BooleanField' - )(default=True, blank=True) - ) - except: - pass + safe_add_column( + u'auth_user', + 'show_marked_tags', + self.gf( + 'django.db.models.fields.BooleanField' + )(default=True, blank=True) + ) def backwards(self, orm): diff --git a/askbot/migrations/0126_add_field__auth_user__is_fake.py b/askbot/migrations/0126_add_field__auth_user__is_fake.py index e0928ed7..783d1e27 100644 --- a/askbot/migrations/0126_add_field__auth_user__is_fake.py +++ b/askbot/migrations/0126_add_field__auth_user__is_fake.py @@ -1,17 +1,14 @@ # -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration +from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): - try: - # Adding field 'User.is_fake' - db.add_column( - u'auth_user', 'is_fake', - self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False) - except: - pass + safe_add_column( + u'auth_user', 'is_fake', + self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False) def backwards(self, orm): db.delete_column('auth_user', 'is_fake') -- cgit v1.2.3-1-g7c22 From 7ec5b334afd8eed9e625858140898fa387e29ac6 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Tue, 15 Jan 2013 09:52:06 -0600 Subject: added ASKBOT_MULTILINGUAL to settings.py template, tests fails if this is not present --- askbot/setup_templates/settings.py | 7 +++++++ askbot/setup_templates/settings.py.mustache | 2 ++ 2 files changed, 9 insertions(+) diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index 237a1280..f2a98559 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -273,3 +273,10 @@ TINYMCE_DEFAULT_CONFIG = { #delayed notifications, time in seconds, 15 mins by default NOTIFICATION_DELAY_TIME = 60 * 15 + +GROUP_MESSAGING = { + 'BASE_URL_GETTER_FUNCTION': 'askbot.models.user_get_profile_url', + 'BASE_URL_PARAMS': {'section': 'messages', 'sort': 'inbox'} +} + +ASKBOT_MULTILINGUAL = False diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index bd77e82e..76b40a6e 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -285,3 +285,5 @@ GROUP_MESSAGING = { 'BASE_URL_GETTER_FUNCTION': 'askbot.models.user_get_profile_url', 'BASE_URL_PARAMS': {'section': 'messages', 'sort': 'inbox'} } + +ASKBOT_MULTILINGUAL = False -- cgit v1.2.3-1-g7c22 From d8be2ffd9c9092108bb2918c816032771d2c0227 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Mon, 4 Feb 2013 09:17:30 -0600 Subject: fixed logging formating --- askbot/deps/django_authopenid/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index 8f33e8c0..9ddb6414 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -99,7 +99,7 @@ def create_authenticated_user_account( user = User.objects.create_user(username, email) user_registered.send(None, user=user) - logging.debug('creating new openid user association for %s') + logging.debug('creating new openid user association for %s', username) if password: user.set_password(password) -- cgit v1.2.3-1-g7c22 From 6869dd5a2fd5843fe461946ac681b41aa1bab19c Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Mon, 4 Feb 2013 16:56:58 -0600 Subject: wrapping migration 0161 in try/except because of auth_user table modification" --- askbot/migrations/0161_add_field__user_languages.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/askbot/migrations/0161_add_field__user_languages.py b/askbot/migrations/0161_add_field__user_languages.py index 4e8c351f..6ee907b8 100644 --- a/askbot/migrations/0161_add_field__user_languages.py +++ b/askbot/migrations/0161_add_field__user_languages.py @@ -9,9 +9,12 @@ class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Thread.language_code' - db.add_column('auth_user', 'languages', - self.gf('django.db.models.fields.CharField')(default='en', max_length=128), - keep_default=False) + try: + db.add_column('auth_user', 'languages', + self.gf('django.db.models.fields.CharField')(default='en', max_length=128), + keep_default=False) + except: + pass def backwards(self, orm): # Deleting field 'Thread.junk' -- cgit v1.2.3-1-g7c22 From 67a0165a5d4811648319cd5e8449baec1529e8dd Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Wed, 13 Feb 2013 16:11:11 -0600 Subject: fixed import-data url in urls.py --- askbot/urls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/urls.py b/askbot/urls.py index 86bb10a0..a82b4694 100644 --- a/askbot/urls.py +++ b/askbot/urls.py @@ -38,7 +38,7 @@ urlpatterns = patterns('', name='sitemap' ), #no translation for this url!! - url(r'import-data/$', views.writers.import_data, name='import_data'), + url(r'^import-data/$', views.writers.import_data, name='import_data'), url(r'^%s$' % _('about/'), views.meta.about, name='about'), url(r'^%s$' % _('faq/'), views.meta.faq, name='faq'), url(r'^%s$' % _('privacy/'), views.meta.privacy, name='privacy'), -- cgit v1.2.3-1-g7c22 From 028b94f1b95de8b64f296b15ba6ed6441e788466 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Thu, 14 Feb 2013 12:10:55 -0600 Subject: updated settings template and startup procedures to make tinymce work --- askbot/setup_templates/settings.py | 5 +++-- askbot/setup_templates/settings.py.mustache | 6 +++--- askbot/setup_templates/urls.py | 2 +- askbot/startup_procedures.py | 16 ++++++++-------- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index f2a98559..ebf76e14 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -244,11 +244,11 @@ HAYSTACK_SITECONF = 'askbot.search.haystack' #http://django-haystack.readthedocs.org/en/v1.2.7/settings.html HAYSTACK_SEARCH_ENGINE = 'simple' -TINYMCE_COMPRESSOR = True +TINYMCE_COMPRESSOR = False TINYMCE_SPELLCHECKER = False TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/') -TINYMCE_URL = STATIC_URL + 'default/media/js/tinymce/' +TINYMCE_JS_URL = STATIC_URL + 'default/media/js/tinymce/tiny_mce.js' TINYMCE_DEFAULT_CONFIG = { 'plugins': 'askbot_imageuploader,askbot_attachment', 'convert_urls': False, @@ -268,6 +268,7 @@ TINYMCE_DEFAULT_CONFIG = { 'theme_advanced_resizing': True, 'theme_advanced_resize_horizontal': False, 'theme_advanced_statusbar_location': 'bottom', + 'width': '730', 'height': '250' } diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index 76b40a6e..48d3dc6e 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -250,10 +250,10 @@ HAYSTACK_SITECONF = 'askbot.search.haystack' #http://django-haystack.readthedocs.org/en/v1.2.7/settings.html HAYSTACK_SEARCH_ENGINE = 'simple' -TINYMCE_COMPRESSOR = True +TINYMCE_COMPRESSOR = False TINYMCE_SPELLCHECKER = False TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/') -TINYMCE_URL = STATIC_URL + 'default/media/js/tinymce/' +TINYMCE_JS_URL = STATIC_URL + 'default/media/js/tinymce/tiny_mce.js' TINYMCE_DEFAULT_CONFIG = { 'plugins': 'askbot_imageuploader,askbot_attachment', 'convert_urls': False, @@ -274,7 +274,7 @@ TINYMCE_DEFAULT_CONFIG = { 'theme_advanced_resizing': True, 'theme_advanced_resize_horizontal': False, 'theme_advanced_statusbar_location': 'bottom', - 'width': '723', + 'width': '730', 'height': '250' } diff --git a/askbot/setup_templates/urls.py b/askbot/setup_templates/urls.py index 35f1c5b3..4c76781b 100644 --- a/askbot/setup_templates/urls.py +++ b/askbot/setup_templates/urls.py @@ -30,7 +30,7 @@ urlpatterns += patterns('', (r'^tinymce/', include('tinymce.urls')), (r'^robots.txt$', include('robots.urls')), url( # TODO: replace with django.conf.urls.static ? - r'^%s(?P.*)$' % settings.MEDIA_URL[1:], + r'^%s(?P.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT.replace('\\','/')}, ), diff --git a/askbot/startup_procedures.py b/askbot/startup_procedures.py index f3597820..d0d02aec 100644 --- a/askbot/startup_procedures.py +++ b/askbot/startup_procedures.py @@ -231,7 +231,7 @@ def test_template_loader(): errors.append( '"%s" must be the first element of TEMPLATE_LOADERS' % current_loader ) - + print_errors(errors) def test_celery(): @@ -609,7 +609,7 @@ def test_tinymce(): required_attrs = ( 'TINYMCE_COMPRESSOR', 'TINYMCE_JS_ROOT', - 'TINYMCE_URL', + 'TINYMCE_JS_URL', 'TINYMCE_DEFAULT_CONFIG' ) @@ -665,11 +665,11 @@ def test_tinymce(): errors.append(error_tpl % relative_js_path) #check url setting - url = getattr(django_settings, 'TINYMCE_URL', '') - expected_url = django_settings.STATIC_URL + relative_js_path + url = getattr(django_settings, 'TINYMCE_JS_URL', '') + expected_url = django_settings.STATIC_URL + relative_js_path + 'tiny_mce.js' old_expected_url = django_settings.STATIC_URL + old_relative_js_path if urls_equal(url, expected_url) is False: - error_tpl = "add line: TINYMCE_URL = STATIC_URL + '%s'" + error_tpl = "add line: TINYMCE_JS_URL = STATIC_URL + '%s'" if urls_equal(url, old_expected_url): error_tpl += '\nNote: we have moved files from "common" into "default"' errors.append(error_tpl % relative_js_path) @@ -721,7 +721,7 @@ def test_template_context_processors(): required_processors.append(new_auth_processor) if old_auth_processor in django_settings.TEMPLATE_CONTEXT_PROCESSORS: invalid_processors.append(old_auth_processor) - + missing_processors = list() for processor in required_processors: if processor not in django_settings.TEMPLATE_CONTEXT_PROCESSORS: @@ -790,7 +790,7 @@ def test_group_messaging(): errors.append( "make setting 'GROUP_MESSAGING to be exactly:\n" + settings_sample ) - + url_params = settings.get('BASE_URL_PARAMS', None) else: errors.append('add this to your settings.py:\n' + settings_sample) @@ -819,7 +819,7 @@ def test_multilingual(): errors.append('ASKBOT_MULTILINGUAL=True works only with django >= 1.4') if is_multilang: - middleware = 'django.middleware.locale.LocaleMiddleware' + middleware = 'django.middleware.locale.LocaleMiddleware' if middleware not in django_settings.MIDDLEWARE_CLASSES: errors.append( "add 'django.middleware.locale.LocaleMiddleware' to your MIDDLEWARE_CLASSES " -- cgit v1.2.3-1-g7c22 From 8dcde62c89e336c31bd794a795c30dfa31e3a3bd Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Thu, 14 Feb 2013 13:03:29 -0600 Subject: fixed django-tinymce version --- askbot/__init__.py | 4 ++-- askbot/setup_templates/settings.py | 2 +- askbot/setup_templates/settings.py.mustache | 2 +- askbot_requirements.txt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/askbot/__init__.py b/askbot/__init__.py index d90b7daa..e00a1e2f 100644 --- a/askbot/__init__.py +++ b/askbot/__init__.py @@ -33,14 +33,14 @@ REQUIREMENTS = { 'openid': 'python-openid', 'pystache': 'pystache==0.3.1', 'pytz': 'pytz', - 'tinymce': 'django-tinymce', + 'tinymce': 'django-tinymce==1.5.1b2', 'longerusername': 'longerusername', 'bs4': 'beautifulsoup4' } if platform.system() != 'Windows': REQUIREMENTS['lamson'] = 'Lamson' - + #necessary for interoperability of django and coffin try: from askbot import patches diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index ebf76e14..51bb05fb 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -244,7 +244,7 @@ HAYSTACK_SITECONF = 'askbot.search.haystack' #http://django-haystack.readthedocs.org/en/v1.2.7/settings.html HAYSTACK_SEARCH_ENGINE = 'simple' -TINYMCE_COMPRESSOR = False +TINYMCE_COMPRESSOR = True TINYMCE_SPELLCHECKER = False TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/') diff --git a/askbot/setup_templates/settings.py.mustache b/askbot/setup_templates/settings.py.mustache index 48d3dc6e..1c4ca6de 100644 --- a/askbot/setup_templates/settings.py.mustache +++ b/askbot/setup_templates/settings.py.mustache @@ -250,7 +250,7 @@ HAYSTACK_SITECONF = 'askbot.search.haystack' #http://django-haystack.readthedocs.org/en/v1.2.7/settings.html HAYSTACK_SEARCH_ENGINE = 'simple' -TINYMCE_COMPRESSOR = False +TINYMCE_COMPRESSOR = True TINYMCE_SPELLCHECKER = False TINYMCE_JS_ROOT = os.path.join(STATIC_ROOT, 'default/media/js/tinymce/') TINYMCE_JS_URL = STATIC_URL + 'default/media/js/tinymce/tiny_mce.js' diff --git a/askbot_requirements.txt b/askbot_requirements.txt index a9a939b4..ea9dd005 100644 --- a/askbot_requirements.txt +++ b/askbot_requirements.txt @@ -20,6 +20,6 @@ python-openid pystache==0.3.1 pytz sanction -django-tinymce +django-tinymce==1.5.1b2 longerusername beautifulsoup4 -- cgit v1.2.3-1-g7c22 From f08754fa66231d1dfeb54e89e444a6ffc0b22a7f Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Tue, 26 Feb 2013 09:12:28 -0600 Subject: fixed typo en WYSIWYG editor --- askbot/conf/forum_data_rules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/askbot/conf/forum_data_rules.py b/askbot/conf/forum_data_rules.py index e8a2b539..524ab16a 100644 --- a/askbot/conf/forum_data_rules.py +++ b/askbot/conf/forum_data_rules.py @@ -15,7 +15,7 @@ FORUM_DATA_RULES = livesettings.ConfigurationGroup( EDITOR_CHOICES = ( ('markdown', 'markdown'), - ('tinymce', 'WISYWIG (tinymce)') + ('tinymce', 'WYSIWYG (tinymce)') ) settings.register( @@ -354,7 +354,7 @@ settings.register( ) ) -#todo: looks like there is a bug in askbot.deps.livesettings +#todo: looks like there is a bug in askbot.deps.livesettings #that does not allow Integer values with defaults and choices settings.register( livesettings.StringValue( -- cgit v1.2.3-1-g7c22 From e3bc37cb09d29dbca0949d979ff98dcefac1649a Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Sun, 10 Mar 2013 00:46:24 -0600 Subject: Fix bug causing askbot-setup script to never accept a sqlite filename. --- askbot/deployment/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/askbot/deployment/__init__.py b/askbot/deployment/__init__.py index 1ba5c202..5477b284 100644 --- a/askbot/deployment/__init__.py +++ b/askbot/deployment/__init__.py @@ -217,6 +217,8 @@ def collect_missing_options(options_dict): print 'name %s cannot be used for the database name' % value elif value == path_utils.LOG_DIR_NAME: print 'name %s cannot be used for the database name' % value + else: + database_file_name = value if database_file_name: options_dict['database_name'] = database_file_name -- cgit v1.2.3-1-g7c22 From c9084cc9c40e1943d3df036c29d1050073c71725 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Mon, 11 Mar 2013 22:04:37 -0400 Subject: some bugfixes --- askbot/media/js/wmd/wmd.js | 2 +- askbot/migrations_api/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/askbot/media/js/wmd/wmd.js b/askbot/media/js/wmd/wmd.js index 5aeacd98..91d98694 100644 --- a/askbot/media/js/wmd/wmd.js +++ b/askbot/media/js/wmd/wmd.js @@ -122,7 +122,7 @@ Attacklab.wmdBase = function(){ // Adds a listener callback to a DOM element which is fired on a specified // event. util.addEvent = function(elem, event, listener){ - if (elem.attachEvent) { + if (elem && elem.attachEvent) { // IE only. The "on" is mandatory. elem.attachEvent("on" + event, listener); } diff --git a/askbot/migrations_api/__init__.py b/askbot/migrations_api/__init__.py index 3ea250f2..2e172a99 100644 --- a/askbot/migrations_api/__init__.py +++ b/askbot/migrations_api/__init__.py @@ -23,8 +23,8 @@ def safe_add_column(table, column, column_data, keep_default = False): db.add_column(table, column, column_data, keep_default = keep_default) db.commit_transaction() return True - except: - db.rollback_transaction() + except: + db.rollback_transaction() return False -- cgit v1.2.3-1-g7c22 From 1414e86f619120a17639d76906d3156aaca4e119 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 13 Mar 2013 14:37:48 -0400 Subject: a typo in the documentation --- askbot/doc/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst index 0c54f173..31224850 100644 --- a/askbot/doc/source/changelog.rst +++ b/askbot/doc/source/changelog.rst @@ -9,7 +9,7 @@ Development version Portugese, Romanian, Russian, Spanish, Swedish, Turkish. * repost answer as a comment under the previous (older) answer * minor edit option for question and answer, to suppress email alerts -* allowed tags to be created updon marking them as interesting/ignored/subscribed +* allowed tags to be created upon marking them as interesting/ignored/subscribed 0.7.48 (Jan 28, 2013) --------------------- -- cgit v1.2.3-1-g7c22 From 7a7d654d2f65e0552d17f0a71f5da402cfee4eea Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 13 Mar 2013 17:46:39 -0400 Subject: changed the .org link to .com in the footer --- askbot/templates/widgets/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/templates/widgets/footer.html b/askbot/templates/widgets/footer.html index 75721e50..e57aad99 100644 --- a/askbot/templates/widgets/footer.html +++ b/askbot/templates/widgets/footer.html @@ -53,7 +53,7 @@ {% endspaceless %} -- cgit v1.2.3-1-g7c22 From cb0c3f008a8d71b84ce3412c065b67250ee284a5 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 14 Mar 2013 15:31:17 -0400 Subject: recompiled the style.css file --- askbot/media/style/style.css | 56 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css index cb5f3801..5e07a0ed 100644 --- a/askbot/media/style/style.css +++ b/askbot/media/style/style.css @@ -2191,7 +2191,8 @@ ul#related-tags li { margin-top: 10px; margin-bottom: 8px; } -.question-page .post-controls a { +.question-page .post-controls a, +.question-page .post-controls span.dropdown-toggle { color: #777; padding: 0px 7px 3px 18px; cursor: pointer; @@ -2200,19 +2201,58 @@ ul#related-tags li { font-family: Arial; text-decoration: none; height: 18px; - display: block; - float: right; line-height: 18px; margin-top: -2px; margin-left: 4px; } -.question-page .post-controls a:hover { +.question-page .post-controls a:hover, +.question-page .post-controls span.dropdown-toggle:hover { background-color: #f5f0c9; +} +.question-page .post-controls span.dropdown-toggle { + background: url(../images/sprites.png) no-repeat -7px -242px; border-radius: 3px; -ms-border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -khtml-border-radius: 3px; + position: relative; +} +.question-page .post-controls span.dropdown-toggle:hover { + padding-right: 0; + background: url(../images/sprites.png) no-repeat -7px -274px; +} +.question-page .post-controls span.dropdown-toggle:hover form { + margin: 0; +} +.question-page .post-controls span.dropdown-toggle:hover input { + display: block !important; + height: 20px !important; + line-height: 20px !important; + margin: 0; + padding: 0 5px; + border-radius: 0; + -ms-border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + -khtml-border-radius: 0; + width: 100% !important; +} +.question-page .post-controls span.dropdown-toggle:hover .dropdown-menu { + display: block; + padding: 5px 0; + right: -5px !important; + left: auto; +} +.question-page .post-controls span.dropdown-toggle:hover .dropdown-menu li, +.question-page .post-controls span.dropdown-toggle:hover .dropdown-menu li:hover { + display: block !important; + margin: 0; + padding: 0; + width: 100% !important; +} +.question-page .post-controls span.dropdown-toggle:hover .dropdown-menu li:hover { + background-color: #f5f0c9; } .question-page .post-controls .sep { color: #ccc; @@ -2222,12 +2262,12 @@ ul#related-tags li { } .question-page .post-controls .question-delete, .question-page .answer-controls .question-delete { - background: url(../images/delete.png) no-repeat left 2px; + background: url(../images/delete.png) no-repeat left -1px; padding-left: 11px; } .question-page .post-controls .question-flag, .question-page .answer-controls .question-flag { - background: url(../images/flag.png) no-repeat center left; + background: url(../images/flag.png) no-repeat 2px 0; } .question-page .post-controls .answer-publish, .question-page .answer-controls .answer-publish { @@ -2239,7 +2279,7 @@ ul#related-tags li { } .question-page .post-controls .question-edit, .question-page .answer-controls .question-edit { - background: url(../images/edit2.png) no-repeat 2px center; + background: url(../images/edit2.png) no-repeat 3px 1px; } .question-page .post-controls .question-retag, .question-page .answer-controls .question-retag { @@ -2251,7 +2291,7 @@ ul#related-tags li { } .question-page .post-controls .permant-link, .question-page .answer-controls .permant-link { - background: url(../images/link.png) no-repeat center left; + background: url(../images/link.png) no-repeat 2px 1px; } .question-page .post-controls .answer-convert, .question-page .answer-controls .answer-convert { -- cgit v1.2.3-1-g7c22 From dcb2cf752a24ef78899bdcef65962c93cda40855 Mon Sep 17 00:00:00 2001 From: Tyler Mandry Date: Thu, 14 Mar 2013 16:46:17 -0500 Subject: Add ability to use LESS development mode with extra.less --- askbot/skins/loaders.py | 10 ++++++++-- askbot/templates/meta/html_head_stylesheets.html | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/askbot/skins/loaders.py b/askbot/skins/loaders.py index 50276f34..367433eb 100644 --- a/askbot/skins/loaders.py +++ b/askbot/skins/loaders.py @@ -59,9 +59,15 @@ class SkinEnvironment(CoffinEnvironment): or empty string - depending on the existence of file SKIN_PATH/media/style/extra.css """ - url = utils.get_media_url('style/extra.css', ignore_missing = True) + url = None + if django_settings.ASKBOT_CSS_DEVEL is True: + url = utils.get_media_url('style/extra.less', ignore_missing = True) + rel = "stylesheet/less" + if url is None: + url = utils.get_media_url('style/extra.css', ignore_missing = True) + rel = "stylesheet" if url is not None: - return '' % url + return '' % (url, rel) return '' def load_skins(): diff --git a/askbot/templates/meta/html_head_stylesheets.html b/askbot/templates/meta/html_head_stylesheets.html index 23750239..cb02f8e5 100644 --- a/askbot/templates/meta/html_head_stylesheets.html +++ b/askbot/templates/meta/html_head_stylesheets.html @@ -4,14 +4,15 @@ {% if settings.ASKBOT_CSS_DEVEL == False %} +{{ skin.get_extra_css_link() }} {% else %} +{{ skin.get_extra_css_link() }} {% endif %} -{{ skin.get_extra_css_link() }} {% if settings.USE_CUSTOM_CSS %} - Date: Thu, 14 Mar 2013 22:38:47 -0500 Subject: Add django_compressor to compress CSS, JS and automatically compile LESS --- askbot/setup_templates/settings.py | 15 +++++++++++++++ askbot/skins/loaders.py | 6 +++--- askbot/templates/base.html | 11 +++++++---- askbot/templates/meta/html_head_javascript.html | 9 ++++++--- askbot/templates/meta/html_head_stylesheets.html | 3 +-- askbot_requirements_dev.txt | 2 ++ 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/askbot/setup_templates/settings.py b/askbot/setup_templates/settings.py index 237a1280..ee5f8935 100644 --- a/askbot/setup_templates/settings.py +++ b/askbot/setup_templates/settings.py @@ -116,6 +116,14 @@ MIDDLEWARE_CLASSES = ( 'askbot.middleware.spaceless.SpacelessMiddleware', ) +JINJA2_EXTENSIONS = ( + 'compressor.contrib.jinja2ext.CompressorExtension', +) + +COMPRESS_PRECOMPILERS = ( + ('text/less', 'lessc {infile} {outfile}'), +) + ROOT_URLCONF = os.path.basename(os.path.dirname(__file__)) + '.urls' @@ -176,6 +184,8 @@ INSTALLED_APPS = ( 'followit', 'tinymce', #'avatar',#experimental use git clone git://github.com/ericflo/django-avatar.git$ + + 'compressor', ) @@ -234,6 +244,11 @@ CSRF_COOKIE_NAME = 'askbot_csrf' STATICFILES_DIRS = ( ('default/media', os.path.join(ASKBOT_ROOT, 'media')), ) +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'compressor.finders.CompressorFinder', +) RECAPTCHA_USE_SSL = True diff --git a/askbot/skins/loaders.py b/askbot/skins/loaders.py index 367433eb..f46f0f07 100644 --- a/askbot/skins/loaders.py +++ b/askbot/skins/loaders.py @@ -57,17 +57,17 @@ class SkinEnvironment(CoffinEnvironment): def get_extra_css_link(self): """returns either the link tag (to be inserted in the html head element) or empty string - depending on the existence of file - SKIN_PATH/media/style/extra.css + SKIN_PATH/media/style/extra.less """ url = None if django_settings.ASKBOT_CSS_DEVEL is True: url = utils.get_media_url('style/extra.less', ignore_missing = True) rel = "stylesheet/less" if url is None: - url = utils.get_media_url('style/extra.css', ignore_missing = True) + url = utils.get_media_url('style/extra.less', ignore_missing = True) rel = "stylesheet" if url is not None: - return '' % (url, rel) + return '' % (url, rel) return '' def load_skins(): diff --git a/askbot/templates/base.html b/askbot/templates/base.html index 6c162057..1e4c5bec 100644 --- a/askbot/templates/base.html +++ b/askbot/templates/base.html @@ -1,3 +1,4 @@ +{% load compress %} @@ -12,18 +13,20 @@ {% endif %} - + {% compress css %} {% block before_css %}{% endblock %} {% include "meta/html_head_stylesheets.html" %} - {% include "meta/fonts.html" %} - {% block forestyle %}{% endblock %} + {% endcompress %} + {% include "meta/fonts.html" %} {# may contain external files #} + {% compress css %}{% block forestyle %}{% endblock %}{% endcompress %} {% include "meta/html_head_javascript.html" %} - {% block forejs %}{% endblock %} + {% compress js %}{% block forejs %}{% endblock %}{% endcompress %} {% if settings.USE_CUSTOM_HTML_HEAD %} {{ settings.CUSTOM_HTML_HEAD }} {% endif %} diff --git a/askbot/templates/meta/html_head_javascript.html b/askbot/templates/meta/html_head_javascript.html index 306f325a..bd5e6ed5 100644 --- a/askbot/templates/meta/html_head_javascript.html +++ b/askbot/templates/meta/html_head_javascript.html @@ -1,5 +1,6 @@ +{% load compress %} +{% compress js %} - +{% endcompress %} + {# avoid adding javascript here so that pages load faster #} diff --git a/askbot/templates/meta/html_head_stylesheets.html b/askbot/templates/meta/html_head_stylesheets.html index cb02f8e5..2a2fb159 100644 --- a/askbot/templates/meta/html_head_stylesheets.html +++ b/askbot/templates/meta/html_head_stylesheets.html @@ -2,8 +2,7 @@ {% endif %} {% if settings.ASKBOT_CSS_DEVEL == False %} - - + {{ skin.get_extra_css_link() }} {% else %} diff --git a/askbot_requirements_dev.txt b/askbot_requirements_dev.txt index 1fbd064c..b88592cf 100644 --- a/askbot_requirements_dev.txt +++ b/askbot_requirements_dev.txt @@ -8,6 +8,8 @@ oauth2 Lamson markdown2 html5lib==0.90 +django-appconf +django-compressor==1.2 django-keyedcache django-threaded-multihost django-robots -- cgit v1.2.3-1-g7c22 From ae30cfa5de829d14415c5b2deaf1c4e5b808c604 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 17 Mar 2013 20:09:23 -0400 Subject: unified css of buttons --- askbot/media/bootstrap/css/bootstrap.css | 7 +- askbot/media/js/post.js | 4 +- askbot/media/style/lib_style.less | 23 -- askbot/media/style/style.less | 297 +++++++++++---------- askbot/templates/answer_edit.html | 14 +- askbot/templates/authopenid/authopenid_macros.html | 2 +- askbot/templates/authopenid/signin.html | 5 +- askbot/templates/authopenid/widget_signin.html | 5 +- askbot/templates/list_suggested_tags.html | 12 +- askbot/templates/macros.html | 4 +- askbot/templates/question.html | 8 + askbot/templates/question/answer_controls.html | 2 + askbot/templates/question/content.html | 2 +- askbot/templates/question/new_answer_form.html | 2 +- askbot/templates/question_edit.html | 4 +- .../templates/tags/form_bulk_tag_subscription.html | 2 +- .../templates/user_inbox/group_join_requests.html | 2 - askbot/templates/widgets/ask_button.html | 1 + askbot/tests/page_load_tests.py | 4 +- askbot/views/users.py | 1 + 20 files changed, 202 insertions(+), 199 deletions(-) diff --git a/askbot/media/bootstrap/css/bootstrap.css b/askbot/media/bootstrap/css/bootstrap.css index e6190005..396e05c6 100644 --- a/askbot/media/bootstrap/css/bootstrap.css +++ b/askbot/media/bootstrap/css/bootstrap.css @@ -935,7 +935,6 @@ input[type="file"] { line-height: 18px \9; } select { - width: 220px; background-color: #ffffff; } select[multiple], @@ -968,6 +967,7 @@ textarea { -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; } +/* input:focus, textarea:focus { border-color: rgba(82, 168, 236, 0.8); @@ -975,10 +975,9 @@ textarea:focus { -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); outline: 0; - outline: thin dotted \9; - /* IE6-9 */ - + outline: thin dotted \9; ***** for IE6-9 * } +*/ input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus, diff --git a/askbot/media/js/post.js b/askbot/media/js/post.js index 94e230a2..342a3cf3 100644 --- a/askbot/media/js/post.js +++ b/askbot/media/js/post.js @@ -1544,9 +1544,9 @@ EditCommentForm.prototype.createDom = function(){ div.append(this._textarea); this._text_counter = $('').attr('class', 'counter'); div.append(this._text_counter); - this._submit_btn = $(''); + this._submit_btn = $(''); div.append(this._submit_btn); - this._cancel_btn = $(''); + this._cancel_btn = $(''); this._cancel_btn.html(gettext('cancel')); div.append(this._cancel_btn); diff --git a/askbot/media/style/lib_style.less b/askbot/media/style/lib_style.less index 05ab38f5..5e454173 100644 --- a/askbot/media/style/lib_style.less +++ b/askbot/media/style/lib_style.less @@ -17,29 +17,6 @@ @main-font:'Open Sans Condensed', Arial, sans-serif; @secondary-font:Arial; -/* Buttons */ - -.button-style(@h:20px, @f:14px){ - height:@h; - font-size:@f; - text-align:center; - text-decoration:none; - cursor:pointer; - color:@button-label; - font-family:@main-font; - .text-shadow(0px,1px,0px,#c6d9dd); - border-top:#eaf2f3 1px solid; - .linear-gradient(#d1e2e5,#a9c2c7); - .rounded-corners(4px); - .box-shadow(1px, 1px, 2px, #636363) -} - -.button-style-hover{ - .linear-gradient(#cde5e9,#94b3ba); - text-decoration:none; - .text-shadow(0px, 1px, 0px, #c6d9dd); -} - /* General styles for gradients */ .linear-gradient(@start:#eee,@end:#fff,@stop:25%){ diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less index 5dce292c..64bc584a 100644 --- a/askbot/media/style/style.less +++ b/askbot/media/style/style.less @@ -38,6 +38,9 @@ input, select { font-family: Trebuchet MS, "segoe ui", Helvetica, Tahoma, Verdana, MingLiu, PMingLiu, Arial, sans-serif; margin-left:0px; } +select { + width: 100%; +} input[type="text"].prompt, input[type="password"].prompt, @@ -208,7 +211,7 @@ body.user-messages { .wait-icon-box { text-align: center; - margin-bottom: 8px; + margin: 5px 0 8px; } #closeNotify { @@ -500,9 +503,7 @@ body.user-messages { width: 100%; margin: 8px 0 6px 0; padding: 0; - -webkit-box-shadow: none; - -moz-box-shadow: none; - box-shadow: none; + .box-shadow(0, 0, 0); } div.input-tool-tip { @@ -552,13 +553,13 @@ body.user-messages { .footer { text-align: center; - padding-bottom: 10px; + padding: 9px 0 10px 0; } } .search-drop-menu.empty { ul { - padding: 5px; + padding: 1px; margin: 0; } } @@ -579,9 +580,11 @@ input[type="submit"].searchBtn { line-height: 22px; text-align: center; float:right; - margin: 7px 28px 0 0; + margin: 8px 28px 0 0; width: 48px; - .sprites(-98px,-36px); + .sprites(-98px,-37px); + .rounded-corners(0); + .box-shadow(0, 0, 0); cursor:pointer; position: relative; z-index: 10001; @@ -604,8 +607,14 @@ input[type="submit"].searchBtn { } } -.searchBtn:hover { - .sprites(-98px-48,-36px); +input[type="submit"].searchBtn:hover { + background-image: none; + background-image: none; + background-image: none; + background-image: none; + background-image: none; + background-image: none; + .sprites(-98px-48,-37px); } .cancelSearchBtn { @@ -616,11 +625,12 @@ input[type="submit"].searchBtn { line-height: 42px; border:0px; border-left:#deded0 1px solid; + .box-shadow(0, 0, 0); text-align: center; width: 35px; cursor:pointer; float: right; - margin-top: 7px; + margin: 7px 0 0 0; position: relative; z-index: 10001; } @@ -629,17 +639,63 @@ input[type="submit"].searchBtn { color: #d84040; } -#askButton{ /* check blocks/secondary_header.html and widgets/ask_button.html*/ - line-height:44px; - margin-top:6px; - float:right; - text-transform:uppercase; - .button-style(42px, 20px); - width: 200px;/* to match width of sidebar */ +button, +input[type="submit"], +input[type="button"], +input[type="reset"], +.button { + cursor: pointer; + color: @button-label; + height: 27px; + font-family: @main-font; + font-size: 14px; + font-weight: bold; + text-align: center; + text-decoration: none; + .text-shadow(0px,1px,0px,#c6d9dd); + border: 0 !important; + border-top: #eaf2f3 1px solid; + .linear-gradient(#d1e2e5,#a9c2c7); + .rounded-corners(4px); + .box-shadow(1px, 1px, 2px, #636363) +} +button.large, +input[type="submit"].large, +input[type="button"].large, +input[type="reset"].large, +.button.large { + font-size: 20px; + height: 35px; + line-height: 35px; + padding: 0 10px; +} + +button:hover, +input[type="submit"]:hover, +.button:hover { + .linear-gradient(#cde5e9,#94b3ba); + text-decoration:none; + .text-shadow(0px, 1px, 0px, #c6d9dd); +} + +input[type="submit"].link { + .box-shadow(0, 0, 0); + .text-shadow(0, 0, 0); + font-weight: normal; } -#askButton:hover{ - .button-style-hover; +input[type="submit"].link:hover { + text-decoration: underline; +} + +#askButton { /* check blocks/secondary_header.html and widgets/ask_button.html*/ + float:right; + font-size: 20px; + height: 42px; + line-height: 44px; + margin-top: 6px; + text-transform: uppercase; + width: 200px;/* to match width of sidebar */ } /* @@ -800,16 +856,8 @@ body.anon { #subscribedTagAdd, #ab-tag-search-add { border:0; - font-weight:bold; margin-top:-2px; - .button-style(27px, 14px); - .rounded-corners(4px); } - #interestingTagAdd:hover, - #ignoredTagAdd:hover, - #ab-tag-search-add:hover { - .button-style-hover; - } #ab-tag-search-add { width: 47px; } @@ -822,21 +870,17 @@ body.anon { /* widgets for question template */ a.followed, a.follow{ + height: 34px; + font-size: 21px; line-height:34px; border:0; font-weight:normal; margin-top:3px; display:block; - .button-style(34px,21px); .center; width: 130px; } - a.followed:hover, a.follow:hover{ - .button-style-hover; - .text-shadow(0px, 1px, 0px, #c6d9dd); - } - a.followed div.unfollow{ display:none; } @@ -1334,7 +1378,7 @@ ul.tags.marked-tags, ul#related-tags { list-style: none; margin: 0; - padding: 0; + padding: 0 0 0 1px; line-height: 170%; display: block; } @@ -1660,10 +1704,7 @@ ul#related-tags li { .add-groups, .add-users { border:0; - font-weight:bold; margin-top:-2px; - .button-style(27px, 14px); - .rounded-corners(4px); } .share-input-col { @@ -1679,10 +1720,6 @@ ul#related-tags li { height: 25px; } -.add-groups:hover { - .button-style-hover; -} - #id_user, #id_user_author { border:#cce6ec 3px solid; @@ -1704,10 +1741,7 @@ ul#related-tags li { .add-groups, .add-users { border:0; - font-weight:bold; margin-top:-2px; - .button-style(27px, 14px); - .rounded-corners(4px); } .add-everyone-group { @@ -1717,10 +1751,6 @@ ul#related-tags li { padding: 0 10px; } -.add-groups:hover { - .button-style-hover; -} - #id_user, #id_user_author { border:#cce6ec 3px solid; @@ -1749,18 +1779,12 @@ ul#related-tags li { .edit-question-page input.submit { float: left; font-weight:normal; + height: 35px; + font-size: 20px; margin-top:3px; - .button-style(34px,21px); margin-right:7px; } -#fmanswer input.submit:hover, -.ask-page input.submit:hover, -.edit-question-page input.submit:hover{ - .button-style-hover; - .text-shadow(0px, 1px, 0px, #c6d9dd) -} - .wmd-container { border:#cce6ec 3px solid; textarea { @@ -1768,7 +1792,7 @@ ul#related-tags li { } } .users-page .wmd-container { - width: 200px; + width: auto; } .ask-page, .question-page, @@ -1803,7 +1827,7 @@ ul#related-tags li { } .users-page #editor { - width: 192px; + width: 187px; } #id_title { @@ -2264,22 +2288,25 @@ ul#related-tags li { clear: both; div.controls { - clear: both; + clear: both; float:left; width: 100%; margin: 3px 0 20px 5px; } .controls a { - color: #988e4c; - padding: 0 3px 2px 22px; - font-family:@body-font; - font-size:13px; - background:url(../images/comment.png) no-repeat center left; + border: none; + color: #988e4c; + padding: 0 3px 5px 22px; + font-family: @body-font; + font-size: 13px; + font-weight: normal; + background: url(../images/comment.png) no-repeat center left; + .box-shadow(0, 0, 0); + .text-shadow(0, 0, 0); } .controls a:hover { - background-color: #f5f0c9; text-decoration: none; } @@ -2296,43 +2323,35 @@ ul#related-tags li { } form.post-comments { - margin: 3px 26px 0 42px; - textarea{ - font-size: 13px; - line-height: 1.3; - - } + padding: 6px 6px 7px 42px; + border-bottom: 1px solid #edeeeb; + margin-bottom: 0; } textarea { - height: 42px; - width:100%; - margin: 7px 0 5px 1px; + box-sizing: border-box; + border: #cce6ec 3px solid; font-family: @body-font; + font-size: 13px; + height: 54px; + line-height: 1.3; + margin: -1px 0 7px 1px; outline: none; overflow:auto; - font-size: 12px; - line-height: 140%; - padding-left:2px; - padding-top:3px; - border:#cce6ec 3px solid; + padding: 0px 19px 2px 3px; + width:100%; } - input { margin-left: 10px; margin-top: 1px; vertical-align: top; width: 100px; } - button{ - line-height:25px; - margin-bottom:5px; - .button-style(27px, 12px); - font-family:@body-font; - font-weight:bold; - } - button:hover{ - .button-style-hover; + button.submit { + height: 26px; + line-height: 26px; + padding: 0 8px; + margin-right: 6px; } .counter { display: inline-block; @@ -2346,16 +2365,13 @@ ul#related-tags li { } .comment { border-bottom: 1px solid #edeeeb; - clear:both; + clear: both; margin: 0; - margin-top:8px; - padding-bottom:4px; + padding-bottom: 4px; overflow: auto; - font-family:@body-font; - font-size:11px; + font-family: @body-font; + font-size: 11px; min-height: 25px; - background:#fff url(../images/comment-background.png) bottom repeat-x; - .rounded-corners(5px); } div.comment:hover { background-color: #efefef; @@ -2402,29 +2418,32 @@ ul#related-tags li { padding-left:6px; } - .convert-comment{ - display: inline; - white-space: nowrap; - padding-left: 0px; - } + .convert-comment { + display: inline; + white-space: nowrap; + padding-left: 0px; + input { + background: none; + padding: 0px; + color: #1B79BD; + border:none; + height: 13px; + width:auto; + font-family: Arial; + font-size: 13px; + font-weight: normal; + line-height: 13px; + margin: 0 0 0 8px; + .box-shadow(0, 0, 0); + .text-shadow(0, 0, 0); + } - .convert-comment input{ - background: none; - padding: 0px; - color: #1B79BD; - border:none; - width:auto; - font-family: Arial; - line-height: 14px; - margin-left: 6px; - font-size: 13px; - box-shadow: none; + input:hover { + text-decoration: underline; + cursor: pointer; + } } - .convert-comment input:hover{ - text-decoration:underline; - cursor:pointer; - } } .comment-body p{ @@ -2708,11 +2727,6 @@ ul#related-tags li { input.submit{ font-weight:normal; margin:5px 0px; - .button-style(26px,15px); - font-family:@body-font; - } - input.submit:hover{ - .button-style-hover; } .cancel{ background:url(../images/small-button-cancel.png) repeat-x top !important; @@ -2727,6 +2741,18 @@ ul#related-tags li { } } +.user-profile-page.inbox-group-join-requests { + form { + margin-bottom: 0; + } + table { + margin-bottom: 13px; + } + td { + padding-right: 10px; + } +} + .inbox-flags.user-profile-page { .re { width: 810px; @@ -2759,17 +2785,6 @@ ul#related-tags li { border:#cce6ec 3px solid; width:200px; } - .submit-b{ - .button-style(24px,15px); - font-family:@body-font; - font-weight:bold; - padding-right:10px; - border:0; - } - - .submit-b:hover{ - .button-style-hover; - } } @@ -2901,12 +2916,6 @@ a:hover.medal { .inputs { margin-top: 10px; margin-bottom: 10px; - input[type='submit']{ - .button-style(26px,15px); - } - } - input[type='submit'].select-language { - .button-style(26px,15px); } select { margin-bottom: 12px; @@ -2930,16 +2939,18 @@ a:hover.medal { p{font-size:13px;} } +.follow-toggle { + height: auto; +} + .follow-toggle,.submit { border:0 !important; font-weight:bold; line-height:26px; margin-top:-2px; - .button-style(26px,14px); } .follow-toggle:hover, .submit:hover { - .button-style-hover; text-decoration:none !important; } @@ -4332,10 +4343,6 @@ textarea.tipped-input { border-spacing: 10px; border-collapse: separate; - button { - .button-style(27px, 14px); - } - form { display: inline-block; margin-bottom: 0; diff --git a/askbot/templates/answer_edit.html b/askbot/templates/answer_edit.html index f80715ec..875eec5b 100644 --- a/askbot/templates/answer_edit.html +++ b/askbot/templates/answer_edit.html @@ -40,8 +40,18 @@ {% endif %}
-   - +   +
diff --git a/askbot/templates/authopenid/authopenid_macros.html b/askbot/templates/authopenid/authopenid_macros.html index 9d35ac6f..d0dca8bf 100644 --- a/askbot/templates/authopenid/authopenid_macros.html +++ b/askbot/templates/authopenid/authopenid_macros.html @@ -63,7 +63,7 @@

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

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

- + {% endif %} {% endmacro %} diff --git a/askbot/templates/authopenid/signin.html b/askbot/templates/authopenid/signin.html index c5a5c47f..ff7d47a4 100644 --- a/askbot/templates/authopenid/signin.html +++ b/askbot/templates/authopenid/signin.html @@ -115,7 +115,7 @@

- + {% if settings.USE_LDAP_FOR_PASSWORD_LOGIN == False %} {% endif %} @@ -145,7 +145,7 @@

- +

{% endif %} @@ -212,7 +212,6 @@ {% endif %} {{ account_recovery_form.email }}

- + {% if settings.USE_LDAP_FOR_PASSWORD_LOGIN == False %} {% endif %} @@ -145,7 +145,7 @@

- +

{% endif %} @@ -212,7 +212,6 @@ {% endif %} {{ account_recovery_form.email }} - - + + {% trans %}There are no questions with this tag yet{% endtrans %} @@ -42,8 +42,8 @@ {% for thread in tag.threads.all() %} - - + + {% if tag.threads.count() > 1 %} - - + + {% endif %} diff --git a/askbot/templates/macros.html b/askbot/templates/macros.html index f94fc12d..6c6b22d4 100644 --- a/askbot/templates/macros.html +++ b/askbot/templates/macros.html @@ -258,7 +258,7 @@ poor design of the data or methods on data objects #} -%} {% if acceptance_level in ('open', 'moderated') %}