Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
|
|
||||||
elements_on_page = 2
|
elements_on_page = 4
|
||||||
|
|
||||||
def get_articles(art_kwargs, request_Data=None, from_el=None, to_el=None):
|
def get_articles(art_kwargs, request_Data=None, from_el=None, to_el=None):
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ def get_articles(art_kwargs, request_Data=None, from_el=None, to_el=None):
|
|||||||
elif to_el:
|
elif to_el:
|
||||||
arts = arts[:to_el]
|
arts = arts[:to_el]
|
||||||
else:
|
else:
|
||||||
to_el = 3
|
to_el = elements_on_page
|
||||||
arts = arts[:to_el]
|
arts = arts[:to_el]
|
||||||
|
|
||||||
last_block = False
|
last_block = False
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ from django.utils.translation import gettext as _
|
|||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
elements_on_page = 25
|
||||||
|
|
||||||
|
|
||||||
def get_profile_new_route_page_html(request, data):
|
def get_profile_new_route_page_html(request, data):
|
||||||
|
|
||||||
form = RouteForm()
|
form = RouteForm()
|
||||||
@@ -199,14 +202,17 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
elif to_el:
|
elif to_el:
|
||||||
routes = routes[:to_el]
|
routes = routes[:to_el]
|
||||||
else:
|
else:
|
||||||
to_el = 25
|
to_el = elements_on_page
|
||||||
routes = routes[:to_el]
|
routes = routes[:to_el]
|
||||||
|
|
||||||
last_block = False
|
last_block = False
|
||||||
if not to_el or to_el >= routes_count:
|
if not to_el or to_el >= routes_count:
|
||||||
last_block = True
|
last_block = True
|
||||||
|
|
||||||
|
if routes_count - to_el > elements_on_page:
|
||||||
|
next_page_els_count = elements_on_page
|
||||||
|
else:
|
||||||
|
next_page_els_count = routes_count - to_el
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
@@ -232,7 +238,8 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
res_Dict.update({
|
res_Dict.update({
|
||||||
'routes': routes,
|
'routes': routes,
|
||||||
'last_block': last_block,
|
'last_block': last_block,
|
||||||
'last_el': to_el
|
'last_el': to_el,
|
||||||
|
'next_page_els_count': next_page_els_count
|
||||||
})
|
})
|
||||||
return res_Dict
|
return res_Dict
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,8 @@ def find_routes_ajax(request):
|
|||||||
|
|
||||||
res_Dict = {
|
res_Dict = {
|
||||||
'html': html,
|
'html': html,
|
||||||
'last_block': routes_Dict['last_block']
|
'last_block': routes_Dict['last_block'],
|
||||||
|
'next_page_els_count': routes_Dict['next_page_els_count'],
|
||||||
# 'form': RouteForm(initial=data)
|
# 'form': RouteForm(initial=data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ def route_search_results_View(request):
|
|||||||
'show_filter_and_results': True,
|
'show_filter_and_results': True,
|
||||||
'owner_type': data['owner_type'],
|
'owner_type': data['owner_type'],
|
||||||
'last_el': routes_Dict['last_el'],
|
'last_el': routes_Dict['last_el'],
|
||||||
'page_type': 'routes'
|
'page_type': 'routes',
|
||||||
|
'next_page_els_count': routes_Dict['next_page_els_count'],
|
||||||
}
|
}
|
||||||
if 'from_address_point_txt' in routes_Dict:
|
if 'from_address_point_txt' in routes_Dict:
|
||||||
data.update({'from_address_point_txt': routes_Dict['from_address_point_txt']})
|
data.update({'from_address_point_txt': routes_Dict['from_address_point_txt']})
|
||||||
|
|||||||
@@ -376,7 +376,7 @@
|
|||||||
margin: 0 0 120px 0;
|
margin: 0 0 120px 0;
|
||||||
/*justify-content: center;*/
|
/*justify-content: center;*/
|
||||||
}
|
}
|
||||||
.news_item {
|
.news_item, .news_item_static {
|
||||||
margin-bottom: 40px;
|
margin-bottom: 40px;
|
||||||
width: 49%;
|
width: 49%;
|
||||||
}
|
}
|
||||||
@@ -1373,6 +1373,17 @@
|
|||||||
float: none;
|
float: none;
|
||||||
/*margin-left: 25px;*/
|
/*margin-left: 25px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.previous_next_news{
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.news_item, .news_item_static{
|
||||||
|
width: 490px;
|
||||||
|
margin: 0 auto 30px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@media (max-width: 850px){
|
@media (max-width: 850px){
|
||||||
|
|
||||||
@@ -1607,6 +1618,14 @@
|
|||||||
.phones_carrier{
|
.phones_carrier{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.previous_next_news>.news_item_static{
|
||||||
|
margin: unset;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
.news_item, .news_item_static{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
.first-line-card-carrier{
|
.first-line-card-carrier{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
@@ -1637,13 +1656,7 @@
|
|||||||
margin-bottom: unset;
|
margin-bottom: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.previous_next_news{
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.previous_next_news>.news_item:nth-child(2){
|
|
||||||
margin: unset;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.splitter-from-to-country{
|
.splitter-from-to-country{
|
||||||
margin-left: 7%;
|
margin-left: 7%;
|
||||||
@@ -1658,9 +1671,7 @@
|
|||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news_item{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.news_block_main{
|
.news_block_main{
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2722,7 +2722,11 @@ details[open] summary ~ *{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news_item {
|
.news_item_static{
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.news_item, .news_item_static {
|
||||||
width: 32%;
|
width: 32%;
|
||||||
margin-bottom: 2%;
|
margin-bottom: 2%;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
@@ -2731,6 +2735,7 @@ details[open] summary ~ *{
|
|||||||
height: 460px;
|
height: 460px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.news_item>a>div{
|
.news_item>a>div{
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
@@ -2746,6 +2751,21 @@ details[open] summary ~ *{
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.news_item_static>a>div{
|
||||||
|
margin: 20px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.news_item_static>div{
|
||||||
|
margin: 10px;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.news_item_static>a{
|
||||||
|
color: black;
|
||||||
|
height: 460px;
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.news_img>img{
|
.news_img>img{
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
@@ -2906,6 +2926,10 @@ details[open] summary ~ *{
|
|||||||
margin: 0 20px;
|
margin: 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.self_news_text{
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
<div class="previous_next_news">
|
<div class="previous_next_news">
|
||||||
{% for item in arts_top %}
|
{% for item in arts_top %}
|
||||||
|
|
||||||
|
|
||||||
<div class="news_item">
|
<div class="news_item">
|
||||||
<a href="{% url "article_one" item.url %}">
|
<a href="{% url "article_one" item.url %}">
|
||||||
<div class="news_img"><img src="{{ MEDIA_URL }}{{ item.picture }}" /></div>
|
<div class="news_img"><img src="{{ MEDIA_URL }}{{ item.picture }}" /></div>
|
||||||
@@ -39,9 +40,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#<div>{{ art.text|safe }}</div>#}
|
{#<div>{{ art.text|safe }}</div>#}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<div class="news_item">
|
<div class="news_item_static">
|
||||||
|
|
||||||
<div class="news_img"><img src="{{ MEDIA_URL }}{{ art.picture }}" /></div>
|
<div class="news_img"><img src="{{ MEDIA_URL }}{{ art.picture }}" /></div>
|
||||||
<div class="news_header">{{ art.name }}</div>
|
<div class="news_header">{{ art.name }}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user