diff --git a/cms/routes.py b/cms/routes.py index b09a2b8..e41af0c 100644 --- a/cms/routes.py +++ b/cms/routes.py @@ -1,5 +1,6 @@ from django.conf.urls import url from django.utils import timezone +from django.utils.translation import ugettext as _, ugettext_lazy from website.models import * from website.views import * @@ -50,12 +51,10 @@ class Route: """ pass - @classmethod def get_title (cl, model, request, **kwargs): return '' - @classmethod def as_url (cl, model, view, view_kwargs = None): base_name = model._meta.verbose_name_plural.lower() @@ -89,7 +88,6 @@ class DetailRoute (Route): ('slug', '(\w|-|_)+', True), ] - @classmethod def get_object (cl, model, request, pk, **kwargs): return model.objects.get(pk = int(pk)) @@ -102,6 +100,12 @@ class AllRoute (Route): def get_queryset (cl, model, request, **kwargs): return model.objects.all() + @classmethod + def get_title (cl, model, request, **kwargs): + return _('All %(model)s') % { + 'model': model._meta.verbose_name_plural + } + class ThreadRoute (Route): name = 'thread' diff --git a/cms/templates/cms/base_content.html b/cms/templates/cms/base_content.html new file mode 100644 index 0000000..93b8ff5 --- /dev/null +++ b/cms/templates/cms/base_content.html @@ -0,0 +1,8 @@ +{% block pre_title %} +{% endblock %} +{% block title %} +{% endblock %} +{% block content %} +{% endblock %} + + diff --git a/cms/templates/cms/base_site.html b/cms/templates/cms/base_site.html new file mode 100644 index 0000000..31d738d --- /dev/null +++ b/cms/templates/cms/base_site.html @@ -0,0 +1,49 @@ + +
+