from organization.pages.models import *
from organization.core.admin import *
from organization.pages.admin import PageImageInline, PageBlockInline, PagePlaylistInline
+from organization.shop.models import PageProductList
class OrganizationPlaylistInline(TabularDynamicInlineAdmin):
list_display = ['name', 'admin_thumb']
+class PageProductListInline(TabularDynamicInlineAdmin):
+
+ model = PageProductList
+
+
class DepartmentPageAdmin(PageAdmin):
- inlines = [PageImageInline, PageBlockInline, PagePlaylistInline, ]
+ inlines = [PageImageInline, PageBlockInline, PagePlaylistInline, PageProductListInline, ]
class DepartmentAdmin(BaseTranslationModelAdmin):
class TeamPageAdmin(PageAdmin):
- inlines = [PageImageInline, PageBlockInline, PagePlaylistInline, ]
+ inlines = [PageImageInline, PageBlockInline, PagePlaylistInline, PageProductListInline, ]
class PersonAdminBase(BaseTranslationModelAdmin):
</div>
</div>
{% endif %}
+{% endblock %}
+{% block products %}
+ {% if page.departmentpage.product_lists.all|length > 0 %}
+ {% for page_product_list in page.departmentpage.product_lists.all %}
+ {% with page_product_list.list as list %}
+ {% with "shop/includes/product_list_"|add:list.style|add:"_style.html" as template %}
+ {% include template %}
+ {% endwith %}
+ {% endwith %}
+ {% endfor %}
+ {% endif %}
{% endblock %}
{% block logo %}
{% endblock %}
{% block products %}
-{% if page.teampage.product_lists.all %}
- <h4>{% trans "Products" %}</h4>
- {% for page_product_list in page.teampage.product_lists.all %}
- {% with page_product_list.list as list %}
- {% with "shop/includes/product_list_"|add:list.style|add:"_style.html" as template %}
- {% include template %}
- {% endwith %}
- {% endwith %}
- {% endfor %}
-{% endif %}
+ {% if page.teampage.product_lists.all|length > 0 %}
+ {% for page_product_list in page.teampage.product_lists.all %}
+ {% with page_product_list.list as list %}
+ {% with "shop/includes/product_list_"|add:list.style|add:"_style.html" as template %}
+ {% include template %}
+ {% endwith %}
+ {% endwith %}
+ {% endfor %}
+ {% endif %}
{% endblock %}
+
{% block logo %}
{% with page.teampage.images.all|get_type:'logo' as images %}
{% if images %}