0.12.32 fix switch langs

This commit is contained in:
SDE
2024-04-08 18:08:05 +03:00
parent ad1db581a7
commit 607a0f8245
3 changed files with 40 additions and 36 deletions

View File

@@ -78,7 +78,7 @@ def del_amp_symbols(value):
@stringfilter
def del_lang_from_path(value):
path_list = value.split('/')
path = '/' + '/'.join(path_list[2:])
path = '/' + '/'.join(path_list[4:])
# for i in path_list[1:]:
# path.join(i + '/')

View File

@@ -19,7 +19,9 @@ from GeneralApp.funcs import get_inter_http_respose
def route_search_results_View(request):
Dict = {}
data = None
data = {}
try:
if request.GET:
data = request.GET.dict()
@@ -58,3 +60,5 @@ def route_search_results_View(request):
t = loader.get_template('pages/p_results_find_route.html')
return get_inter_http_respose(t, Dict, request)
# return HttpResponse(t.render(Dict, request))
except Exception as e:
raise Http404

View File

@@ -49,8 +49,8 @@
<div onclick="showLang(this)" class="dropdown_lang">
<div id="dropbtn_lang" class="dropbtn_lang">RU</div>
<div class="dropdown-content-lang">
<a id="ru_lang" href="/ru{{ request.path|del_lang_from_path }}">RU</a>
<a id="en_lang" href="/en{{ request.path|del_lang_from_path }}">EN</a>
<a id="ru_lang" href="/ru{{ request.build_absolute_uri|del_lang_from_path }}">RU</a>
<a id="en_lang" href="/en{{ request.build_absolute_uri|del_lang_from_path }}">EN</a>
</div>
</div>
</div>