mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
templatetags/theming_tags
This commit is contained in:
0
cookbook/templatetags/__init__.py
Normal file
0
cookbook/templatetags/__init__.py
Normal file
@@ -1,7 +1,6 @@
|
||||
from cookbook.models import UserPreference
|
||||
from django import template
|
||||
from django.templatetags.static import static
|
||||
|
||||
from cookbook.models import UserPreference
|
||||
from recipes.settings import STICKY_NAV_PREF_DEFAULT
|
||||
|
||||
register = template.Library()
|
||||
@@ -33,7 +32,7 @@ def nav_color(request):
|
||||
@register.simple_tag
|
||||
def sticky_nav(request):
|
||||
if (not request.user.is_authenticated and STICKY_NAV_PREF_DEFAULT) or \
|
||||
(request.user.is_authenticated and request.user.userpreference.sticky_navbar):
|
||||
(request.user.is_authenticated and request.user.userpreference.sticky_navbar): # noqa: E501
|
||||
return 'position: sticky; top: 0; left: 0; z-index: 1000;'
|
||||
else:
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user