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

Fix template minor issues #4281

Open
wants to merge 3 commits into
base: master
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/oscar/templates/oscar/catalogue/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h2>{% trans "Customer Reviews" %}</h2>
<ol class="list-unstyled review-list">
{% for review in product.reviews.approved.all|slice:":3" %}
<li>
{% include 'oscar/catalogue/partials/review.html' %}
{% include 'oscar/catalogue/reviews/partials/review.html' %}
</li>
{% endfor %}
</ol>
Expand Down
62 changes: 0 additions & 62 deletions src/oscar/templates/oscar/catalogue/partials/review.html

This file was deleted.

64 changes: 64 additions & 0 deletions src/oscar/templates/oscar/catalogue/reviews/partials/review.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{% load reviews_tags %}
{% load i18n %}

<article class="review">
{% with detail_url=review.get_absolute_url %}
<header>
<h3 class="star-rating {{ review.score|as_stars }}">
<span>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</span>
<a href="{{ detail_url }}">{{ review.title }}</a>
</h3>
</header>

<p>{{ review.body|striptags }}</p>

<p>
<small>
{% if review.user == user %}
{% blocktrans with review_date=review.date_created %}
Reviewed by you on {{ review_date }}
{% endblocktrans %}
{% else %}
{% blocktrans with name=review.reviewer_name review_date=review.date_created %}
Reviewed by <strong>{{ name }}</strong> on {{ review_date }}
{% endblocktrans %}
{% endif %}
| <a href="{{ detail_url }}">{% trans 'Permalink' %}</a>
</small>
</p>

{% if review|may_vote:user %}
<small>{% trans "Is this review helpful?" %}</small>
<form action="{% url 'catalogue:reviews-vote' product_slug=product.slug product_pk=product.pk pk=review.pk %}" method="post" class="vote_agree" >
{% csrf_token %}
<input type="hidden" name="delta" value="1"/>
<button type="submit" class="btn btn-success btn-sm" data-loading-text="{% trans 'Submitting...' %}">{% trans "Yes" %}</button>
</form>
<form action="{% url 'catalogue:reviews-vote' product_slug=product.slug product_pk=product.pk pk=review.pk %}" method="post">
{% csrf_token %}
<input type="hidden" name="delta" value="-1"/>
<button type="submit" class="btn btn-danger btn-sm" data-loading-text="{% trans 'Submitting...' %}">{% trans "No" %}</button>
</form>
{% endif %}

<p>
<small>
{% if review.has_votes %}
{% blocktrans with num_up_votes=review.num_up_votes count num_votes=review.total_votes %}
<strong>{{ num_up_votes }}</strong> of {{ num_votes }} customer found this useful
{% plural %}
<strong>{{ num_up_votes }}</strong> of {{ num_votes }} customers found this useful
{% endblocktrans %}
{% else %}
{% trans "This review has no votes." %}
{% endif %}
</small>
</p>
{% endwith %}
</article>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
{% block content %}
<section>
{% include 'oscar/catalogue/reviews/review_product.html' %}
{% include 'oscar/catalogue/partials/review.html' %}
{% include 'oscar/catalogue/reviews/partials/review.html' %}
</section>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<hr>

{% for review in reviews %}
{% include 'oscar/catalogue/partials/review.html' %}
{% include 'oscar/catalogue/reviews/partials/review.html' %}
{% endfor %}
{% include 'oscar/partials/pagination.html' %}

