Commit ad181790972378338688bad66071ee10e100b8f5
1 parent
d7895551
Exists in
master
and in
3 other branches
Applying logo selections
Showing
14 changed files
with
30 additions
and
6 deletions
Show diff stats
amadeus/static/img/amadeus.png
105 KB
47.7 KB
105 KB
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,6 +13,7 @@ function Init() { | ||
13 | common = $(".common-file-input"); | 13 | common = $(".common-file-input"); |
14 | 14 | ||
15 | // file select | 15 | // file select |
16 | + fav.on("change", FileSelectHandler); | ||
16 | small.on("change", FileSelectHandler); | 17 | small.on("change", FileSelectHandler); |
17 | large.on("change", FileSelectHandler); | 18 | large.on("change", FileSelectHandler); |
18 | 19 |
amadeus/templates/base.html
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <script type="text/javascript" src="{% static 'js/jquery-ui.js' %}"></script> | 12 | <script type="text/javascript" src="{% static 'js/jquery-ui.js' %}"></script> |
13 | 13 | ||
14 | <meta http-equiv="Cache-Control" content="no-cache, no-store" /> | 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 | <!-- Roboto font --> | 16 | <!-- Roboto font --> |
17 | <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css"> | 17 | <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css"> |
18 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | 18 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
@@ -74,7 +74,7 @@ | @@ -74,7 +74,7 @@ | ||
74 | <span class="icon-bar"></span> | 74 | <span class="icon-bar"></span> |
75 | </button> | 75 | </button> |
76 | <a class="navbar-brand" href="{% url 'subjects:home' %}"> | 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 | <span class="pull-right project_name">{{ theme.title }}</span> | 78 | <span class="pull-right project_name">{{ theme.title }}</span> |
79 | </a> | 79 | </a> |
80 | </div> | 80 | </div> |
themes/forms.py
@@ -4,6 +4,7 @@ from django import forms | @@ -4,6 +4,7 @@ from django import forms | ||
4 | from .models import Themes | 4 | from .models import Themes |
5 | 5 | ||
6 | class BasicElemetsForm(forms.ModelForm): | 6 | class BasicElemetsForm(forms.ModelForm): |
7 | + MAX_UPLOAD_SIZE = 2*1024*1024 | ||
7 | 8 | ||
8 | def clean_favicon(self): | 9 | def clean_favicon(self): |
9 | image = self.cleaned_data.get('favicon', False) | 10 | image = self.cleaned_data.get('favicon', False) |
themes/models.py
1 | from django.db import models | 1 | from django.db import models |
2 | from django.utils.translation import ugettext_lazy as _ | 2 | from django.utils.translation import ugettext_lazy as _ |
3 | +from django.contrib.staticfiles.templatetags.staticfiles import static | ||
3 | 4 | ||
4 | def validate_img_extension(value): | 5 | def validate_img_extension(value): |
5 | valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png'] | 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,3 +23,24 @@ class Themes(models.Model): | ||
22 | 23 | ||
23 | def __str__(self): | 24 | def __str__(self): |
24 | return self.title | 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 | \ No newline at end of file | 47 | \ No newline at end of file |
users/templates/users/forgot_password.html
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | {% block content %} | 15 | {% block content %} |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-lg-offset-1 col-md-offset-1"> | 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 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | 21 |
users/templates/users/login.html
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | {% block content %} | 15 | {% block content %} |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-lg-offset-1 col-md-offset-1"> | 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 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | 21 |
users/templates/users/new_password.html
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | {% block content %} | 15 | {% block content %} |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-lg-offset-1 col-md-offset-1"> | 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 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | 21 |
users/templates/users/register.html
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | {% block content %} | 15 | {% block content %} |
16 | <div class="row"> | 16 | <div class="row"> |
17 | <div class="col-lg-offset-1 col-md-offset-1"> | 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 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | 21 |