From bf143778419aa21c5bd17a92336a560ee1ab5505 Mon Sep 17 00:00:00 2001 From: SDE Date: Tue, 1 Aug 2023 19:18:00 +0300 Subject: [PATCH] 0.1.15 change support urls --- AuthApp/js_urls.py | 2 +- AuthApp/js_views.py | 6 ++---- ChatServiceApp/js_views.py | 5 +++++ static/js/user_profile(boris).js | 4 ++-- static/js/user_profile.js | 2 +- .../{b_new_msg_to_support.html => b_support_tickets.html} | 0 6 files changed, 11 insertions(+), 8 deletions(-) rename templates/blocks/profile/{b_new_msg_to_support.html => b_support_tickets.html} (100%) diff --git a/AuthApp/js_urls.py b/AuthApp/js_urls.py index 5a15a85..00a21a8 100644 --- a/AuthApp/js_urls.py +++ b/AuthApp/js_urls.py @@ -17,7 +17,7 @@ urlpatterns = [ path('subscribe/', subscribe_ajax, name='subscribe_ajax'), path('new_msg_to_user/', new_msg_to_user_ajax, name='new_msg_to_user' ), - path('new_msg_to_support/', new_msg_to_support_ajax, name='new_msg_to_support_ajax'), + path('support_tickets/', support_tickets_ajax, name='support_tickets_ajax'), path('change_profile/', change_profile_ajax, name='change_profile_ajax'), diff --git a/AuthApp/js_views.py b/AuthApp/js_views.py index 6d7f532..06476f6 100644 --- a/AuthApp/js_views.py +++ b/AuthApp/js_views.py @@ -36,20 +36,18 @@ def new_msg_to_user_ajax(request): return JsonResponse({'html': html}, status=200) @login_required(login_url='/profile/login/') -def new_msg_to_support_ajax(request): +def support_tickets_ajax(request): if request.method != 'POST': raise Http404 Dict = { } - html = render_to_string('blocks/profile/b_new_msg_to_support.html', Dict, request=request) + html = render_to_string('blocks/profile/b_support_tickets.html', Dict, request=request) return JsonResponse({'html': html}, status=200) - - @login_required(login_url='/profile/login/') def change_profile_ajax(request): if request.method != 'POST': diff --git a/ChatServiceApp/js_views.py b/ChatServiceApp/js_views.py index 1df758a..df9d7b0 100644 --- a/ChatServiceApp/js_views.py +++ b/ChatServiceApp/js_views.py @@ -12,6 +12,11 @@ from datetime import datetime from django.template.loader import render_to_string from django.urls import reverse + + + + + @login_required(login_url='/profile/login/') def support_create_ticket_form_ajax(request): from ChatServiceApp.forms import TicketForm diff --git a/static/js/user_profile(boris).js b/static/js/user_profile(boris).js index 33a47df..1a9c1b5 100644 --- a/static/js/user_profile(boris).js +++ b/static/js/user_profile(boris).js @@ -55,7 +55,7 @@ function attachFileCreateTicket () { let data = file $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/user_account/support_create_ticket_ajax/', + url: '/ru/user_account/support_tickets/', type: "POST", // async: true, cache: false, @@ -82,7 +82,7 @@ function attachFilemeassge () { let data = file $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/user_account/support_create_ticket_ajax/', + url: '/ru/user_account/support_tickets/', type: "POST", // async: true, cache: false, diff --git a/static/js/user_profile.js b/static/js/user_profile.js index b7c119d..b147e80 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -24,7 +24,7 @@ function writeMessage(){ function technicalSupport(){ $.ajax({ headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() }, - url: '/ru/user_account/new_msg_to_support/', + url: '/ru/user_account/support_tickets/', type: "POST", // async: true, cache: false, diff --git a/templates/blocks/profile/b_new_msg_to_support.html b/templates/blocks/profile/b_support_tickets.html similarity index 100% rename from templates/blocks/profile/b_new_msg_to_support.html rename to templates/blocks/profile/b_support_tickets.html