Skip to content

Commit

Permalink
#728 Change page display call to the new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
duker33 committed Feb 15, 2019
1 parent 88ffbe7 commit db448d4
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 26 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ user-agents==1.1.0
sorl-thumbnail==12.5.0
python-telegram-bot==11.1.0
https://github.com/selwin/django-user_agents/archive/master.zip
https://github.com/fidals/refarm-site/archive/0.4.32.zip
# https://github.com/fidals/refarm-site/archive/0.4.32.zip
git+https://github.com/fidals/refarm-site@se728_display_module#egg=refarm-site
2 changes: 1 addition & 1 deletion templates/catalog/catalog.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% block content %}
{% breadcrumbs_with_siblings page %}
<h1>{{ page.display_h1 }}</h1>
<h1>{{ page.display.h1 }}</h1>

<ul class="catalog-list">
{% recursetree nodes %}
Expand Down
6 changes: 3 additions & 3 deletions templates/catalog/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% block content %}
{% breadcrumbs_with_siblings page %}
<h1 class="category-title" data-name="{{ category.name }}">{{ page.display_h1|capfirst }}</h1>
<h1 class="category-title" data-name="{{ category.name }}">{{ page.display.h1|capfirst }}</h1>

<div class="row overflow-anchor-control">
<div class="col-md-3 category-left-block">
Expand All @@ -22,9 +22,9 @@ <h1 class="category-title" data-name="{{ category.name }}">{{ page.display_h1|ca
</div>

<div class="col-md-9 category-right view-mode-{{ view_type }}" id="category-right">
{% if page.display_seo_text and paginated.page.number == 1 %}
{% if page.display.seo_text and paginated.page.number == 1 %}
{% autoescape off %}
<div class="hidden-xs hidden-sm category-text" id="category-text">{{ page.display_seo_text }}</div>
<div class="hidden-xs hidden-sm category-text" id="category-text">{{ page.display.seo_text }}</div>
{% endautoescape %}
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion templates/catalog/category_products.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</a>
</div>
<div class="product-card-price">{{ product.price|humanize_price }} руб / шт</div>
<meta property="description" itemprop="description" content="{{ product.page.display_description }}">
<meta property="description" itemprop="description" content="{{ product.page.display.description }}">
<meta property="price" itemprop="price" content="{{ product.price }}">
<meta property="priceCurrency" itemprop="priceCurrency" content="RUB">
<div class="stock">
Expand Down
4 changes: 2 additions & 2 deletions templates/catalog/product.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% block content %}
<div itemscope itemtype="https://schema.org/Product" class="page-product custom-checkbox">
<p class="hidden" itemprop="description">
{% with description=product.page.display_description %}
{% with description=product.page.display.description %}
{% if description %}
{{ description }}
{% else %}
Expand All @@ -22,7 +22,7 @@
</div>

{% breadcrumbs_with_siblings page %}
<h1 class="product-h1" itemprop="name">{{ page.display_h1 }}</h1>
<h1 class="product-h1" itemprop="name">{{ page.display.h1 }}</h1>
<span class="product-article">Арт. {{ product.vendor_code }}</span>

<div class="product-top">
Expand Down
2 changes: 1 addition & 1 deletion templates/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>Интернет-магазин элементов питания "ShopElect

{# Three news links #}
{% include 'index/services.html' %}
{% include 'layout/toggle_content.html' with content=page.display_seo_text %}
{% include 'layout/toggle_content.html' with content=page.display.seo_text %}
</div>
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions templates/layout/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
{% for root in root_categories %}
<li class="mobile-catalog-list-item js-mobile-menu-item">
<a class="mobile-catalog-link" href="{{ root.url }}">
{{ root.page.display_menu_title }}
{{ root.page.display.menu_title }}
<i class="fa fa-chevron-down mobile-catalog-link-icon js-mobile-link-arrow"
aria-hidden="true"></i>
</a>
Expand All @@ -165,7 +165,7 @@
{% for child in root.get_children %}
<li>
<a class="mobile-catalog-sub-link" href="{{ child.url }}">
{{ child.page.display_menu_title }}
{{ child.page.display.menu_title }}
</a>
</li>
{% endfor %}
Expand Down
12 changes: 6 additions & 6 deletions templates/layout/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load se_extras %}

<meta charset="UTF-8">
<title>{{ page.display_title }}</title>
<title>{{ page.display.title }}</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#1d5d87">
Expand All @@ -15,13 +15,13 @@
<meta name="robots" content="index, follow">
{% endif %}

<meta name="keywords" content="{{ page.display_keywords }}">
<meta name="description" content="{{ page.display_description }}">
<meta property="og:title" content="{{ page.display_title }}">
<meta name="keywords" content="{{ page.display.keywords }}">
<meta name="description" content="{{ page.display.description }}">
<meta property="og:title" content="{{ page.display.title }}">
<meta property="og:url" content="{{ page.url }}">
<meta property="og:article:published_time" content="{{ page.date_published|date:'d.m.Y' }}">
<meta property="og:name" content="{{ page.display_title }}">
<meta property="og:description" content="{% if page.display_description %}{{ page.display_description }}{% else %}{{ page.content|striptags }}{% endif %}">
<meta property="og:name" content="{{ page.display.title }}">
<meta property="og:description" content="{% if page.display.description %}{{ page.display.description }}{% else %}{{ page.content|striptags }}{% endif %}">
<meta property="og:image" content="{% main_image_or_logo page %}">

<meta property="og:site_name" content="ShopElectro">
Expand Down
4 changes: 2 additions & 2 deletions templates/layout/tile_products.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p class="stuff-top-title text-center">{{ tile_title }}</p>
{% for product in tile_products %}
<p class="hidden" itemprop="description">
{% with description=product.page.display_description %}
{% with description=product.page.display.description %}
{% if description %}
{{ description }}
{% else %}
Expand All @@ -33,7 +33,7 @@
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="stuff-top-price-new">
<link itemprop="availability" href="https://schema.org/InStock">
<meta itemprop="description" content="{{ product.page.display_description }}">
<meta itemprop="description" content="{{ product.page.display.description }}">
<meta itemprop="priceCurrency" content="RUB" />
<span itemprop="price">{{ product.price|humanize_price }}</span> руб
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>

<div class="col-sm-9 right-col">
<h1>{{ page.display_h1 }}</h1>
<h1>{{ page.display.h1 }}</h1>
{% if page.type != 'navigation' and page.date_published %}
<p class="date-pub-article">
{{ page.date_published|date:'d.m.Y' }}
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/pages.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% for page in pages %}
<div class="news-small">
<a class="caption-pub" href="{{ page.get_absolute_url }}">{{ page.display_h1 }}</a>
<a class="caption-pub" href="{{ page.get_absolute_url }}">{{ page.display.h1 }}</a>
<p class="date-pub">{{ page.date_published|date:'d.m.Y' }}</p>
<p class="news-intro">
{{ page.content|striptags|truncatechars:230 }}
Expand Down
4 changes: 2 additions & 2 deletions templates/pages/sitemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

