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