Update to Font Awesome 5. Add experimental Icon class. Simplify document loading icon.
Signed-off-by: Michael Price <loneviking72@gmail.com> Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
69adce5c02
commit
381dafc7b9
30
mayan/apps/appearance/classes.py
Normal file
30
mayan/apps/appearance/classes.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.template import Template, Context
|
||||
|
||||
|
||||
class Icon(object):
|
||||
templates = {
|
||||
'classes': '<i class="{{ classes }}"></i>',
|
||||
'symbol': '<i class="fa fa-{{ symbol }}"></i>'
|
||||
}
|
||||
|
||||
def __init__(self, classes=None, symbol=None):
|
||||
self.classes = classes
|
||||
self.symbol = symbol
|
||||
|
||||
if self.classes:
|
||||
self.template = self.templates['classes']
|
||||
else:
|
||||
self.template = self.templates['symbol']
|
||||
|
||||
def render(self):
|
||||
return Template(self.template).render(
|
||||
context=Context(
|
||||
{
|
||||
'classes': self.classes,
|
||||
'symbol': self.symbol,
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user