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: login and translation in macros.html #163

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
26 changes: 13 additions & 13 deletions webshop/templates/includes/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@
{{ section.section_html }}
{% elif section.section_based_on == 'Cards' %}
<section class="container my-5">
<h3>{{ section.name }}</h3>
<h3>{{ _(section.name) }}</h3>

<div class="row">
{% for card in section.section_cards %}
<div class="col-md-{{ section.column_value }} mb-4">
<div class="card h-100 justify-content-between">
{% if card.image %}
<img itemprop="image" class="card-img-top h-75" src="{{ card.image }}" loading="lazy" alt="{{ card.title }}"></img>
<img itemprop="image" class="card-img-top h-75" src="{{ card.image }}" loading="lazy" alt="{{ _(card.title) }}"></img>
{% endif %}
<div itemprop="image" class="card-body">
<h5 class="card-title">{{ card.title }}</h5>
<p class="card-subtitle mb-2 text-muted">{{ card.subtitle or '' }}</p>
<p class="card-text">{{ card.content or '' | truncate(140, True) }}</p>
<h5 class="card-title">{{ _(card.title) }}</h5>
<p class="card-subtitle mb-2 text-muted">{{ _(card.subtitle) or '' }}</p>
<p class="card-text">{{ _(card.content) or '' | truncate(140, True) }}</p>
</div>
<div class="card-body flex-grow-0">
<a href="{{ card.route }}" class="card-link">{{ _('More details') }}</a>
Expand Down Expand Up @@ -128,17 +128,17 @@ <h5 class="card-title">{{ card.title }}</h5>
<div class="mt-4">
<a href="/{{ item.route or '#' }}">
<div class="product-title">
{{ title or '' }}
{{ _(title) or '' }}
</div>
</a>
</div>
{% if is_featured %}
<div class="product-description ellipsis text-muted" style="white-space: normal;">
{{ description or '' }}
{{ _(description) or '' }}
</div>
{% else %}
{% if template != "Product Card" %}
<div class="product-category">{{ item.item_group or '' }}</div>
<div class="product-category">{{ _(item.item_group) or '' }}</div>
{% endif %}
{% endif %}
</div>
Expand Down Expand Up @@ -233,23 +233,23 @@ <h2 style="font-size: 2rem;">
{{ average_rating or 0 }}
</h2>
<div class="mb-2" style="margin-top: -.5rem;">
{{ frappe.utils.cstr(total_reviews or 0) + " " + _("ratings") }}
{{ frappe.utils.cstr(total_reviews or 0) }} {{ _("ratings") }}
</div>

<!-- Ratings Summary -->
{% if reviews %}
{% set rating_title = frappe.utils.cstr(average_rating) + " " + _("out of 5") if not for_summary else ''%}
{% set rating_title = frappe.utils.cstr(average_rating) }} {{ _("out of 5") if not for_summary else ''%}
{{ ratings_with_title(average_whole_rating, rating_title, "md", "rating-summary-title", for_summary) }}
{% endif %}

<div class="mt-2">{{ frappe.utils.cstr(average_rating or 0) + " " + _("out of 5") }}</div>
<div class="mt-2">{{ frappe.utils.cstr(average_rating or 0) }} {{ _("out of 5") }}</div>
</div>

<!-- Rating Progress Bars -->
<div class="rating-progress-bar-section col-4 ml-4">
{% for percent in reviews_per_rating %}
<div class="col-sm-4 small rating-bar-title">
{{ loop.index }} star
{{ loop.index }} {{ _("star") }}
</div>
<div class="row">
<div class="col-md-7">
Expand Down Expand Up @@ -298,7 +298,7 @@ <h2 style="font-size: 2rem;">
{%- set item_field = field_filter[0] %}
{%- set values = field_filter[1] %}
<div class="mb-4 filter-block pb-5">
<div class="filter-label mb-3">{{ item_field.label }}</div>
<div class="filter-label mb-3">{{ _(item_field.label) }}</div>

{% if values | len > 20 %}
<!-- show inline filter if values more than 20 -->
Expand Down