diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-01-07 13:30:27 -0300 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-01-07 13:30:27 -0300 |
commit | 2763ae65e578b14541aec0f915d8eb86351f2e33 (patch) | |
tree | efdd27079ea3b23fa421f50dca4e7765a927b3de | |
parent | 4ad37cc4f13474791ff51aa59953f544cc7f9da8 (diff) | |
download | askbot-2763ae65e578b14541aec0f915d8eb86351f2e33.tar.gz askbot-2763ae65e578b14541aec0f915d8eb86351f2e33.tar.bz2 askbot-2763ae65e578b14541aec0f915d8eb86351f2e33.zip |
added static_page.html template and used it for custom faq page
-rw-r--r-- | askbot/skins/default/templates/static_page.html | 10 | ||||
-rw-r--r-- | askbot/views/meta.py | 27 |
2 files changed, 18 insertions, 19 deletions
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" %} +<!-- template static_page.html --> +{% block title %}{% spaceless %}{{title}}{% endspaceless %}{% endblock %} +{% block content %} +<div class="content"> + <h1 class="section-title">{{title}}</h1> + {{content}} +</div> +{% endblock %} +<!-- end template static_page.html --> 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): |