diff --git a/amadeus/static/img/alto_contraste_logo_amadeus.png b/amadeus/static/img/alto_contraste_logo_amadeus.png new file mode 100644 index 0000000..a5c8481 Binary files /dev/null and b/amadeus/static/img/alto_contraste_logo_amadeus.png differ diff --git a/links/migrations/0009_auto_20170920_2122.py b/links/migrations/0009_auto_20170920_2122.py new file mode 100644 index 0000000..8b1831c --- /dev/null +++ b/links/migrations/0009_auto_20170920_2122.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.4 on 2017-09-21 00:22 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('links', '0008_remove_link_description_brief'), + ] + + operations = [ + migrations.AlterField( + model_name='link', + name='link_url', + field=models.CharField(max_length=250, verbose_name='Link_URL'), + ), + ] diff --git a/themes/migrations/0001_initial.py b/themes/migrations/0001_initial.py index e28f996..acf866a 100644 --- a/themes/migrations/0001_initial.py +++ b/themes/migrations/0001_initial.py @@ -21,6 +21,7 @@ class Migration(migrations.Migration): ('title', models.CharField(default='Projeto Amadeus', max_length=200, verbose_name='Title')), ('small_logo', models.ImageField(blank=True, default='logo_pequena_amadeus.png', upload_to='themes/', validators=[themes.models.validate_img_extension], verbose_name='Small Logo')), ('large_logo', models.ImageField(blank=True, default='logo_grande_amadeus.png', upload_to='themes/', validators=[themes.models.validate_img_extension], verbose_name='Large Logo')), + ('high_contrast_logo', models.ImageField(blank=True, default='alto_contraste_logo_amadeus.png', upload_to='themes/', validators=[themes.models.validate_img_extension], verbose_name='High Contrast Logo')), ('footer_note', models.TextField(blank=True, verbose_name='Footer Note')), ('css_style', models.CharField(default='green', max_length=50, verbose_name='Css Style')), ], diff --git a/themes/migrations/0007_themes_high_contrats_logo.py b/themes/migrations/0007_themes_high_contrats_logo.py new file mode 100644 index 0000000..1af3ee8 --- /dev/null +++ b/themes/migrations/0007_themes_high_contrats_logo.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.4 on 2017-09-21 00:22 +from __future__ import unicode_literals + +from django.db import migrations, models +import themes.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('themes', '0006_auto_20170610_1512'), + ] + + operations = [ + migrations.AddField( + model_name='themes', + name='high_contrats_logo', + field=models.ImageField(blank=True, null=True, upload_to='themes/', validators=[themes.models.validate_img_extension], verbose_name='High Contrast Logo'), + ), + ] diff --git a/themes/migrations/0008_auto_20170920_2123.py b/themes/migrations/0008_auto_20170920_2123.py new file mode 100644 index 0000000..cca1659 --- /dev/null +++ b/themes/migrations/0008_auto_20170920_2123.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.4 on 2017-09-21 00:23 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('themes', '0007_themes_high_contrats_logo'), + ] + + operations = [ + migrations.RenameField( + model_name='themes', + old_name='high_contrats_logo', + new_name='high_contrast_logo', + ), + ] diff --git a/themes/models.py b/themes/models.py index e511b11..2ba57a4 100644 --- a/themes/models.py +++ b/themes/models.py @@ -15,6 +15,7 @@ class Themes(models.Model): favicon = models.ImageField(verbose_name = _("Favicon"), blank = True, null = True, upload_to = 'themes/', validators = [validate_img_extension]) 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]) + high_contrast_logo = models.ImageField(verbose_name = _("High Contrast 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')),("contrast",_('Contrast')),("red", _('Red')), ("black", _('Black')))) @@ -48,3 +49,11 @@ class Themes(models.Model): return self.large_logo.url return static('img/logo_grande_amadeus.png') + + @property + def high_contrast_logo_url(self): + if self.high_contrast_logo and hasattr(self.high_contrast_logo, 'url'): + if path.exists(self.high_contrast_logo.path): + return self.high_contrast_logo.url + + return static('img/alto_contraste_logo_amadeus.png') diff --git a/users/templates/users/forgot_password.html b/users/templates/users/forgot_password.html index 646ba4e..a351549 100644 --- a/users/templates/users/forgot_password.html +++ b/users/templates/users/forgot_password.html @@ -15,7 +15,11 @@ {% block content %}