Просмотр исходного кода

Добавлено удаление эскизов, Фон страниц Белый дым

Anastasia 10 лет назад
Родитель
Сommit
7670a71887
5 измененных файлов с 32 добавлено и 3 удалено
  1. BIN
      asuzr/static/del.png
  2. BIN
      asuzr/static/rubbish.png
  3. 3 2
      record/urls.py
  4. 3 0
      templates/asuzr/base.html
  5. 26 1
      templates/asuzr/sketches.html

BIN
asuzr/static/del.png


BIN
asuzr/static/rubbish.png


+ 3 - 2
record/urls.py

@@ -20,7 +20,7 @@ urlpatterns = patterns('',
     url(r'^desreport/$', 'asuzr.views.desreport'),
     url(r'^production_table/(?P<order_id>\d+)/$', 'asuzr.views.production_table'),
     url(r'^sketches/(?P<order_id>\d+)/$', 'asuzr.views.sketches'),
-    url(r'^sketches/delete/$', 'asuzr.views.delete_sketch'),
+    url(r'^sketches/delete/$', 'asuzr.views.delete_sketch', name = 'asuzr-del-sketch'),
     url(r'^prodplan/$', 'asuzr.views.prod_plan_view'),
     url(r'^admin/', include(admin.site.urls)),
     url(r'^inplaceeditform/', include('inplaceeditform.urls')),
@@ -33,4 +33,5 @@ if settings.DEBUG:
     # static files (images, css, javascript, etc.)
     urlpatterns += patterns('',
         (r'^media/(?P<path>.*)$', 'django.views.static.serve', {
-        'document_root': settings.MEDIA_ROOT}))
+        'document_root': settings.MEDIA_ROOT})) 
+

+ 3 - 0
templates/asuzr/base.html

@@ -37,6 +37,9 @@
     .gray {
       color: lightgray;
     }
+    body {
+      background: #F5F5F5
+    }
  </style>
 </head>
 <body>

+ 26 - 1
templates/asuzr/sketches.html

@@ -1,15 +1,40 @@
 {% extends "asuzr/base.html" %}
 {% load thumbnail %}
+{% load staticfiles %}
 {% block page %}
 <style>
   #list li{
       list-style-type: none; /* Прячем исходные маркеры */
+      display: inline; /* Отображать как строчный элемент */
+      margin-right: 10px; /* Отступ слева */
+      padding: 5px; /* Поля вокруг текста */
   }
+  #sketch {
+      width: 200px;
+      margin: 0px;
+  }
+  #sketch li {
+      position: relative;
+  }
+  .sketch_img { 
+      display: inline-block;
+      width: 200px;
+      height: 200px;
+      z-index: 1;  
+  } 
+
+  .del_icon { 
+      display: inline-block;
+      z-index: 2;
+      margin-left: -30px;
+      width: 20px;
+      height: 20px;
+  } 
 </style>
  {% if sketch_list %}
  <ul id = "list">
   {% for sketch in sketch_list %} 
-    <li>  {% thumbnail sketch.sketch_file "200x200" crop="center" as im %} <a href = {{sketch.sketch_file.url}}> <img src = "{{ im.url }}"> </a>{% endthumbnail %} </li>
+    <li id="sketch"> {% thumbnail sketch.sketch_file "200x200" crop="center" as im %} <a class = "sketch_img" href = {{sketch.sketch_file.url}}> <img src = "{{ im.url }}"/> </a>{% endthumbnail %} <a class = "del_icon" title = "Удалить" href= "{% url 'asuzr-del-sketch' %}?pk={{sketch.id}}"><img  src = "{% static "del.png" %}"/></a></li>
   {% endfor %}
  </ul>
  {% endif %}