Commit ad181790972378338688bad66071ee10e100b8f5

Authored by Zambom
1 parent d7895551

Applying logo selections

amadeus/static/img/amadeus.png

105 KB

amadeus/static/img/favicon_amadeus.png 0 → 100755

47.7 KB

amadeus/static/img/logo_grande_amadeus.png 0 → 100755

105 KB

amadeus/static/img/logo_pequena_amadeus.png 0 → 100755

990 Bytes

amadeus/static/img/topo-amadeus-white.png

990 Bytes

amadeus/static/img/topo-amadeus.png

47.7 KB

amadeus/static/js/themes.js
... ... @@ -13,6 +13,7 @@ function Init() {
13 13 common = $(".common-file-input");
14 14  
15 15 // file select
  16 + fav.on("change", FileSelectHandler);
16 17 small.on("change", FileSelectHandler);
17 18 large.on("change", FileSelectHandler);
18 19  
... ...
amadeus/templates/base.html
... ... @@ -12,7 +12,7 @@
12 12 <script type="text/javascript" src="{% static 'js/jquery-ui.js' %}"></script>
13 13  
14 14 <meta http-equiv="Cache-Control" content="no-cache, no-store" />
15   - <link href="{% static 'img/topo-amadeus.png' %}" rel="shortcut icon" />
  15 + <link href="{{ theme.favicon }}" rel="shortcut icon" />
16 16 <!-- Roboto font -->
17 17 <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
18 18 <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
... ... @@ -74,7 +74,7 @@
74 74 <span class="icon-bar"></span>
75 75 </button>
76 76 <a class="navbar-brand" href="{% url 'subjects:home' %}">
77   - <img class="logo pull-left" src="{% static 'img/topo-amadeus-white.png' %}" alt="Logo" />
  77 + <img class="logo pull-left" src="{{ theme.small_logo_url }}" alt="Logo" />
78 78 <span class="pull-right project_name">{{ theme.title }}</span>
79 79 </a>
80 80 </div>
... ...
themes/forms.py
... ... @@ -4,6 +4,7 @@ from django import forms
4 4 from .models import Themes
5 5  
6 6 class BasicElemetsForm(forms.ModelForm):
  7 + MAX_UPLOAD_SIZE = 2*1024*1024
7 8  
8 9 def clean_favicon(self):
9 10 image = self.cleaned_data.get('favicon', False)
... ...
themes/models.py
1 1 from django.db import models
2 2 from django.utils.translation import ugettext_lazy as _
  3 +from django.contrib.staticfiles.templatetags.staticfiles import static
3 4  
4 5 def validate_img_extension(value):
5 6 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):
22 23  
23 24 def __str__(self):
24 25 return self.title
  26 +
  27 + @property
  28 + def favicon_url(self):
  29 + if self.favicon and hasattr(self.favicon, 'url'):
  30 + return self.favicon.url
  31 + else:
  32 + return static('img/favicon_amadeus.png')
  33 +
  34 + @property
  35 + def small_logo_url(self):
  36 + if self.small_logo and hasattr(self.small_logo, 'url'):
  37 + return self.small_logo.url
  38 + else:
  39 + return static('img/logo_pequena_amadeus.png')
  40 +
  41 + @property
  42 + def large_logo_url(self):
  43 + if self.large_logo and hasattr(self.large_logo, 'url'):
  44 + return self.large_logo.url
  45 + else:
  46 + return static('img/logo_grande_amadeus.png')
25 47 \ No newline at end of file
... ...
users/templates/users/forgot_password.html
... ... @@ -15,7 +15,7 @@
15 15 {% block content %}
16 16 <div class="row">
17 17 <div class="col-lg-offset-1 col-md-offset-1">
18   - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block logo-login logo-register" alt="logo amadeus">
  18 + <img src="{{ theme.large_logo_url }}" class="img-responsive center-block logo-login logo-register" alt="logo amadeus">
19 19 </div>
20 20 </div>
21 21  
... ...
users/templates/users/login.html
... ... @@ -15,7 +15,7 @@
15 15 {% block content %}
16 16 <div class="row">
17 17 <div class="col-lg-offset-1 col-md-offset-1">
18   - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block logo-login " alt="logo amadeus">
  18 + <img src="{{ theme.large_logo_url }}" class="img-responsive center-block logo-login " alt="logo amadeus">
19 19 </div>
20 20 </div>
21 21  
... ...
users/templates/users/new_password.html
... ... @@ -15,7 +15,7 @@
15 15 {% block content %}
16 16 <div class="row">
17 17 <div class="col-lg-offset-1 col-md-offset-1">
18   - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block logo-login logo-register" alt="logo amadeus">
  18 + <img src="{{ theme.large_logo_url }}" class="img-responsive center-block logo-login logo-register" alt="logo amadeus">
19 19 </div>
20 20 </div>
21 21  
... ...
users/templates/users/register.html
... ... @@ -15,7 +15,7 @@
15 15 {% block content %}
16 16 <div class="row">
17 17 <div class="col-lg-offset-1 col-md-offset-1">
18   - <img src="{% static 'img/amadeus.png' %}" class="img-responsive center-block logo-login logo-register" alt="logo amadeus">
  18 + <img src="{{ theme.large_logo_url }}" class="img-responsive center-block logo-login logo-register" alt="logo amadeus">
19 19 </div>
20 20 </div>
21 21  
... ...