From 2763ae65e578b14541aec0f915d8eb86351f2e33 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sat, 7 Jan 2012 13:30:27 -0300 Subject: added static_page.html template and used it for custom faq page --- askbot/skins/default/templates/static_page.html | 10 +++++++++ askbot/views/meta.py | 27 ++++++++----------------- 2 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 askbot/skins/default/templates/static_page.html diff --git a/askbot/skins/default/templates/static_page.html b/askbot/skins/default/templates/static_page.html new file mode 100644 index 00000000..c537e199 --- /dev/null +++ b/askbot/skins/default/templates/static_page.html @@ -0,0 +1,10 @@ +{% extends "two_column_body.html" %} + +{% block title %}{% spaceless %}{{title}}{% endspaceless %}{% endblock %} +{% block content %} +
+

{{title}}

+ {{content}} +
+{% endblock %} + diff --git a/askbot/views/meta.py b/askbot/views/meta.py index 493ab8ec..f8cbe8ae 100644 --- a/askbot/views/meta.py +++ b/askbot/views/meta.py @@ -42,30 +42,19 @@ def server_error(request, template='500.html'): return generic_view(request, template) def faq(request): - if getattr(askbot_settings, 'FORUM_FAQ',''): - text = _(getattr(askbot_settings, 'FORUM_FAQ','')) + if askbot_settings.FORUM_FAQ.strip() != '': + return render_into_skin( + 'static_page.html', + {'title': _('FAQ'), 'content': askbot_settings.FORUM_FAQ}, + request + ) + else: data = { 'gravatar_faq_url': reverse('faq') + '#gravatar', - #'send_email_key_url': reverse('send_email_key'), - 'ask_question_url': reverse('ask'), - 'page_class': 'meta', - } - forum_faq = render_text_into_skin(text, data, request) - data_out = { - 'gravatar_faq_url': reverse('faq') + '#gravatar', - #'send_email_key_url': reverse('send_email_key'), 'ask_question_url': reverse('ask'), 'page_class': 'meta', - 'forum_faq' : forum_faq, } - return render_into_skin('faq.html', data_out, request) - data = { - 'gravatar_faq_url': reverse('faq') + '#gravatar', - #'send_email_key_url': reverse('send_email_key'), - 'ask_question_url': reverse('ask'), - 'page_class': 'meta', - } - return render_into_skin('faq_static.html', data, request) + return render_into_skin('faq_static.html', data, request) @csrf.csrf_protect def feedback(request): -- cgit v1.2.3-1-g7c22