0.0.48 w route card
This commit is contained in:
@@ -6,6 +6,9 @@ from django.conf import settings
|
||||
from django.shortcuts import render
|
||||
|
||||
from uuid import uuid1
|
||||
|
||||
from twisted.web.http import stringToDatetime
|
||||
|
||||
from .models import *
|
||||
from django.contrib import auth
|
||||
from django.http import HttpResponse, Http404, JsonResponse
|
||||
@@ -195,7 +198,9 @@ def edit_route_ajax(request):
|
||||
print(msg)
|
||||
return JsonResponse({'errors': msg})
|
||||
|
||||
html = render_to_string('blocks/profile/b_new_route.html', Dict, request=request)
|
||||
tpl_name = f'v2/blocks/b_create_{ route.owner_type }_route.html'
|
||||
|
||||
html = render_to_string(tpl_name, Dict, request=request)
|
||||
res_Dict = {
|
||||
'html': html,
|
||||
'btn_title': _('Сохранить изменения')
|
||||
|
||||
@@ -12,7 +12,8 @@ function changeRoute(el) {
|
||||
data: data,
|
||||
data_type: 'json',
|
||||
success: (res) => {
|
||||
|
||||
if (!res.html) return;
|
||||
$(".info_profile")[0].innerHTML = res.html;
|
||||
}, error: (res) => {
|
||||
|
||||
}
|
||||
@@ -45,7 +46,7 @@ function deleteRoute(el) {
|
||||
}
|
||||
|
||||
function raiseRoute(el) {
|
||||
if (!el) return;
|
||||
if (!el || el.dataset.actions_count === '0') return;
|
||||
let $parent = el.closest(".w_route_card")
|
||||
if (!$parent) return;
|
||||
|
||||
@@ -68,7 +69,7 @@ function raiseRoute(el) {
|
||||
}
|
||||
|
||||
function highlightRoute(el) {
|
||||
if (!el) return;
|
||||
if (!el || el.dataset.actions_count === '0') return;
|
||||
let $parent = el.closest(".w_route_card")
|
||||
if (!$parent) return;
|
||||
|
||||
|
||||
@@ -155,13 +155,13 @@
|
||||
<div class="route_btn_title">{% trans "Редактировать" %}</div>
|
||||
</div>
|
||||
<div class="container_actions_mobile">
|
||||
<div class="route_btn" style="--route-btn-height: fit-content;--route-btn-width: auto;" data-action="raise" onclick="raiseRoute(this)">
|
||||
<div class="route_btn" data-actions_count="{{ used_route_rising_count }}" style="--route-btn-height: fit-content;--route-btn-width: auto;" data-action="raise" onclick="raiseRoute(this)">
|
||||
<div class="route_btn_title">{% trans "Поднять" %}</div>
|
||||
<div class="route_btn_data">Осталось поднятий: 2</div>
|
||||
<div class="route_btn_data">Осталось поднятий: {{ used_route_rising_count }}</div>
|
||||
</div>
|
||||
<div class="route_btn" style="--route-btn-height: fit-content;--route-btn-width: auto;" data-action="highlight" onclick="highlightRoute(this)">
|
||||
<div class="route_btn" data-actions_count="{{ used_route_highlight_count }}" style="--route-btn-height: fit-content;--route-btn-width: auto;" data-action="highlight" onclick="highlightRoute(this)">
|
||||
<div class="route_btn_title">{% trans "Выделить цветом" %}</div>
|
||||
<div class="route_btn_data">Осталось выделений: 0</div>
|
||||
<div class="route_btn_data">Осталось выделений: {{ used_route_highlight_count }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="delete_route" onclick="deleteRoute(this)">{% trans "Удалить" %}</div>
|
||||
|
||||
Reference in New Issue
Block a user