diff options
| author | Tom Christie | 2012-02-20 07:26:34 -0800 |
|---|---|---|
| committer | Tom Christie | 2012-02-20 07:26:34 -0800 |
| commit | 2fea12c88f22f248381405040fa409e81c9fd4e6 (patch) | |
| tree | 9632eedaf35cb88c6e59ddd31814ce43ab57f994 /djangorestframework | |
| parent | 87a9072b56cfe4f591c25c6c7992553759305600 (diff) | |
| parent | 50198935af1f772835a3c26943cbb245295c60e5 (diff) | |
| download | django-rest-framework-2fea12c88f22f248381405040fa409e81c9fd4e6.tar.bz2 | |
Merge pull request #168 from poswald/namespace-templates
Namespace templates
Diffstat (limited to 'djangorestframework')
| -rw-r--r-- | djangorestframework/renderers.py | 6 | ||||
| -rw-r--r-- | djangorestframework/templates/djangorestframework/api.html | 3 | ||||
| -rw-r--r-- | djangorestframework/templates/djangorestframework/api.txt (renamed from djangorestframework/templates/renderer.txt) | 0 | ||||
| -rw-r--r-- | djangorestframework/templates/djangorestframework/base.html (renamed from djangorestframework/templates/renderer.html) | 19 | ||||
| -rw-r--r-- | djangorestframework/templates/djangorestframework/login.html (renamed from djangorestframework/templates/api_login.html) | 0 | ||||
| -rw-r--r-- | djangorestframework/utils/staticviews.py | 4 |
6 files changed, 24 insertions, 8 deletions
diff --git a/djangorestframework/renderers.py b/djangorestframework/renderers.py index bb0f789a..de9a01ec 100644 --- a/djangorestframework/renderers.py +++ b/djangorestframework/renderers.py @@ -373,7 +373,7 @@ class DocumentingHTMLRenderer(DocumentingTemplateRenderer): media_type = 'text/html' format = 'html' - template = 'renderer.html' + template = 'djangorestframework/api.html' class DocumentingXHTMLRenderer(DocumentingTemplateRenderer): @@ -385,7 +385,7 @@ class DocumentingXHTMLRenderer(DocumentingTemplateRenderer): media_type = 'application/xhtml+xml' format = 'xhtml' - template = 'renderer.html' + template = 'djangorestframework/api.html' class DocumentingPlainTextRenderer(DocumentingTemplateRenderer): @@ -397,7 +397,7 @@ class DocumentingPlainTextRenderer(DocumentingTemplateRenderer): media_type = 'text/plain' format = 'txt' - template = 'renderer.txt' + template = 'djangorestframework/api.txt' DEFAULT_RENDERERS = ( diff --git a/djangorestframework/templates/djangorestframework/api.html b/djangorestframework/templates/djangorestframework/api.html new file mode 100644 index 00000000..fd9bcc98 --- /dev/null +++ b/djangorestframework/templates/djangorestframework/api.html @@ -0,0 +1,3 @@ +{% extends "djangorestframework/base.html" %} + +{# Override this template in your own templates directory to customize #}
\ No newline at end of file diff --git a/djangorestframework/templates/renderer.txt b/djangorestframework/templates/djangorestframework/api.txt index b584952c..b584952c 100644 --- a/djangorestframework/templates/renderer.txt +++ b/djangorestframework/templates/djangorestframework/api.txt diff --git a/djangorestframework/templates/renderer.html b/djangorestframework/templates/djangorestframework/base.html index bda49e6f..1d4ae92a 100644 --- a/djangorestframework/templates/renderer.html +++ b/djangorestframework/templates/djangorestframework/base.html @@ -7,26 +7,34 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href='{% get_static_prefix %}djangorestframework/css/style.css'/> - <title>Django REST framework - {{ name }}</title> + {% block extrastyle %}{% endblock %} + <title>{% block title %}Django REST framework - {{ name }}{% endblock %}</title> + {% block extrahead %}{% endblock %} + {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} </head> - <body> + <body class="{% block bodyclass %}{% endblock %}"> <div id="container"> <div id="header"> <div id="branding"> - <h1 id="site-name"><a href='http://django-rest-framework.org'>Django REST framework</a> <span class="version"> v {{ version }}</span></h1> + <h1 id="site-name">{% block branding %}<a href='http://django-rest-framework.org'>Django REST framework</a> <span class="version"> v {{ version }}</span>{% endblock %}</h1> </div> <div id="user-tools"> {% if user.is_active %}Welcome, {{ user }}.{% if logout_url %} <a href='{{ logout_url }}'>Log out</a>{% endif %}{% else %}Anonymous {% if login_url %}<a href='{{ login_url }}'>Log in</a>{% endif %}{% endif %} + {% block userlinks %}{% endblock %} </div> + {% block nav-global %}{% endblock %} </div> <div class="breadcrumbs"> + {% block breadcrumbs %} {% for breadcrumb_name, breadcrumb_url in breadcrumblist %} <a href="{{ breadcrumb_url }}">{{ breadcrumb_name }}</a> {% if not forloop.last %}›{% endif %} {% endfor %} + {% endblock %} </div> + <!-- Content --> <div id="content" class="{% block coltype %}colM{% endblock %}"> {% if 'OPTIONS' in view.allowed_methods %} @@ -123,7 +131,12 @@ {% endif %} </div> + <!-- END content-main --> + </div> + <!-- END Content --> + + {% block footer %}<div id="footer"></div>{% endblock %} </div> </body> </html> diff --git a/djangorestframework/templates/api_login.html b/djangorestframework/templates/djangorestframework/login.html index 07929f0c..07929f0c 100644 --- a/djangorestframework/templates/api_login.html +++ b/djangorestframework/templates/djangorestframework/login.html diff --git a/djangorestframework/utils/staticviews.py b/djangorestframework/utils/staticviews.py index 9bae0ee7..7cbc0b9b 100644 --- a/djangorestframework/utils/staticviews.py +++ b/djangorestframework/utils/staticviews.py @@ -12,7 +12,7 @@ import base64 # be making settings changes in order to accomodate django-rest-framework @csrf_protect @never_cache -def api_login(request, template_name='api_login.html', +def api_login(request, template_name='djangorestframework/login.html', redirect_field_name=REDIRECT_FIELD_NAME, authentication_form=AuthenticationForm): """Displays the login form and handles the login action.""" @@ -57,5 +57,5 @@ def api_login(request, template_name='api_login.html', }, context_instance=RequestContext(request)) -def api_logout(request, next_page=None, template_name='api_login.html', redirect_field_name=REDIRECT_FIELD_NAME): +def api_logout(request, next_page=None, template_name='djangorestframework/login.html', redirect_field_name=REDIRECT_FIELD_NAME): return logout(request, next_page, template_name, redirect_field_name) |
