fix: Font size, empty image styles, and minor cleanup

- some frappe css font variables weren't loading, remove dependency
- fixed fallback display for missing images in views
- py code cleanup (minor)
This commit is contained in:
marination
2021-06-08 19:40:26 +05:30
parent 791e244b4f
commit cdcb18bd16
14 changed files with 104 additions and 68 deletions

View File

@@ -79,7 +79,7 @@
<!-- Add to Cart -->
{% if product_info.price and (cart_settings.allow_items_not_in_stock or product_info.in_stock) %}
<a href="/cart"
class="btn btn-light btn-view-in-cart hidden mr-2"
class="btn btn-light btn-view-in-cart hidden mr-2 font-md"
role="button"
>
{{ _("View in Cart") }}

View File

@@ -1,9 +1,9 @@
{% if shopping_cart and shopping_cart.cart_settings.enabled %}
{% set cart_settings = shopping_cart.cart_settings %}
{% if cart_settings.show_contact_us_button | int %}
<button class="btn btn-inquiry btn-primary-light" data-item-code="{{ doc.name }}">
{{ _('Contact Us') }}
</button>
{% if cart_settings.show_contact_us_button | int %}
<button class="btn btn-inquiry btn-primary-light font-md" data-item-code="{{ doc.name }}">
{{ _('Contact Us') }}
</button>
{% endif %}
<script>
{% include "templates/generators/item/item_inquiry.js" %}

View File

@@ -7,7 +7,10 @@
<div class="input-group mb-6 col-8 order-2">
<div class="dropdown w-100" id="dropdownMenuSearch">
<input type="search" name="query" id="search-box" class="form-control" placeholder="Search for products..." aria-label="Product" aria-describedby="button-addon2">
<input type="search" name="query" id="search-box" class="form-control"
placeholder="Search for products..."
aria-label="Product" aria-describedby="button-addon2"
style="font-size: 14px">
<!-- Results dropdown rendered in product_search.js -->
</div>
</div>

View File

@@ -1,5 +1,5 @@
<div class="card address-card h-100">
<div class="btn btn-sm btn-default btn-change-address" style="position: absolute; right: 0; top: 0;">
<div class="btn btn-sm btn-default btn-change-address font-md" style="position: absolute; right: 0; top: 0;">
{{ _('Change') }}
</div>
<div class="card-body p-0">

View File

@@ -8,9 +8,9 @@
{% if show_coupon_code == 1%}
<div class="mb-3">
<div class="row no-gutters">
<input type="text" class="txtcoupon form-control mr-3 w-25" placeholder="Enter Coupon Code" name="txtcouponcode" ></input>
<button class="btn btn-primary btn-sm bt-coupon">{{ _("Apply Coupon Code") }}</button>
<input type="hidden" class="txtreferral_sales_partner" placeholder="Enter Sales Partner" name="txtreferral_sales_partner" type="text"></input>
<input type="text" class="txtcoupon form-control mr-3 w-50 font-md" placeholder="Enter Coupon Code" name="txtcouponcode" ></input>
<button class="btn btn-primary btn-sm bt-coupon font-md">{{ _("Apply Coupon Code") }}</button>
<input type="hidden" class="txtreferral_sales_partner font-md" placeholder="Enter Sales Partner" name="txtreferral_sales_partner" type="text"></input>
</div>
</div>
{% endif %}
@@ -30,7 +30,7 @@
<div class="checkbox ml-1 mb-2">
<label for="input_same_billing">
<input type="checkbox" id="input_same_billing" checked>
<span class="label-area">{{ _('Billing Address is same as Shipping Address') }}</span>
<span class="label-area font-md">{{ _('Billing Address is same as Shipping Address') }}</span>
</label>
</div>
<div class="mb-3 frappe-card p-5" data-section="billing-address">
@@ -46,7 +46,9 @@
{% endif %}
{% endfor %}
</div>
<button class="btn btn-outline-primary btn-sm mt-1 btn-new-address bg-white">{{ _("Add a new address") }}</button>
<button class="btn btn-outline-primary btn-sm mt-1 btn-new-address bg-white font-md">
{{ _("Add a new address") }}
</button>
<script>
frappe.ready(() => {
@@ -124,7 +126,8 @@ frappe.ready(() => {
{
fieldname: "phone",
fieldtype: "Data",
label: "Phone"
label: "Phone",
reqd: 1
},
],
primary_action_label: __('Save'),

View File

@@ -138,33 +138,30 @@
{%- macro wishlist_card(item, settings) %}
{%- set title = item.item_name or item.item_code -%}
{%- set title = title[:50] + "..." if title|len > 50 else title -%}
<div class="col-sm-3 wishlist-card">
<div class="card text-center" style="max-height: 390px;">
{% if item.image %}
<div class="card-img-container">
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
<div class="card-img-container">
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
{% if item.image %}
<img class="card-img" src="{{ item.image }}" alt="{{ title }}">
</a>
<div class="remove-wish" data-item-code="{{ item.item_code }}">
<span style="padding-bottom: 2px;">
<svg class="icon sm remove-wish-icon" style="margin-bottom: 4px; margin-left: 0.5px;">
<use class="close" href="#icon-close"></use>
</svg>
</span>
</div>
{% else %}
<div class="card-img-top no-image">
{{ frappe.utils.get_abbr(title) }}
</div>
{% endif %}
</a>
<div class="remove-wish" data-item-code="{{ item.item_code }}">
<span style="padding-bottom: 2px;">
<svg class="icon sm remove-wish-icon" style="margin-bottom: 4px; margin-left: 0.5px;">
<use class="close" href="#icon-close"></use>
</svg>
</span>
</div>
{% else %}
<a href="/{{ item.route or '#' }}" style="text-decoration: none;">
<div class="card-img-top no-image">
{{ frappe.utils.get_abbr(title) }}
</div>
</a>
{% endif %}
</div>
{{ wishlist_card_body(item, settings) }}
</div>
</div>
{%- endmacro -%}

View File

@@ -52,11 +52,11 @@
<div class="row mt-2">
<div class="col-3">
{% if cart_settings.enable_checkout %}
<a class="btn btn-outline-primary" href="/orders">
<a class="btn btn-outline-primary font-md" href="/orders">
{{ _('Past Orders') }}
</a>
{% else %}
<a class="btn btn-outline-primary" href="/quotations">
<a class="btn btn-outline-primary font-md" href="/quotations">
{{ _('See past quotations') }}
</a>
{% endif %}
@@ -64,15 +64,15 @@
<div class="col-9">
{% if doc.items %}
<div class="place-order-container">
<a class="btn btn-primary-light mr-2" href="/all-products">
<a class="btn btn-primary-light mr-2 font-md" href="/all-products">
{{ _('Back to Shop') }}
</a>
{% if cart_settings.enable_checkout %}
<button class="btn btn-primary btn-place-order" type="button">
<button class="btn btn-primary btn-place-order font-md" type="button">
{{ _('Place Order') }}
</button>
{% else %}
<button class="btn btn-primary btn-request-for-quotation" type="button">
<button class="btn btn-primary btn-request-for-quotation font-md" type="button">
{{ _('Request for Quotation') }}
</button>
{% endif %}

View File

@@ -79,7 +79,7 @@ def search(query, limit=10, fuzzy_search=True):
suggestions = ac.get_suggestions(
query,
num=limit,
fuzzy= fuzzy_search and len(query) > 4 # Fuzzy on length < 3 can be real slow
fuzzy= fuzzy_search and len(query) > 3 # Fuzzy on length < 3 can be real slow
)
# Build a query