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

Avoided hardcoded values in RSS template #1012

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
161 changes: 0 additions & 161 deletions README.md

This file was deleted.

3 changes: 3 additions & 0 deletions shopelectro/management/commands/price.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def context(self) -> dict:
).products()

return {
'title': settings.CUSTOM_PAGES['index']['title'],
'description': settings.CUSTOM_PAGES['index']['description'],
'base_url': settings.BASE_URL,
'categories': categories,
'products': products,
Expand Down Expand Up @@ -221,3 +223,4 @@ def handle(self, *args, **options):
template_path='prices/price.rss',
)
]).create()
print('context',Context('GM').context())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant print

3 changes: 2 additions & 1 deletion shopelectro/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ def get_robots_content():
'slug': '',
'name': 'Интернет-магазин элементов питания "ShopElectro"',
'menu_title': 'Главная',
'title': 'Интернет-магазин Элементов питания с доставкой по России',
'title': 'Интернет-магазин элементов питания с доставкой по России',
'description': 'Элементы питания в СПб с доставкой по России - интернет магазин элементов питания ShopElectro',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'description': 'Элементы питания в СПб с доставкой по России - интернет магазин элементов питания ShopElectro',
'description': 'Элементы питания в СПб с доставкой по России - интернет-магазин элементов питания ShopElectro',

},
'sitemap': {
'slug': 'sitemap',
Expand Down
4 changes: 0 additions & 4 deletions templates/layout/tile_products.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
{% endwith %}
</a>

{% comment %}
@todo #971:60m Remove product tile cards code doubling.
Both in html templates and styles.
{% endcomment %}
<div class="stuff-top-description product-card-text">
<div class="stuff-top-wrap">
<a class="stuff-top-name js-browse-product"
Expand Down
8 changes: 2 additions & 6 deletions templates/prices/price.rss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
<channel>
{% comment %}
@todo #1004:30m Avoid hardcoded values in RSS template.
Take values like site's title and description from DB.
{% endcomment %}
<title>Интернет магазин Элементов питания с доставкой по России</title>
<title>{{ title }}</title>
<link>{{ base_url }}</link>
<description>Элементы питания в СПб с доставкой по России - интернет магазин элементов питания ShopElectro</description>
<description>{{ description }}</description>
{% for product in products %}
<item>
<title>{{ product.name }}</title>
Expand Down