mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
custom browsable api header
This commit is contained in:
2
.idea/recipes.iml
generated
2
.idea/recipes.iml
generated
@@ -27,8 +27,8 @@
|
||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||
<option name="TEMPLATE_FOLDERS">
|
||||
<list>
|
||||
<option value="$MODULE_DIR$/templates" />
|
||||
<option value="$MODULE_DIR$/cookbook/templates" />
|
||||
<option value="$MODULE_DIR$/recipes/templates" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
|
||||
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
|
||||
|
||||
@@ -102,7 +102,7 @@ ROOT_URLCONF = 'recipes.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [os.path.join(BASE_DIR, 'templates')],
|
||||
'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'cookbook', 'templates')],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
|
||||
Reference in New Issue
Block a user