Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Удалил ненужные теги, добавил новые. Поправил ошибку пагинации. #5

Open
wants to merge 1 commit into
base: 2.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions project_name/custom_catalog/templatetags/custom_catalog_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,3 @@


register = template.Library()


@register.inclusion_tag('catalog/parts/block_cards.html', takes_context=True)
def show_block_cards(context):

""" Возвращает список разделов + список товаров """

obj = context.get('object')
items = get_sorted_content_objects(get_content_objects(obj.tree.get().get_children()))
sections, products = [], []
for item in items:
item_data = {
'title': item.title,
'get_absolute_url': item.get_absolute_url(),
'description': item.description,
'image': AttachmentImage.objects
.filter(object_id=item.id, content_type=ContentType.objects.get_for_model(item)).first()
}
if item.leaf:
products.append(item_data)
else:
sections.append(item_data)

context['object_list'] = sections + products
return context
20 changes: 0 additions & 20 deletions project_name/custom_pages/templatetags/custom_pages_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,6 @@ def show_block_gallery(context, key='all'):
return context


@register.inclusion_tag('pages/parts/block_cards.html', takes_context=True)
def show_block_cards(context):

""" Возвращает список дочерних страниц """

context['object_list'] = []
obj = context.get("current_page")

for page in obj.get_children().filter(status=Page.PUBLISHED):

context['object_list'].append({
'title': page.title(),
'description': page.get_content(LANG, 'description'),
'image': AttachmentImage.objects
.filter(object_id=page.id, content_type=PAGE_CT).first(),
'get_absolute_url': page.get_absolute_url()
})
return context


@register.inclusion_tag('catalog/parts/block_cards.html', takes_context=True)
def show_block_products(context):

Expand Down
Empty file.
Empty file.
56 changes: 0 additions & 56 deletions project_name/management/commands/init_catalog.py

This file was deleted.

90 changes: 0 additions & 90 deletions project_name/management/utils.py

This file was deleted.

2 changes: 0 additions & 2 deletions project_name/templates/catalog/product.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@
</div>
</section>

{% show_block_content object.main_content %}

{% endblock %}
4 changes: 0 additions & 4 deletions project_name/templates/catalog/root.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@

{% block content %}

{% show_block_content object.main_content %}

<div>
{% for obj in object.root_sections %}
{% include 'catalog/parts/card.html' %}
{% endfor %}
</div>

{% show_block_content object.bottom_content %}

{% endblock %}
6 changes: 0 additions & 6 deletions project_name/templates/catalog/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,5 @@

{% block content %}

{% show_block_content object.main_content %}

{% show_block_cards %}

{% show_block_content object.bottom_content %}

{% endblock %}

3 changes: 0 additions & 3 deletions project_name/templates/easy_news/news_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@

{% block content %}
<div>{{ object.date|date:"d.m.Y" }} </div>

{% show_block_content object.main_content %}

{% endblock %}
2 changes: 0 additions & 2 deletions project_name/templates/easy_news/root.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

{% block content %}

{% show_block_content object.main_content %}

{% show_block_news %}

{% endblock %}
Expand Down
2 changes: 0 additions & 2 deletions project_name/templates/pages/contacts.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
{% block content %}

{% placeholder main_content with TinyMCE label 'Контент страницы' as main_content %}
{% show_block_content main_content %}

{% placeholder map with LargeTextarea label 'Скрипт карты' as map %}
{{ map|safe }}

{% placeholder bottom_content with TinyMCE label 'Контент внизу страницы' as bottom_content %}
{% show_block_content bottom_content %}

{% endblock %}
2 changes: 0 additions & 2 deletions project_name/templates/pages/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
{% placeholder description with LargeTextarea label 'Короткое описание' as description %}
{% placeholder main_content with TinyMCE label 'Контент страницы' as main_content %}

{% show_block_content main_content %}

{% show_block_gallery %}

{% endblock %}
2 changes: 0 additions & 2 deletions project_name/templates/pages/frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@

{% placeholder main_content with TinyMCE label 'Контент страницы' as main_content %}

{% show_block_content main_content %}

{% endblock %}
6 changes: 0 additions & 6 deletions project_name/templates/pages/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@
{% placeholder main_content with TinyMCE label 'Контент страницы' as main_content %}
{% placeholder bottom_content with TinyMCE label 'Контент внизу страницы' as bottom_content %}

{% show_block_content main_content %}

{% show_block_cards %}

{% show_block_content bottom_content %}

{% endblock %}
2 changes: 0 additions & 2 deletions project_name/templates/service/base_404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

{% block content %}

{% show_block_content object.main_content %}

{% show_block_sitemap %}

{% endblock %}
2 changes: 0 additions & 2 deletions project_name/templates/service/base_500.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

{% block content %}

{% show_block_content object.main_content %}

{% endblock %}

{% block footer_nav %}
Expand Down
Loading