From 5e065c15a945f2e0e25bfcb9cb27a877013b1254 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 28 Apr 2017 00:18:25 -0300 Subject: [PATCH] Contrast choice included in the models --- themes/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/models.py b/themes/models.py index 3bf6e31..e511b11 100644 --- a/themes/models.py +++ b/themes/models.py @@ -5,7 +5,7 @@ from django.contrib.staticfiles.templatetags.staticfiles import static def validate_img_extension(value): valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png'] - + if hasattr(value.file, 'content_type'): if not value.file.content_type in valid_formats: raise ValidationError(_('File not supported.')) @@ -16,7 +16,7 @@ class Themes(models.Model): small_logo = models.ImageField(verbose_name = _("Small Logo"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension]) large_logo = models.ImageField(verbose_name = _("Large Logo"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension]) footer_note = models.TextField(_("Footer Note"), blank = True) - css_style = models.CharField(_("Css Style"), max_length = 50, default = "green", choices = (("green", _('Green')), ("red", _('Red')), ("black", _('Black')))) + css_style = models.CharField(_("Css Style"), max_length = 50, default = "green", choices = (("green", _('Green')),("contrast",_('Contrast')),("red", _('Red')), ("black", _('Black')))) class Meta: verbose_name = _("Theme") @@ -30,7 +30,7 @@ class Themes(models.Model): if self.favicon and hasattr(self.favicon, 'url'): if path.exists(self.favicon.path): return self.favicon.url - + return static('img/favicon_amadeus.png') @property @@ -38,7 +38,7 @@ class Themes(models.Model): if self.small_logo and hasattr(self.small_logo, 'url'): if path.exists(self.small_logo.path): return self.small_logo.url - + return static('img/logo_pequena_amadeus.png') @property @@ -46,5 +46,5 @@ class Themes(models.Model): if self.large_logo and hasattr(self.large_logo, 'url'): if path.exists(self.large_logo.path): return self.large_logo.url - - return static('img/logo_grande_amadeus.png') \ No newline at end of file + + return static('img/logo_grande_amadeus.png') -- libgit2 0.21.2