{% block content %}
<div class="container">
<h1>{{ page.display_h1 }}</h1>
<h1>{{ page.display.h1 }}</h1>

<ul class="catalog-list">
{% for page in paginator_pages|dictsort:'display_h1' %}
<li class="catalog-list-item">
<a href="{{ page.url }}">{{ page.display_h1 }}</a>
<a href="{{ page.url }}">{{ page.display.h1 }}</a>
</li>
{% endfor %}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions templates/prices/price.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
{% if product.price > shop.local_delivery_cost %}<local_delivery_cost>0</local_delivery_cost>{% endif %}
<name>{{ product.name }}</name>
{% comment "Description in an issue #257" %}
{% if product.page.display_description and not utm == 'GM' %}
<description>{{ product.page.display_description }}</description>
{% if product.page.display.description and not utm == 'GM' %}
<description>{{ product.page.display.description }}</description>
{% endif %}
{% endcomment %}
<description></description>
Expand Down
2 changes: 1 addition & 1 deletion templates/search/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% block content %}
{% include 'pages/breadcrumbs.html' %}
<h1 class="heading-h1">{{ page.display_h1 }}</h1>
<h1 class="heading-h1">{{ page.display.h1 }}</h1>

{% for item in items %}
<div class="search-result-item">
Expand Down

0 comments on commit db448d4

Please sign in to comment.