summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 41048bfa3..c4a09879e 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1034,15 +1034,33 @@ class IshtarSiteProfile(models.Model, Cached):
label = models.TextField(_(u"Name"))
slug = models.SlugField(_(u"Slug"), unique=True)
description = models.TextField(_(u"Description"), null=True, blank=True)
+ base_color = models.CharField(
+ _(u"CSS color code for base module"),
+ default='rgba(0, 0, 0, 0)', max_length=200)
files = models.BooleanField(_(u"Files module"), default=False)
+ files_color = models.CharField(
+ _(u"CSS color code for files module"),
+ default='rgba(0, 32, 210, 0.1)', max_length=200)
context_record = models.BooleanField(_(u"Context records module"),
default=False)
+ context_record_color = models.CharField(
+ _(u"CSS color code for context record module"),
+ default='rgba(210,200,0,0.2)', max_length=200)
find = models.BooleanField(_(u"Finds module"), default=False,
help_text=_(u"Need context records module"))
+ find_color = models.CharField(
+ _(u"CSS color code for find module"),
+ default='rgba(210,0,0,0.15)', max_length=200)
warehouse = models.BooleanField(
_(u"Warehouses module"), default=False,
help_text=_(u"Need finds module"))
+ warehouse_color = models.CharField(
+ _(u"CSS code for warehouse module"), default='rgba(10,20,200,0.15)',
+ max_length=200)
mapping = models.BooleanField(_(u"Mapping module"), default=False)
+ mapping_color = models.CharField(
+ _(u"CSS code for mapping module"), default='rgba(72, 236, 0, 0.15)',
+ max_length=200)
homepage = models.TextField(
_(u"Home page"), null=True, blank=True,
help_text=_(u"Homepage of Ishtar - if not defined a default homepage "
@@ -1103,6 +1121,19 @@ class IshtarSiteProfile(models.Model, Cached):
def __unicode__(self):
return unicode(self.label)
+ def get_raw_css(self):
+ css = ''
+ for attr, css_name in (('base_color', 'operation'),
+ ('files_color', 'file'),
+ ('context_record_color', 'context-record'),
+ ('find_color', 'find'),
+ ('warehouse_color', 'warehouse')):
+ css += '''
+.menu-%s{
+ background-color: %s;
+}''' % (css_name, getattr(self, attr))
+ return css
+
def save(self, *args, **kwargs):
raw = False
if 'raw' in kwargs: