[chronojump-server] New delete image method and some css changes



commit 229e9153cb1338e42ca21f26ab3febec0a0ac8ea
Author: Max Ros i Morejon <mros33 gmail com>
Date:   Fri Apr 26 10:47:38 2019 +0200

    New delete image method and some css changes

 .../organizations/groups/group_players_list.html     |  7 ++++---
 .../templates/organizations/gyms/gym_detail.html     |  7 ++++---
 .../organizations/players/add_edit_player_form.html  |  4 ++--
 .../organizations/players/players_list.html          | 20 ++++++--------------
 .../chronojump_networks/templates/pages/index.html   |  4 ++--
 5 files changed, 18 insertions(+), 24 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 bc64fc6..1a50ecf 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
@@ -15,15 +15,16 @@
 {% csrf_token %}
 
 <div class="page-header row">
-  <div class="col-sm-9">
+  <div class="col-sm-8">
     {% if user.organization.image %}
         <img src="../../../media/{{ user.organization.image }}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% else %}
         <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}}  <small class="text-muted" style="font-size:32px">{% trans 'Players 
and tasks' %}</small></h1>
+    <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>
   </div>
-  <div class="col-sm-3">
+  <div class="col-sm-4">
     <dl class="row" style="margin-top:10px">
       <dt class="col-sm-4 text-right">{% trans 'Responsible' %}:</dt>
       <dd class="col-sm-8">{{ group.responsible.name }}</dd>
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 81c2e33..9769553 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/gyms/gym_detail.html
@@ -15,15 +15,16 @@
 {% csrf_token %}
 
 <div class="page-header row">
-  <div class="col-sm-9">
+  <div class="col-sm-8">
     {% if user.organization.image %}
         <img src="../../../media/{{ user.organization.image }}" class="img-fluid float-left" width="48px" 
height="48px" style="margin-top:12px;margin-right:10px;" />
     {% else %}
         <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}}  <small class="text-muted" style="font-size:32px">{% trans 'Stations 
and exercises' %}</small></h1>
+    <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>
   </div>
-  <div class="col-sm-3">
+  <div class="col-sm-4">
     <dl class="row" style="margin-top:10px">
       <dt class="col-sm-4 text-right">{% trans 'Responsible' %}:</dt>
       <dd class="col-sm-8">{{ gym.responsible.name }}</dd>
diff --git 
a/chronojumpserver-django/chronojump_networks/templates/organizations/players/add_edit_player_form.html 
b/chronojumpserver-django/chronojump_networks/templates/organizations/players/add_edit_player_form.html
index ce4d3aa..6dff114 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/players/add_edit_player_form.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/players/add_edit_player_form.html
@@ -22,8 +22,8 @@
                             height:100%; object-fit: contain">
                         </div>
                         <div>
-                                <input id="chkId" type="checkbox" name="clearImg" value="ClearImg">
-                                <label for="chkId">Clear image</label>
+                                <!--input id="clearImgId" type="button" name="clearImg" value="ClearImg"-->
+                                <button class="btn btn-outline-secondary" type="button" 
id="btn_delete_image">Delete Image</button>
                                                </div>
                                                <div class="form-group col-sm-4">
                                                        <p>
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 0175a66..84f05e6 100644
--- a/chronojumpserver-django/chronojump_networks/templates/organizations/players/players_list.html
+++ b/chronojumpserver-django/chronojump_networks/templates/organizations/players/players_list.html
@@ -230,7 +230,7 @@
       $('#input_rfid').val('');
       $('#id_image').val(null);
       $('#imgView').prop("src", 'http://localhost:8000/static/images/default_player.png');
-      $('#chkId').prop("checked", false);
+      $('#btn_delete_image').prop("checked", false);
       image_pl = 'http://localhost:8000/static/images/default_player.png';
     }
     
@@ -275,21 +275,13 @@
             console.log(new_img);
         });
         $("#imgView").prop("src", new_img.path);*/
-        $('#chkId').prop("checked",false);
         image_changed = "True";
     })
     
-    $('#chkId').on('change', function() {
-        if(this.checked) {
-            $('#id_image').val(null);
-            $('#imgView').prop("src", "http://localhost:8000/static/images/default_player.png";);
-            image_changed = "True";
-            console.log("canvi checked");
-        }
-        else {
-            $('#imgView').prop("src", image_pl);
-            image_changed = "False";
-        }
+    $('#btn_delete_image').on('click', function() {
+        $('#id_image').val(null);
+        $('#imgView').prop("src", "http://localhost:8000/static/images/default_player.png";);
+        image_changed = "True";
     })
     
      // Get all the values in the form into json object 
@@ -330,7 +322,7 @@
       $('#imgView').prop("src", player.image);
       $('#id_image').val(player.image.name);
       image_pl = player.image;
-      $('#chkId').prop("checked", false);
+      $('#btn_delete_image').prop("checked", false);
     }
     
     function putPlayer(player) {
diff --git a/chronojumpserver-django/chronojump_networks/templates/pages/index.html 
b/chronojumpserver-django/chronojump_networks/templates/pages/index.html
index 5731321..1603fc3 100644
--- a/chronojumpserver-django/chronojump_networks/templates/pages/index.html
+++ b/chronojumpserver-django/chronojump_networks/templates/pages/index.html
@@ -71,7 +71,7 @@
     <div class="row buttons" >
       {% for group in user.groups_by_coach.all %}
         <div class="col-sm-6 col-md-4">
-          <a class="btn btn-outline-info btn-block font-weight-bold text-uppercase" href="{% url 
'organizations:group_players_list' organization_id=user.organization.id group_id=group.group.id 
%}">{{group.group.name}}</a>
+          <a class="btn btn-outline-info btn-block font-weight-bold text-uppercase" href="{% url 
'organizations:group_players_list' organization_id=user.organization.id group_id=group.group.id %}" 
style="white-space:normal;">{{group.group.name}}</a>
         </div>
       {% endfor %}
     </div>
@@ -82,7 +82,7 @@
     <div class="row buttons" >
         {% for gym in user.organization.gyms.all %}
         <div class="col-sm-6 col-md-4">
-          <a class="btn btn-outline-warning btn-block font-weight-bold text-uppercase" href="{% url 
'organizations:gym_detail' organization_id=user.organization.id gym_id=gym.id %}">{{gym.name}}</a>
+          <a class="btn btn-outline-warning btn-block font-weight-bold text-uppercase" href="{% url 
'organizations:gym_detail' organization_id=user.organization.id gym_id=gym.id %}" 
style="white-space:normal;">{{gym.name}}</a>
         </div>
         {% endfor %}
     </div>


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