From ad181790972378338688bad66071ee10e100b8f5 Mon Sep 17 00:00:00 2001 From: Zambom Date: Thu, 12 Jan 2017 19:01:11 -0200 Subject: [PATCH] Applying logo selections --- amadeus/static/img/amadeus.png | Bin 108026 -> 0 bytes amadeus/static/img/favicon_amadeus.png | Bin 0 -> 48824 bytes amadeus/static/img/logo_grande_amadeus.png | Bin 0 -> 108026 bytes amadeus/static/img/logo_pequena_amadeus.png | Bin 0 -> 990 bytes amadeus/static/img/topo-amadeus-white.png | Bin 990 -> 0 bytes amadeus/static/img/topo-amadeus.png | Bin 48824 -> 0 bytes amadeus/static/js/themes.js | 1 + amadeus/templates/base.html | 4 ++-- themes/forms.py | 1 + themes/models.py | 22 ++++++++++++++++++++++ users/templates/users/forgot_password.html | 2 +- users/templates/users/login.html | 2 +- users/templates/users/new_password.html | 2 +- users/templates/users/register.html | 2 +- 14 files changed, 30 insertions(+), 6 deletions(-) delete mode 100755 amadeus/static/img/amadeus.png create mode 100755 amadeus/static/img/favicon_amadeus.png create mode 100755 amadeus/static/img/logo_grande_amadeus.png create mode 100755 amadeus/static/img/logo_pequena_amadeus.png delete mode 100755 amadeus/static/img/topo-amadeus-white.png delete mode 100755 amadeus/static/img/topo-amadeus.png diff --git a/amadeus/static/img/amadeus.png b/amadeus/static/img/amadeus.png deleted file mode 100755 index 151ffe0..0000000 Binary files a/amadeus/static/img/amadeus.png and /dev/null differ diff --git a/amadeus/static/img/favicon_amadeus.png b/amadeus/static/img/favicon_amadeus.png new file mode 100755 index 0000000..86b99de Binary files /dev/null and b/amadeus/static/img/favicon_amadeus.png differ diff --git a/amadeus/static/img/logo_grande_amadeus.png b/amadeus/static/img/logo_grande_amadeus.png new file mode 100755 index 0000000..151ffe0 Binary files /dev/null and b/amadeus/static/img/logo_grande_amadeus.png differ diff --git a/amadeus/static/img/logo_pequena_amadeus.png b/amadeus/static/img/logo_pequena_amadeus.png new file mode 100755 index 0000000..d50a8b5 Binary files /dev/null and b/amadeus/static/img/logo_pequena_amadeus.png differ diff --git a/amadeus/static/img/topo-amadeus-white.png b/amadeus/static/img/topo-amadeus-white.png deleted file mode 100755 index d50a8b5..0000000 Binary files a/amadeus/static/img/topo-amadeus-white.png and /dev/null differ diff --git a/amadeus/static/img/topo-amadeus.png b/amadeus/static/img/topo-amadeus.png deleted file mode 100755 index 86b99de..0000000 Binary files a/amadeus/static/img/topo-amadeus.png and /dev/null differ diff --git a/amadeus/static/js/themes.js b/amadeus/static/js/themes.js index 53664ef..78f16a8 100644 --- a/amadeus/static/js/themes.js +++ b/amadeus/static/js/themes.js @@ -13,6 +13,7 @@ function Init() { common = $(".common-file-input"); // file select + fav.on("change", FileSelectHandler); small.on("change", FileSelectHandler); large.on("change", FileSelectHandler); diff --git a/amadeus/templates/base.html b/amadeus/templates/base.html index 198fd1a..03de742 100644 --- a/amadeus/templates/base.html +++ b/amadeus/templates/base.html @@ -12,7 +12,7 @@ - + @@ -74,7 +74,7 @@ - + {{ theme.title }} diff --git a/themes/forms.py b/themes/forms.py index 5a74c1d..af0142b 100644 --- a/themes/forms.py +++ b/themes/forms.py @@ -4,6 +4,7 @@ from django import forms from .models import Themes class BasicElemetsForm(forms.ModelForm): + MAX_UPLOAD_SIZE = 2*1024*1024 def clean_favicon(self): image = self.cleaned_data.get('favicon', False) diff --git a/themes/models.py b/themes/models.py index 964225e..6d4d5cf 100644 --- a/themes/models.py +++ b/themes/models.py @@ -1,5 +1,6 @@ from django.db import models from django.utils.translation import ugettext_lazy as _ +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'] @@ -22,3 +23,24 @@ class Themes(models.Model): def __str__(self): return self.title + + @property + def favicon_url(self): + if self.favicon and hasattr(self.favicon, 'url'): + return self.favicon.url + else: + return static('img/favicon_amadeus.png') + + @property + def small_logo_url(self): + if self.small_logo and hasattr(self.small_logo, 'url'): + return self.small_logo.url + else: + return static('img/logo_pequena_amadeus.png') + + @property + def large_logo_url(self): + if self.large_logo and hasattr(self.large_logo, 'url'): + return self.large_logo.url + else: + return static('img/logo_grande_amadeus.png') \ No newline at end of file diff --git a/users/templates/users/forgot_password.html b/users/templates/users/forgot_password.html index b4279eb..2a69f27 100644 --- a/users/templates/users/forgot_password.html +++ b/users/templates/users/forgot_password.html @@ -15,7 +15,7 @@ {% block content %}
- +
diff --git a/users/templates/users/login.html b/users/templates/users/login.html index 87707c3..cebb14c 100644 --- a/users/templates/users/login.html +++ b/users/templates/users/login.html @@ -15,7 +15,7 @@ {% block content %}
- +
diff --git a/users/templates/users/new_password.html b/users/templates/users/new_password.html index 34246e8..56d960b 100644 --- a/users/templates/users/new_password.html +++ b/users/templates/users/new_password.html @@ -15,7 +15,7 @@ {% block content %}
- +
diff --git a/users/templates/users/register.html b/users/templates/users/register.html index 53783ea..823fb18 100644 --- a/users/templates/users/register.html +++ b/users/templates/users/register.html @@ -15,7 +15,7 @@ {% block content %}
- +
-- libgit2 0.21.2