From 1c17f1468db679ecfdfc4ea9ea8e93239477acc5 Mon Sep 17 00:00:00 2001 From: borissedw Date: Tue, 1 Aug 2023 17:26:22 +0300 Subject: [PATCH] 0.0.10 --- static/css/styles(boris).css | 27 +++++++--- static/js/user_profile(boris).js | 10 +++- templates/blocks/profile/b_create_ticket.html | 54 ++++++++++--------- 3 files changed, 57 insertions(+), 34 deletions(-) diff --git a/static/css/styles(boris).css b/static/css/styles(boris).css index 054a738..1943d90 100644 --- a/static/css/styles(boris).css +++ b/static/css/styles(boris).css @@ -86,17 +86,25 @@ width: 100%; } - -.el-form-create-ticket{ +.el-form-create-ticket-select{ + height: 62px; width: 100%; - height: 50px; filter: drop-shadow(-1px 4px 10px rgba(198, 199, 203, 0.20)) drop-shadow(0px -1px 10px rgba(198, 199, 203, 0.20)); border-radius: 3px; - margin-bottom: 20px; + margin-bottom: 5px; + padding: 20px; +} + +.el-form-create-ticket{ + width: calc(100% - 40px); + height: 20px; + filter: drop-shadow(-1px 4px 10px rgba(198, 199, 203, 0.20)) drop-shadow(0px -1px 10px rgba(198, 199, 203, 0.20)); + border-radius: 3px; + margin-bottom: 5px; /*min-width: unset;*/ /*max-width: unset;*/ /*min-height: unset;*/ - /*padding: 10px;*/ + padding: 20px; } /*.el-form-create-ticket:last-child{*/ @@ -110,9 +118,14 @@ .el-form-create-ticket-textarea{ min-height: 200px; - min-width: 100%; - max-width: 100%; + min-width: calc(100% - 40px); + max-width: calc(100% - 40px); resize: none; + padding: 20px; +} + +.container-input-form-create-ticket{ + margin-bottom: 20px; } .el-form-create-ticket-textarea:focus-visible{ diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index fa332db..da35a2d 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -98,11 +98,12 @@ function attachFilemeassge () { } function createTicket (el) { + event.preventDefault() let form = el.form - let formData = new formData (form) + var formData = new FormData(form); $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/user_account/support_create_ticket_ajax/', + url: '/ru/messages/create_ticket/', type: "POST", // async: true, cache: false, @@ -115,5 +116,10 @@ function createTicket (el) { document.querySelector(".insert-tech-place").innerHTML = data.html; }, + error: function (data){ + + document.querySelector(".insert-tech-place").innerHTML = data.responseJSON.html; + + } }); } diff --git a/templates/blocks/profile/b_create_ticket.html b/templates/blocks/profile/b_create_ticket.html index c497cd1..199b676 100644 --- a/templates/blocks/profile/b_create_ticket.html +++ b/templates/blocks/profile/b_create_ticket.html @@ -4,32 +4,36 @@ {% if errors.all__ %}
{{ errors.all__ }}
{% endif %} {% csrf_token %} - - {% if form.errors.department %}
{{ form.errors.department }}
{% endif %} - - {% if form.errors.name %}
{{ form.errors.name }}
{% endif %} - -
0/500
- - {% if form.errors.text %}
{{ form.errors.text }}
{% endif %} - +
+ + {% if form.errors.department %}
{{ form.errors.department }}
{% endif %} +
+
+ + {% if form.errors.name %}
{{ form.errors.name }}
{% endif %} +
+
+
0/500
+ + {% if form.errors.text %}
{{ form.errors.text }}
{% endif %} +
- + {# #}