1.1.11 funcs for raise and highlight routes
This commit is contained in:
@@ -228,7 +228,11 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
if key == 'to_el':
|
if key == 'to_el':
|
||||||
to_el = int(val)
|
to_el = int(val)
|
||||||
|
|
||||||
routes = Route.objects.filter(**kwargs).order_by('-departure_DT', '-arrival_DT', '-modifiedDT')
|
routes = Route.objects.filter(
|
||||||
|
**kwargs
|
||||||
|
).order_by(
|
||||||
|
'-rising_DT', '-departure_DT', '-arrival_DT', '-modifiedDT'
|
||||||
|
)
|
||||||
routes_count = routes.count()
|
routes_count = routes.count()
|
||||||
|
|
||||||
if from_el and to_el:
|
if from_el and to_el:
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ def highlight_route_ajax(request):
|
|||||||
route.highlight_color = '#FF0000'
|
route.highlight_color = '#FF0000'
|
||||||
route.save(update_fields=['highlight_color'])
|
route.save(update_fields=['highlight_color'])
|
||||||
|
|
||||||
|
from SubscribesApp.funcs import get_cur_user_subscribe
|
||||||
|
user_subscribe = get_cur_user_subscribe(request.user)
|
||||||
|
user_subscribe.used_route_highlight_count += 1
|
||||||
|
user_subscribe.save(update_fields=['used_route_highlight_count'])
|
||||||
|
|
||||||
Dict = {
|
Dict = {
|
||||||
'route': route,
|
'route': route,
|
||||||
}
|
}
|
||||||
@@ -82,6 +87,11 @@ def raise_route_ajax(request):
|
|||||||
route.rising_DT = datetime.now()
|
route.rising_DT = datetime.now()
|
||||||
route.save(update_fields=['rising_DT'])
|
route.save(update_fields=['rising_DT'])
|
||||||
|
|
||||||
|
from SubscribesApp.funcs import get_cur_user_subscribe
|
||||||
|
user_subscribe = get_cur_user_subscribe(request.user)
|
||||||
|
user_subscribe.used_route_rising_count += 1
|
||||||
|
user_subscribe.save(update_fields=['used_route_rising_count'])
|
||||||
|
|
||||||
return JsonResponse({'status': 'ok'})
|
return JsonResponse({'status': 'ok'})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
|
||||||
<div class="carrier-card" data-number-of-route="{{ route.id }}">
|
<div class="carrier-card"{% if route.highlight_color %} style="border: 5px solid {{ route.highlight_color }};"{% endif %} data-number-of-route="{{ route.id }}">
|
||||||
<div class="left-part-carrier-card">
|
<div class="left-part-carrier-card">
|
||||||
{# <div class="first-line-card-carrier">#}
|
{# <div class="first-line-card-carrier">#}
|
||||||
{# <div class="carrier-title">#}
|
{# <div class="carrier-title">#}
|
||||||
|
|||||||
Reference in New Issue
Block a user