mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 05:11:31 -05:00
custom browsable api header
This commit is contained in:
19
cookbook/templates/rest_framework/api.html
Normal file
19
cookbook/templates/rest_framework/api.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "rest_framework/base.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block branding %}
|
||||
<a class="navbar-brand" href="{% url 'index' %}">{% trans 'Recipe Home' %}</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block userlinks %}
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a class='navbar-link' rel="noreferrer nofollow" target="_blank" href='https://www.django-rest-framework.org/'>
|
||||
Django REST framework
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{ block.super }}
|
||||
|
||||
{% endblock %}
|
||||
@@ -26,7 +26,7 @@ def theme_url(request):
|
||||
def nav_color(request):
|
||||
if not request.user.is_authenticated:
|
||||
return 'primary'
|
||||
return request.user.userpreference.nav_color
|
||||
return request.user.userpreference.nav_color.lower()
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
|
||||
Reference in New Issue
Block a user