Renamed Project to cntmanage
This commit is contained in:
18
cntmanage/flightslot/custom/colortag.py
Normal file
18
cntmanage/flightslot/custom/colortag.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from colorfield.fields import ColorField
|
||||
from django.utils.html import format_html
|
||||
from django.utils.safestring import SafeText
|
||||
|
||||
def course_color(color: ColorField | None) -> SafeText:
|
||||
if not color:
|
||||
return format_html("")
|
||||
return format_html(
|
||||
'<div style="background-color: {}; \
|
||||
width: 20px; height: 20px; \
|
||||
border-radius: 25%; \
|
||||
border-color: gray; \
|
||||
border-style: solid; \
|
||||
border-width: 1px; \
|
||||
display: inline-block; \
|
||||
"></div>',
|
||||
color
|
||||
)
|
||||
Reference in New Issue
Block a user