From cf467aca4474327a05e84d5d7cb503fba9dff52a Mon Sep 17 00:00:00 2001 From: Ping Liang Tan Date: Wed, 13 Sep 2017 17:34:10 +0800 Subject: [PATCH 1/3] remove with statement to avoid TemplateSyntaxError TemplateSyntaxError encountered when viewing user profile --- askbot/templates/user_profile/user_info.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/askbot/templates/user_profile/user_info.html b/askbot/templates/user_profile/user_info.html index eeef08a25b..e9c49ca8b4 100644 --- a/askbot/templates/user_profile/user_info.html +++ b/askbot/templates/user_profile/user_info.html @@ -10,7 +10,7 @@
{{ macros.gravatar(view_user, 128) }} {% if request.user.pk == view_user.pk %} -

{% endif %} - + {% endif %} @@ -120,10 +120,10 @@

{{ view_user.get_status_display() }}

}} {% endif %} - {% if request.user == view_user and - settings.TWITTER_SECRET and - settings.TWITTER_KEY and - settings.ENABLE_SHARING_TWITTER + {% if request.user == view_user and + settings.TWITTER_SECRET and + settings.TWITTER_KEY and + settings.ENABLE_SHARING_TWITTER %} {% include "user_profile/twitter_sharing_controls.html" %} {% endif %} @@ -149,7 +149,7 @@

{{ view_user.get_status_display() }}

{% if show_profile_info %} - {% set editable=(request.user.is_authenticated() + {% set editable=(request.user.is_authenticated() and ( (request.user == view_user) or request.user.is_admin_or_mod() ) @@ -165,9 +165,9 @@

{{ view_user.get_status_display() }}

data-editor-type="{{ settings.EDITOR_TYPE }}" data-previewer-enabled="false" > - {% with view_user.get_localized_profile().about as user_about %} -
{{ user_about|convert_text }}
- {% endwith %} + +
{{ view_user.get_localized_profile().about|convert_text }}
+
From d77a1f34fa96990a1791d5a7d2500d2966abff4d Mon Sep 17 00:00:00 2001 From: Ping Liang Tan Date: Wed, 13 Sep 2017 17:36:20 +0800 Subject: [PATCH 2/3] fix missing "about me" in user profile user profile's about me section is empty except when logged in and viewing own profile possibly because "about" attribute does not exist in "view_user" --- askbot/templates/user_profile/user_info.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/templates/user_profile/user_info.html b/askbot/templates/user_profile/user_info.html index e9c49ca8b4..2c3d33d20b 100644 --- a/askbot/templates/user_profile/user_info.html +++ b/askbot/templates/user_profile/user_info.html @@ -173,7 +173,7 @@

{{ view_user.get_status_display() }}

{% else %} - {{ view_user.about|convert_text }} + {{ view_user.get_localized_profile().about|convert_text }} {% endif %} {% endif %} From e4263e65f1061f095995a3862eec3d5c0f765730 Mon Sep 17 00:00:00 2001 From: Ping Liang Tan Date: Wed, 13 Sep 2017 18:09:06 +0800 Subject: [PATCH 3/3] fix wrong html element name for mathjax When typeseting LaTex in answers, preview does not render MathJax. This is because mathjax's Hub.Queue method is applied to the name 'preview' while the actual preview element is named 'preview-2' --- askbot/media/wmd/askbot_converter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askbot/media/wmd/askbot_converter.js b/askbot/media/wmd/askbot_converter.js index 0e3689f049..a0a1d1c1e1 100644 --- a/askbot/media/wmd/askbot_converter.js +++ b/askbot/media/wmd/askbot_converter.js @@ -19,7 +19,7 @@ AskbotMarkdownConverter.prototype.scheduleMathJaxRendering = function () { clearTimeout(this._timeout); } var renderFunc = function () { - MathJax.Hub.Queue(['Typeset', MathJax.Hub, 'previewer']); + MathJax.Hub.Queue(['Typeset', MathJax.Hub, 'previewer-2']); }; this._timeout = setTimeout(renderFunc, 500); };