[chronojump-server] changing static images system



commit a2bf33ed7acbfa08b148bb985a90109f4ea77eed
Author: Max Ros i Morejon <mros33 gmail com>
Date:   Fri May 3 12:39:08 2019 +0200

    changing static images system

 .../templates/organizations/groups/group_players_list.html     |  4 ++--
 .../templates/organizations/gyms/gym_detail.html               |  2 +-
 .../templates/organizations/organization_detail.html           |  2 +-
 .../templates/organizations/players/players_list.html          | 10 +++++-----
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git 
a/chronojumpserver-django/chronojump_networks/templates/organizations/groups/group_players_list.html 
b/chronojumpserver-django/chronojump_networks/templates/organizations/groups/group_players_list.html
index 4a926ef..fc2639f 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/groups/group_players_list.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/groups/group_players_list.html
@@ -19,7 +19,7 @@
     {% if user.organization.image %}
         <img src="{{MEDIA_URL}}{{ user.organization.image }}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% else %}
-        <img src="{{STATIC_URL}}/images/logo_club.png" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
+        <img src="{% static 'images/logo_club.png' %}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% endif %}
     <h1 class="display-4">{{group.name}}  </h1>
     <h1 class="display-4"> <small class="text-muted" style="font-size:32px">{% trans 'Players and tasks' 
%}</small></h1>
@@ -133,7 +133,7 @@
                                        var src = value;
                                } else {
                                        // Otherwise show the no_image icon
-                                       var src = '/static/images/no_image.png';
+                                       var src = "{% static 'images/no_image.png' %}";
                                }
                                var html = '<img src="' + src + '" class="img-fluid rounded" width="32px" 
height="32px"/>';
                                return html;
diff --git a/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html 
b/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
index 021d076..6a27fde 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
@@ -19,7 +19,7 @@
     {% if user.organization.image %}
         <img src="{{MEDIA_URL}}{{ user.organization.image }}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% else %}
-        <img src="{{STATIC_URL}}/images/logo_club.png" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
+        <img src="{% static 'images/logo_club.png' %}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% endif %}
     <h1 class="display-4">{{gym.name}} </h1>
     <h1 class="display-4"> <small class="text-muted" style="font-size:32px">{% trans 'Stations and 
exercises' %}</small></h1>
diff --git a/chronojumpserver-django/chronojump_networks/templates/organizations/organization_detail.html 
b/chronojumpserver-django/chronojump_networks/templates/organizations/organization_detail.html
index 8183709..d4b7c73 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/organization_detail.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/organization_detail.html
@@ -13,7 +13,7 @@
       {% if object.image %}
         <img src="/media/{{ object.image }}" alt="Logo Club"/>
       {% else %}
-        <img src="../static/images/logo_club.png" alt="Logo Club"/>
+        <img src="{% static 'images/logo_club.png' %}" alt="Logo Club"/>
       {% endif %}
       <ul>
       {% for coach in object.coaches.all %}
diff --git a/chronojumpserver-django/chronojump_networks/templates/organizations/players/players_list.html 
b/chronojumpserver-django/chronojump_networks/templates/organizations/players/players_list.html
index ca7ce38..9382ad0 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/players/players_list.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/players/players_list.html
@@ -19,7 +19,7 @@
     {% if user.organization.image %}
         <img src="{{MEDIA_URL}}{{ user.organization.image }}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% else %}
-        <img src="{{STATIC_URL}}/images/logo_club.png" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
+        <img src="{% static 'images/logo_club.png' %}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% endif %}
     <h1 class="display-4">{% trans 'Players list' %}</h1>
   </div>
@@ -87,7 +87,7 @@
                                        var src = value;
                                } else {
                                        // Otherwise show the default player icon
-                                       var src = '{{STATIC_URL}}/images/default_player.png';
+                                       var src = "{% static 'images/default_player.png' %}";
                                }
                                var html = '<img src="' + src + '" class="img-fluid rounded" width="32px" 
height="32px"/>';
                                return html;
@@ -229,8 +229,8 @@
       $('#number').val('');
       $('#input_rfid').val('');
       $('#id_image').val(null);
-      $('#imgView').prop("src", 'http://localhost:8000/static/images/default_player.png');
-      image_pl = 'http://localhost:8000/static/images/default_player.png';
+      $('#imgView').prop("src", "{% static 'images/default_player.png' %}");
+      image_pl = "{% static 'images/default_player.png' %}";
     }
     
     $('#btn_read_rfid').click(function() {
@@ -271,7 +271,7 @@
     
     $('#btn_delete_image').on('click', function() {
         $('#id_image').val(null);
-        $('#imgView').prop("src", "http://localhost:8000/static/images/default_player.png";);
+        $('#imgView').prop("src", "{% static 'images/default_player.png' %}");
         image_changed = "True";
     })
     


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]