0.1.6
edit route url
This commit is contained in:
@@ -18,7 +18,7 @@ urlpatterns = [
|
||||
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_create_ticket_ajax/', support_create_ticket_ajax, name='support_create_ticket_ajax'),
|
||||
|
||||
|
||||
path('change_profile/', change_profile_ajax, name='change_profile_ajax'),
|
||||
]
|
||||
@@ -47,19 +47,7 @@ def new_msg_to_support_ajax(request):
|
||||
return JsonResponse({'html': html}, status=200)
|
||||
|
||||
|
||||
@login_required(login_url='/profile/login/')
|
||||
def support_create_ticket_ajax(request):
|
||||
from ChatServiceApp.forms import CreateTicketForm
|
||||
|
||||
if request.method != 'POST':
|
||||
raise Http404
|
||||
|
||||
Dict = {
|
||||
'forms': CreateTicketForm()
|
||||
}
|
||||
|
||||
html = render_to_string('blocks/profile/b_create_ticket.html', Dict, request=request)
|
||||
return JsonResponse({'html': html}, status=200)
|
||||
|
||||
|
||||
@login_required(login_url='/profile/login/')
|
||||
|
||||
13
ChatServiceApp/js_urls.py
Normal file
13
ChatServiceApp/js_urls.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# coding=utf-8
|
||||
from django.urls import path
|
||||
# from AuthApp.js_views import *
|
||||
# from AuthApp.import_funcs import *
|
||||
from .js_views import *
|
||||
from django.contrib.auth import views
|
||||
from RoutesApp.js_views import new_route_view_ajax
|
||||
|
||||
urlpatterns = [
|
||||
path('support_create_ticket_ajax/', support_create_ticket_ajax, name='support_create_ticket_ajax'),
|
||||
# path('create_/', registration_ajax, name='registration_ajax'),
|
||||
|
||||
]
|
||||
27
ChatServiceApp/js_views.py
Normal file
27
ChatServiceApp/js_views.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
from uuid import uuid1
|
||||
from .models import *
|
||||
from django.contrib import auth
|
||||
from django.http import HttpResponse, Http404, JsonResponse
|
||||
from django.template import loader, RequestContext
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from BaseModels.mailSender import techSendMail
|
||||
from django.utils.translation import gettext as _
|
||||
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_ajax(request):
|
||||
from ChatServiceApp.forms import CreateTicketForm
|
||||
|
||||
if request.method != 'POST':
|
||||
raise Http404
|
||||
|
||||
Dict = {
|
||||
'forms': CreateTicketForm()
|
||||
}
|
||||
|
||||
html = render_to_string('blocks/profile/b_create_ticket.html', Dict, request=request)
|
||||
return JsonResponse({'html': html}, status=200)
|
||||
@@ -21,7 +21,7 @@ def edit_route_ajax(request):
|
||||
if request.method != 'POST':
|
||||
raise Http404
|
||||
|
||||
data = request.POST
|
||||
data = request.body
|
||||
|
||||
Dict = {}
|
||||
|
||||
@@ -29,7 +29,7 @@ def edit_route_ajax(request):
|
||||
|
||||
if not 'route_id' in data:
|
||||
msg = f'Недостаточно данных'
|
||||
return {'errors': msg}
|
||||
return JsonResponse({'errors': msg})
|
||||
|
||||
route = Route.objects.get(data['route_id'])
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ urlpatterns += i18n_patterns(
|
||||
|
||||
path('user_account/', include('AuthApp.js_urls')),
|
||||
path('routes/', include('RoutesApp.js_urls')),
|
||||
path('messages/', include('ChatServiceApp.js_urls')),
|
||||
|
||||
path('reference_data/', include('ReferenceDataApp.js_urls')),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user