0.0.69
This commit is contained in:
@@ -51,7 +51,7 @@ def edit_route_ajax(request):
|
|||||||
print(msg)
|
print(msg)
|
||||||
return JsonResponse({'errors': msg})
|
return JsonResponse({'errors': msg})
|
||||||
|
|
||||||
html = render_to_string('blocks/profile/b_new_route2.html', Dict, request=request)
|
html = render_to_string('blocks/profile/b_new_route.html', Dict, request=request)
|
||||||
return JsonResponse({'html': html}, status=200)
|
return JsonResponse({'html': html}, status=200)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -227,10 +227,15 @@ function onblurInputField(event,el){
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
function sendRoute(el){
|
function sendRoute(el, routeID = null){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
let route_obj = {
|
||||||
|
'route_id': routeID
|
||||||
|
}
|
||||||
let form = el.form;
|
let form = el.form;
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
|
let data = new Object([route_obj, formData])
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||||
@@ -241,7 +246,7 @@ function sendRoute(el){
|
|||||||
processData: false,
|
processData: false,
|
||||||
contentType: false,
|
contentType: false,
|
||||||
// enctype: 'json',
|
// enctype: 'json',
|
||||||
data: formData,
|
data: JSON.stringify(data),
|
||||||
success: function(data){
|
success: function(data){
|
||||||
console.log('data received')
|
console.log('data received')
|
||||||
// location.href = '/profile'
|
// location.href = '/profile'
|
||||||
|
|||||||
@@ -295,7 +295,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="button_register">
|
<div class="button_register">
|
||||||
<button id="registration" onclick="sendRoute(this)"> Разместить объявления </button>
|
<button id="registration" onclick="sendRoute(this, {{ route.id }})"> Разместить объявления </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user