Commit 5e065c15a945f2e0e25bfcb9cb27a877013b1254

Authored by Gustavo
1 parent 78281dbd

Contrast choice included in the models

Showing 1 changed file with 6 additions and 6 deletions   Show diff stats
themes/models.py
@@ -5,7 +5,7 @@ from django.contrib.staticfiles.templatetags.staticfiles import static @@ -5,7 +5,7 @@ from django.contrib.staticfiles.templatetags.staticfiles import static
5 5
6 def validate_img_extension(value): 6 def validate_img_extension(value):
7 valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png'] 7 valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png']
8 - 8 +
9 if hasattr(value.file, 'content_type'): 9 if hasattr(value.file, 'content_type'):
10 if not value.file.content_type in valid_formats: 10 if not value.file.content_type in valid_formats:
11 raise ValidationError(_('File not supported.')) 11 raise ValidationError(_('File not supported.'))
@@ -16,7 +16,7 @@ class Themes(models.Model): @@ -16,7 +16,7 @@ class Themes(models.Model):
16 small_logo = models.ImageField(verbose_name = _("Small Logo"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension]) 16 small_logo = models.ImageField(verbose_name = _("Small Logo"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension])
17 large_logo = models.ImageField(verbose_name = _("Large Logo"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension]) 17 large_logo = models.ImageField(verbose_name = _("Large Logo"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension])
18 footer_note = models.TextField(_("Footer Note"), blank = True) 18 footer_note = models.TextField(_("Footer Note"), blank = True)
19 - css_style = models.CharField(_("Css Style"), max_length = 50, default = "green", choices = (("green", _('Green')), ("red", _('Red')), ("black", _('Black')))) 19 + css_style = models.CharField(_("Css Style"), max_length = 50, default = "green", choices = (("green", _('Green')),("contrast",_('Contrast')),("red", _('Red')), ("black", _('Black'))))
20 20
21 class Meta: 21 class Meta:
22 verbose_name = _("Theme") 22 verbose_name = _("Theme")
@@ -30,7 +30,7 @@ class Themes(models.Model): @@ -30,7 +30,7 @@ class Themes(models.Model):
30 if self.favicon and hasattr(self.favicon, 'url'): 30 if self.favicon and hasattr(self.favicon, 'url'):
31 if path.exists(self.favicon.path): 31 if path.exists(self.favicon.path):
32 return self.favicon.url 32 return self.favicon.url
33 - 33 +
34 return static('img/favicon_amadeus.png') 34 return static('img/favicon_amadeus.png')
35 35
36 @property 36 @property
@@ -38,7 +38,7 @@ class Themes(models.Model): @@ -38,7 +38,7 @@ class Themes(models.Model):
38 if self.small_logo and hasattr(self.small_logo, 'url'): 38 if self.small_logo and hasattr(self.small_logo, 'url'):
39 if path.exists(self.small_logo.path): 39 if path.exists(self.small_logo.path):
40 return self.small_logo.url 40 return self.small_logo.url
41 - 41 +
42 return static('img/logo_pequena_amadeus.png') 42 return static('img/logo_pequena_amadeus.png')
43 43
44 @property 44 @property
@@ -46,5 +46,5 @@ class Themes(models.Model): @@ -46,5 +46,5 @@ class Themes(models.Model):
46 if self.large_logo and hasattr(self.large_logo, 'url'): 46 if self.large_logo and hasattr(self.large_logo, 'url'):
47 if path.exists(self.large_logo.path): 47 if path.exists(self.large_logo.path):
48 return self.large_logo.url 48 return self.large_logo.url
49 -  
50 - return static('img/logo_grande_amadeus.png')  
51 \ No newline at end of file 49 \ No newline at end of file
  50 +
  51 + return static('img/logo_grande_amadeus.png')