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
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
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 | ... | ... |