summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/mail/__init__.py2
-rw-r--r--askbot/media/bootstrap/css/bootstrap.css1
-rw-r--r--askbot/media/js/utils.js2
-rw-r--r--askbot/media/style/lib_style.less2
-rw-r--r--askbot/media/style/style.css43
-rw-r--r--askbot/media/style/style.less55
-rw-r--r--askbot/models/__init__.py2
-rw-r--r--askbot/templates/base.html1
-rw-r--r--askbot/templates/question.html7
-rw-r--r--askbot/templates/user_profile/user_network.html2
-rw-r--r--askbot/templatetags/extra_filters_jinja.py2
-rw-r--r--askbot/tests/page_load_tests.py11
-rw-r--r--askbot/utils/html.py4
-rw-r--r--askbot/views/commands.py2
14 files changed, 111 insertions, 25 deletions
diff --git a/askbot/mail/__init__.py b/askbot/mail/__init__.py
index a2f53017..8b999534 100644
--- a/askbot/mail/__init__.py
+++ b/askbot/mail/__init__.py
@@ -90,7 +90,7 @@ def clean_html_email(email_body):
todo: needs more clenup might not work for other email templates
that do not use table layout
"""
- soup = BeautifulSoup(email_body)
+ soup = BeautifulSoup(email_body, 'html5lib')
body_element = soup.find('body')
filter_func = lambda s: bool(s.strip())
phrases = map(
diff --git a/askbot/media/bootstrap/css/bootstrap.css b/askbot/media/bootstrap/css/bootstrap.css
index 7e74f6a7..37eb662a 100644
--- a/askbot/media/bootstrap/css/bootstrap.css
+++ b/askbot/media/bootstrap/css/bootstrap.css
@@ -310,7 +310,6 @@ a:hover {
}
p {
margin: 0 0 9px;
- font-family: Arial, sans-serif;
font-size: 13px;
line-height: 18px;
}
diff --git a/askbot/media/js/utils.js b/askbot/media/js/utils.js
index 9d1e1c51..0380e6fe 100644
--- a/askbot/media/js/utils.js
+++ b/askbot/media/js/utils.js
@@ -1286,7 +1286,7 @@ FileUploadDialog.prototype.createDom = function() {
upload_input.attr({
id: this._input_id,
type: 'file',
- name: 'file-upload',
+ name: 'file-upload'
//size: 26???
});
form.append(upload_input);
diff --git a/askbot/media/style/lib_style.less b/askbot/media/style/lib_style.less
index 5e454173..aa5ac7d9 100644
--- a/askbot/media/style/lib_style.less
+++ b/askbot/media/style/lib_style.less
@@ -12,7 +12,7 @@
/* Variables for fonts*/
-@body-font:Arial; /* "Trebuchet MS", sans-serif;*/
+@body-font:Arial;
@sort-font:Georgia, serif;
@main-font:'Open Sans Condensed', Arial, sans-serif;
@secondary-font:Arial;
diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css
index af99c023..b448aa46 100644
--- a/askbot/media/style/style.css
+++ b/askbot/media/style/style.css
@@ -1,8 +1,6 @@
-@import url(jquery.autocomplete.css);
/* General Predifined classes, read more in lesscss.org */
/* Variables for Colors*/
/* Variables for fonts*/
-/* "Trebuchet MS", sans-serif;*/
/* General styles for gradients */
/* Receive exactly positions for background Sprite */
/* CSS3 Elements */
@@ -477,7 +475,7 @@ body.user-messages {
height: 26px;
line-height: 26px;
font-weight: 300;
- background: #FFF;
+ background: transparent;
border: 0px;
color: #484848;
font-family: Arial;
@@ -504,7 +502,7 @@ body.user-messages {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
- width: 100% a;
+ width: 100%;
}
#searchBar input[type="submit"].searchBtn {
right: 0;
@@ -1170,7 +1168,6 @@ ul#searchTags {
#question-list {
float: left;
position: relative;
- background-color: #FFF;
padding: 0;
width: 100%;
}
@@ -4320,6 +4317,42 @@ td.setting-input textarea {
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
}
+.acInput {
+ width: 200px;
+}
+.acResults {
+ padding: 0px;
+ border: 1px solid WindowFrame;
+ background-color: #fff;
+ overflow: hidden;
+ -webkit-box-shadow: 0px 1px 1px #A7A7A7;
+ -moz-box-shadow: 0px 1px 1px #BFBFBF;
+ box-shadow: 0px 1px 1px #BFBFBF;
+}
+.acResults ul {
+ width: 100%;
+ list-style-position: outside;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+.acResults li {
+ margin: 0px;
+ padding: 2px 5px;
+ cursor: pointer;
+ display: block;
+ width: 100%;
+ font: menu;
+ font-size: 14px;
+ overflow: hidden;
+}
+.acLoading {
+ background: url('../images/indicator.gif') right center no-repeat;
+}
+.acSelect {
+ background-color: Highlight;
+ color: HighlightText;
+}
/* modifications for small screens */
@media screen and (max-width: 960px) {
/* content margins touch viewport */
diff --git a/askbot/media/style/style.less b/askbot/media/style/style.less
index b42941c9..20e0c4a1 100644
--- a/askbot/media/style/style.less
+++ b/askbot/media/style/style.less
@@ -1,4 +1,3 @@
-@import url(jquery.autocomplete.css);
@import "lib_style.less"; /* Library of predifined less functions styles */
/* ----- General HTML Styles----- */
@@ -385,7 +384,7 @@ body.user-messages {
display: block;
margin: 0px 10px 0px 10px;
width: 140px;
- font-family: 'Open Sans Condensed', Arial, sans-serif;
+ font-family: @main-font;
font-weight: 100;
}
@@ -518,7 +517,7 @@ body.user-messages {
height: 26px;
line-height: 26px;
font-weight:300;
- background:#FFF;
+ background: transparent;
border:0px;
color:#484848;
font-family:@body-font;
@@ -544,7 +543,7 @@ body.user-messages {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
- width: 100%a
+ width: 100%;
}
input[type="submit"].searchBtn {
@@ -1100,7 +1099,7 @@ body.anon.ask-page .search-drop-menu {
margin-bottom: 3px;
margin-top: 3px;
float:right;
- font-family:@sort-font;
+ font-family: @sort-font;
font-size:16px;
.rounded-corners(5px);
}
@@ -1176,7 +1175,7 @@ body.anon.ask-page .search-drop-menu {
padding-top:3px;
background:#fff url(../images/feed-icon-small.png) no-repeat center right;
float:right;
- font-family:@sort-font;
+ font-family: @sort-font;
font-size:16px;
}
@@ -1231,7 +1230,6 @@ ul#searchTags {
#question-list {
float: left;
position: relative;
- background-color: #FFF;
padding: 0;
width: 100%;
}
@@ -4414,7 +4412,7 @@ textarea.tipped-input {
.action {
cursor: pointer;
color: #4A757F;
- font-family: 'Open Sans Condensed', Arial, sans-serif;
+ font-family: @main-font;
text-decoration: none;
}
@@ -4524,6 +4522,47 @@ td.setting-input {
}
}
+.acInput {
+ width: 200px;
+}
+.acResults {
+ padding: 0px;
+ border: 1px solid WindowFrame;
+ background-color: #fff;
+ overflow: hidden;
+ -webkit-box-shadow: 0px 1px 1px #A7A7A7;
+ -moz-box-shadow: 0px 1px 1px #BFBFBF;
+ box-shadow: 0px 1px 1px #BFBFBF;
+}
+
+.acResults ul {
+ width: 100%;
+ list-style-position: outside;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+}
+
+.acResults li {
+ margin: 0px;
+ padding: 2px 5px;
+ cursor: pointer;
+ display: block;
+ width: 100%;
+ font: menu;
+ font-size: 14px;
+ overflow: hidden;
+}
+
+.acLoading {
+ background : url('../images/indicator.gif') right center no-repeat;
+}
+
+.acSelect {
+ background-color: Highlight;
+ color: HighlightText;
+}
+
/* modifications for small screens */
@media screen and (max-width: 960px) {/* content margins touch viewport */
* {
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index 852aed4b..325f06d6 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -2429,7 +2429,7 @@ def user_get_primary_group(self):
def user_can_make_group_private_posts(self):
"""simplest implementation: user belongs to at least one group"""
- return self.get_groups(private=True).count() > 0
+ return (self.get_primary_group() != None)
def user_get_group_membership(self, group):
"""returns a group membership object or None
diff --git a/askbot/templates/base.html b/askbot/templates/base.html
index a3bb2173..332fa093 100644
--- a/askbot/templates/base.html
+++ b/askbot/templates/base.html
@@ -4,6 +4,7 @@
<head>
<title>{% block title %}{% endblock %} - {{ settings.APP_TITLE|escape }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
{% block meta_description %}
<meta name="description" content="{{settings.APP_DESCRIPTION|escape}}" />
{% endblock %}
diff --git a/askbot/templates/question.html b/askbot/templates/question.html
index a8aef0a7..7e8d33ef 100644
--- a/askbot/templates/question.html
+++ b/askbot/templates/question.html
@@ -44,7 +44,12 @@
};
var getTextContent = function(node) {
- return node.innerText || node.textContent;
+ var text = node.innerText || node.textContent;
+ if (text === undefined) {
+ return '';
+ } else {
+ return text;
+ }
};
var hasAttribute = function(node, attrName) {
diff --git a/askbot/templates/user_profile/user_network.html b/askbot/templates/user_profile/user_network.html
index 51de7b55..ce13d5c4 100644
--- a/askbot/templates/user_profile/user_network.html
+++ b/askbot/templates/user_profile/user_network.html
@@ -11,7 +11,6 @@
{{
macros.user_list(
followers,
- profile_section = 'network',
karma_mode = settings.KARMA_MODE,
badges_mode = settings.BADGES_MODE
)
@@ -22,7 +21,6 @@
{{
macros.user_list(
followed_users,
- profile_section = 'network',
karma_mode = settings.KARMA_MODE,
badges_mode = settings.BADGES_MODE
)
diff --git a/askbot/templatetags/extra_filters_jinja.py b/askbot/templatetags/extra_filters_jinja.py
index 19462da6..dccd9a2a 100644
--- a/askbot/templatetags/extra_filters_jinja.py
+++ b/askbot/templatetags/extra_filters_jinja.py
@@ -63,7 +63,7 @@ def is_empty_editor_value(value):
return True
#tinymce uses a weird sentinel placeholder
if askbot_settings.EDITOR_TYPE == 'tinymce':
- soup = BeautifulSoup(value)
+ soup = BeautifulSoup(value, 'html5lib')
return soup.getText().strip() == ''
return False
diff --git a/askbot/tests/page_load_tests.py b/askbot/tests/page_load_tests.py
index 2620d6b8..b8896ba0 100644
--- a/askbot/tests/page_load_tests.py
+++ b/askbot/tests/page_load_tests.py
@@ -799,3 +799,14 @@ class UserProfilePageTests(AskbotTestCase):
user = self.reload_object(self.user)
self.assertEqual(user.username, 'edited')
self.assertEqual(user.email, 'new@example.com')
+
+ def test_user_network(self):
+ user2 = self.create_user('user2')
+ user2.follow_user(self.user)
+ self.user.follow_user(user2)
+ name_slug = slugify(self.user.username)
+ kwargs={'id': self.user.id, 'slug': name_slug}
+ url = reverse('user_profile', kwargs=kwargs)
+ response = self.client.get(url, data={'sort':'network'})
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.templates[0].name, 'user_profile/user_network.html')
diff --git a/askbot/utils/html.py b/askbot/utils/html.py
index 29e8bd70..d7b321da 100644
--- a/askbot/utils/html.py
+++ b/askbot/utils/html.py
@@ -73,7 +73,7 @@ def replace_links_with_text(html):
return '%s (%s)' % (url, text)
return url or text or ''
- soup = BeautifulSoup(html)
+ soup = BeautifulSoup(html, 'html5lib')
abs_url_re = r'^http(s)?://'
images = soup.find_all('img')
@@ -103,7 +103,7 @@ def strip_tags(html, tags=None):
assert(tags != None)
- soup = BeautifulSoup(html)
+ soup = BeautifulSoup(html, 'html5lib')
for tag in tags:
tag_matches = soup.find_all(tag)
map(lambda v: v.replaceWith(''), tag_matches)
diff --git a/askbot/views/commands.py b/askbot/views/commands.py
index dee8d1e4..b2c8a788 100644
--- a/askbot/views/commands.py
+++ b/askbot/views/commands.py
@@ -1489,7 +1489,7 @@ def get_editor(request):
)
#parse out javascript and dom, and return them separately
#we need that, because js needs to be added in a special way
- html_soup = BeautifulSoup(editor_html)
+ html_soup = BeautifulSoup(editor_html, 'html5lib')
parsed_scripts = list()
for script in html_soup.find_all('script'):