diff --git a/project/customer/views/profile.py b/project/customer/views/profile.py index 27ca0e5..61a105d 100644 --- a/project/customer/views/profile.py +++ b/project/customer/views/profile.py @@ -118,7 +118,7 @@ def profile_edit(request): def tmp_upload(request): - SIZES = {'id_boss_sign': (159, 65), 'id_glavbuh_sign': (159, 65), 'id_stamp': (180, 180), 'id_logo': (351, 121)} + SIZES = {'id_boss_sign': (170, 65), 'id_glavbuh_sign': (170, 65), 'id_stamp': (170, 170), 'id_logo': (170, 170)} elm_id = request.REQUEST['elm_id'] file_ = request.FILES.values()[0] if not file_.content_type.startswith('image'): diff --git a/project/static/css/style.css b/project/static/css/style.css index 3371102..98cdf4c 100644 --- a/project/static/css/style.css +++ b/project/static/css/style.css @@ -607,6 +607,8 @@ tr.doc-row:hover {cursor:pointer;} #stamp .profile_field {width:170px;height:170px;cursor: pointer;} #logo .profile_field { width: 170px;height: 170px;margin-left: 30px;cursor: pointer;} .del_image {display:block;width:27px;height:20px;background:url(../img/icon-delete.png)7px center no-repeat;position:absolute;top:0;right:0;} +.del_image.hidden {display:none;} +.img_load {text-align:center;} .rel {position:relative;} .img_field {border:1px solid #f2f2f2;} .profile_btns {margin: 10px; padding:10px;} diff --git a/project/templates/customer/profile/edit.html b/project/templates/customer/profile/edit.html index 10e822f..518473e 100644 --- a/project/templates/customer/profile/edit.html +++ b/project/templates/customer/profile/edit.html @@ -369,7 +369,7 @@ {% endif %} {{ form.boss_sign.errors }} - +

Подпись руководителя

Подпись бухгалтера

-
-
- Печать и логотип -
-
- {% if form.stamp.value %} - {# если уже есть картинка, показать ее #} - {% else %} - - {% endif %} - -
-

Печать

-
-
+
{% endblock %} @@ -480,8 +480,9 @@ var this_id = $(this).closest('.img_load').attr('id'); var tmb_id = 'id_tmb_' + this_id.substring(3); $('#' + tmb_id).val(''); - $('#' + this_id + ' img').attr('src', '/static/img/upload-' + this_id + '.png'); + $('#' + this_id + ' img').attr('src', '{{ STATIC_URL }}/img/upload-' + this_id + '.png'); $('#' + this_id + '-clear_id').attr('checked', true); + $('#' + this_id + ' .del_image').hide(); }) var getPic = function(data){ @@ -489,6 +490,7 @@ var tmb_id = '#id_tmb_' + data['elm_id'].substring(3); $(elm_id + ' img').attr('src', data['pic']) $(tmb_id).val(data['full_pic']); + $(elm_id + ' .del_image').show(); } $('.img_load input[type=file]').on('change', function(e){