Expand Down
48 changes: 24 additions & 24 deletions src/oscar/templates/oscar/checkout/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,34 +118,34 @@ <h2>{% trans "Order contents" %}</h2>
{% for line in basket.all_lines %}
{% purchase_info_for_line request line as session %}
<div class="basket-items">
<div class="row">
<div class="col-sm-2">
<div class="image_container w-100">
{% with image=line.product.primary_image %}
{% with image=line.product.primary_image url=line.product.get_absolute_url %}
<div class="row">
<div class="col-sm-2">
<div class="image_container w-100">
{% oscar_thumbnail image.original "100x100" upscale=False as thumb %}
<a href="{{ form.instance.product.get_absolute_url }}">
<img src="{{ thumb.url }}" alt="{{ product.get_title }}" class="img-thumbnail w-auto mx-auto my-0">
<a href="{{ url }}">
<img src="{{ thumb.url }}" alt="{{ line.product.get_title }}" class="img-thumbnail w-auto mx-auto my-0">
</a>
{% endwith %}
</div>
</div>
<div class="col-sm-7">
<h3><a href="{{ url }}">{{ line.description }}</a></h3>
<span class="availability {{ session.availability.code }}">{{ session.availability.message }}</span>
</div>
<div class="col-sm-1 text-center">
{{ line.quantity }}
</div>
<div class="col-sm-2 text-right">
<p class="price_color">
{% if not show_tax_separately and line.is_tax_known %}
{{ line.line_price_incl_tax|currency:basket.currency }}
{% else %}
{{ line.line_price_excl_tax|currency:basket.currency }}
{% endif %}
</p>
</div>
</div>
<div class="col-sm-7">
<h3><a href="{{ line.product.get_absolute_url }}">{{ line.description }}</a></h3>
<span class="availability {{ session.availability.code }}">{{ session.availability.message }}</span>
</div>
<div class="col-sm-1 text-center">
{{ line.quantity }}
</div>
<div class="col-sm-2 text-right">
<p class="price_color">
{% if not show_tax_separately and line.is_tax_known %}
{{ line.line_price_incl_tax|currency:basket.currency }}
{% else %}
{{ line.line_price_excl_tax|currency:basket.currency }}
{% endif %}
</p>
</div>
</div>
{% endwith %}
</div>
{% endfor %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% load currency_filters i18n url_tags %}{% blocktrans with order_number=order.number %}Hello,
{% extends "oscar/communication/emails/base.txt" %}
{% load currency_filters i18n url_tags %}
{% block body %}
{% blocktrans with order_number=order.number %}Hello,

We are pleased to confirm your order {{ order_number }} has been received and
will be processed shortly.{% endblocktrans %}
Expand All @@ -23,3 +26,4 @@ will be processed shortly.{% endblocktrans %}
{% endif %}

{% blocktrans %}The team{% endblocktrans %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{% load i18n %}{% load url_tags %}{% if alert.user and alert.user.get_short_name %}{% blocktrans with name=alert.user.get_short_name %}Dear {{ name }},{% endblocktrans %}{% else %}{% trans "Hello," %}{% endif %}
{% extends "oscar/communication/emails/base.txt" %}
{% load i18n url_tags %}
{% block body %}
{% if alert.user and alert.user.get_short_name %}{% blocktrans with name=alert.user.get_short_name %}Dear {{ name }},{% endblocktrans %}{% else %}{% trans "Hello," %}{% endif %}
{% absolute_url site.domain alert.product.get_absolute_url as url %}
{% blocktrans with title=alert.product.get_title|safe url=url %}
We are happy to inform you that our product '{{ title }}' is back in stock:
Expand All @@ -12,3 +15,4 @@ receive any further email regarding this product.
Thanks for your interest,
The {{ site_name }} Team
{% endblocktrans %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load i18n %}
{% load url_tags %}
{% extends "oscar/communication/emails/base.txt" %}
{% load i18n url_tags %}
{% block body %}
{% absolute_url site.domain alert.get_confirm_url as confirm_url %}
{% absolute_url site.domain alert.get_cancel_url as cancel_url %}
{% blocktrans with title=alert.product.get_title|safe confirm_url=confirm_url cancel_url=cancel_url %}
Expand All @@ -15,3 +16,4 @@ You can cancel this alert at any time by clicking the following link:
Thanks for your interest,
The {{ site }} Team
{% endblocktrans %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
{% load i18n %}<p>{% trans 'Thank you for registering.' %}</p>
{% extends "oscar/communication/emails/base.html" %}
{% load i18n %}

{% block body %}
<p>{% trans 'Thank you for registering.' %}</p>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{% load i18n %}{% trans 'Thank you for registering.' %}
{% extends "oscar/communication/emails/base.txt" %}
{% load i18n %}
{% block body %}{% trans 'Thank you for registering.' %}{% endblock %}