mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-06-04 11:29:39 +00:00
Add new rule and tags
This commit is contained in:
0
computes/templatetags/__init__.py
Normal file
0
computes/templatetags/__init__.py
Normal file
11
computes/templatetags/tags_activebtn.py
Normal file
11
computes/templatetags/tags_activebtn.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from django import template
|
||||
import re
|
||||
|
||||
register = template.Library()
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def class_activebtn(request, pattern):
|
||||
if re.search(pattern, request.path):
|
||||
return 'btn-primary'
|
||||
return ''
|
||||
Reference in New Issue
Block a user