urlpatterns += patterns('',
url(r'^$', app.readers.index, name='index'),
url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}, name='sitemap'),
- #(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/images/favicon.ico'}),
- #(r'^favicon\.gif$', 'django.views.generic.simple.redirect_to', {'url': '/media/images/favicon.gif'}),
+
(r'^favicon\.ico$', app.meta.favicon),
- url(r'^m/(?P<path>.*)$', 'django.views.static.serve',
- {'document_root': os.path.join(APP_PATH,'skins').replace('\\','/')},
- name='osqa_media',
- ),
+ url(r'^m/(?P<skin>\w+)/media/(?P<path>.*)$', app.meta.media , name='osqa_media'),
url(r'^%s(?P<path>.*)$' % _('upfiles/'), 'django.views.static.serve',
{'document_root': os.path.join(APP_PATH,'upfiles').replace('\\','/')},
name='uploaded_file',
),
- #url(r'^%s/$' % _('signin/'), 'django_authopenid.views.signin', name='signin'),
+
url(r'^%s$' % _('faq/'), app.meta.static, {'content': settings.FAQ_PAGE_TEXT, 'title': _('FAQ')}, name='faq'),
url(r'^%s$' % _('about/'), app.meta.static, {'content': settings.ABOUT_PAGE_TEXT, 'title': _('About')}, name='about'),
url(r'^%s$' % _('markdown_help/'), app.meta.markdown_help, name='markdown_help'),
+import os
from itertools import groupby
from django.shortcuts import render_to_response, get_object_or_404
from django.core.urlresolvers import reverse
from django.template import RequestContext, loader
from django.http import HttpResponseRedirect, HttpResponse
+from django.views.static import serve
from forum import settings
from forum.forms import FeedbackForm
from django.core.urlresolvers import reverse
def static(request, title, content):
return render_to_response('static.html', {'content' : content, 'title': title}, context_instance=RequestContext(request))
+def media(request, skin, path):
+ return serve(request, "%s/media/%s" % (skin, path),
+ document_root=os.path.join(os.path.dirname(os.path.dirname(__file__)),'skins').replace('\\','/'))
+
def markdown_help(request):
# md = markdown.Markdown([SettingsExtension({})])
# text = md.convert(settings.FAQ_PAGE_TEXT.value)