add fix firefox

remotes/origin/mitri4
Dmitriy Shesterkin 9 years ago
parent 7a198e8810
commit 59fc7b9aba
  1. 3
      batiskaf/templates/jinja2/base.jinja
  2. 10
      batiskaf/templates/jinja2/cart_detail.jinja
  3. 6
      batiskaf/templates/jinja2/product.jinja
  4. 8
      static/less/_.css
  5. 2
      static/less/_.less
  6. 2
      static/less/_.min.css
  7. 7
      static/less/components/_currency.less
  8. 4
      static/less/components/_navbar.less
  9. 17
      store/currency.py

@ -17,12 +17,13 @@
<link href='/static/favicon.ico?v=3' type='image/x-icon' rel='shortcut icon'/>
<link href="/static/bower_components/Bootflat/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/bower_components/Bootflat/bootflat/css/bootflat.min.css" rel="stylesheet">
<link href="/static/less/_.min.css?v=5" rel="stylesheet">
<link href="/static/less/_.min.css?v=6" rel="stylesheet">
<link href="/static/css/select2.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/static/bower_components/sweetalert/lib/sweet-alert.css">
<link rel="stylesheet" href="/static/js/mp/dist/magnific-popup.css">
<link rel="stylesheet" href="/static/star-rating/jquery.rating.css">
<link href="/static/js/formstone/css/dropdown.css" rel="stylesheet">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" />
{% block stylesheet %}{% endblock stylesheet %}
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

@ -60,10 +60,10 @@
<tfoot>
<tr>
<th colspan="5" class="text-left"><p class="text-right price-subtotal">
Стоимость товара: <span id="cart-itogo">{{ (request|currency).get_price(cart.total) }}</span> {{ (request|currency).get_symbol() }} <br/>
Стоимость доставки: <span id="order-itogo-delivery-up">0</span> {{ (request|currency).get_symbol() }}
Стоимость товара: <span id="cart-itogo">{{ (request|currency).get_price(cart.total) }}</span> <span class="price__currency price__currency_up">{{ (request|currency).get_symbol() }}</span> <br/>
Стоимость доставки: <span id="order-itogo-delivery-up">0</span> <span class="price__currency price__currency_up">{{ (request|currency).get_symbol() }}</span>
<br/>
Итого к оплате: <span id="order-itogo-amount-up">{{ (request|currency).get_price(cart.total) }}</span> {{ (request|currency).get_symbol() }}
Итого к оплате: <span id="order-itogo-amount-up">{{ (request|currency).get_price(cart.total) }}</span> <span class="price__currency price__currency_up">{{ (request|currency).get_symbol() }}</span>
</p>
<p>
<a href="javascript:history.back()" class="">
@ -167,9 +167,9 @@
<br>
<div class="order-itogo text-right">
Стоимость доставки: <span id="order-itogo-delivery">0</span> {{ (request|currency).get_symbol() }}
Стоимость доставки: <span id="order-itogo-delivery">0</span> <span class="price__currency price__currency_up">{{ (request|currency).get_symbol() }}</span>
<br/>
Итого к оплате: <span id="order-itogo-amount">{{ cart.total }}</span> {{ (request|currency).get_symbol() }}
Итого к оплате: <span id="order-itogo-amount">{{ cart.total }}</span> <span class="price__currency get_short_currency_name">{{ (request|currency).get_symbol() }}</span>
</div>
<br/>
<div class="radio">

@ -53,7 +53,7 @@
<h1 style="font-size:19px; margin-top:0;" class="text-left">{{ product.title }}</h1>
<div class="product-detail-price">
<span class="product-detail-price-span">{{ (request|currency).get_price(product.min_price(request.user)) }}</span> {{ (request|currency).get_symbol() }}
<span class="product-detail-price-span">{{ (request|currency).get_price(product.min_price(request.user)) }}</span> <span class="price__currency">{{ (request|currency).get_symbol() }}</span>
</div>
<br/>
{% set variant = product.variations.filter(in_stock__gt=0).order_by('price').first() %}
@ -68,7 +68,7 @@
value="{{ variation.pk }}" data-price="{{ (request|currency).get_price(variation.get_price(request.user)) }}"
data-count="{{ variation.in_stock }}">{{ variation.variation }}
- {{ (request|currency).get_price(variation.get_price(request.user)) }}
{{ (request|currency).get_symbol() }}
{{ (request|currency).get_short_currency_name() }}
</option>
{% endfor %}
</select>
@ -87,7 +87,7 @@
</select>
<div class="row">
<div class="itogo col-xs-6">
Итого: <span class="itogo-span">{{ (request|currency).get_price(product.min_price(request.user)) }}</span> {{ (request|currency).get_symbol() }}
Итого: <span class="itogo-span">{{ (request|currency).get_price(product.min_price(request.user)) }}</span> <span class="price__currency">{{ (request|currency).get_symbol() }}</span>
</div>
<div class="col-xs-6 text-right">
<a href="/store/cart/add/?pk={{ variant.pk }}&count=1&next={{ product.get_absolute_url() }}"

@ -330,6 +330,7 @@
box-shadow: inset 0 3px 9px rgba(0, 0, 0, 0.25);
}
.currency-icon {
font-family: 'PT Sans', serif;
display: block;
margin-left: 0;
width: 49px;
@ -360,11 +361,18 @@
margin-bottom: 0;
}
.currency-item__link {
font-family: 'PT Sans', serif;
display: block;
padding: 0!important;
border: 0!important;
font-size: 14px!important;
}
.price__currency {
font-family: 'PT Sans', serif;
}
.price__currency_up {
font-size: 20px;
}
body {
font-family: "Open Sans", Arial, sans-serif;
}

@ -6,7 +6,7 @@
// include components custom style
@import "components/_navbar";
@import "components/_currency";
@brand-yellow: #fed000;
@brand-gray: #434a54;

File diff suppressed because one or more lines are too long

@ -0,0 +1,7 @@
.price__currency {
font-family: 'PT Sans', serif;
}
.price__currency_up {
font-size: 20px;
}

@ -26,6 +26,7 @@
}
.currency-icon {
font-family: 'PT Sans', serif;
display: block;
margin-left: 0;
width: 49px;
@ -61,8 +62,9 @@
}
.currency-item__link {
font-family: 'PT Sans', serif;
display: block;
padding: 0!important;
border: 0!important;
font-size: 14px!important;
}
}

@ -5,12 +5,14 @@ from .models import Currency as CurrencyModel
MAIN_CURRENCY_ID = 1
DEFAULT_SYMBOL = '&#8376;' # Тенге
DEFAULT_SHORT = 'тг'
class Currency(object):
id = ''
exchange = ''
symbol = ''
short = ''
def __init__(self, request):
self.id = request.session.get('currency_id', None)
@ -20,9 +22,12 @@ class Currency(object):
_currency = CurrencyModel.objects.get(pk=self.id)
self.exchange = _currency.exchange
self.symbol = _currency.HTML_letter_code
self.short = _currency.abridgement
except CurrencyModel.DoesNotExist:
pass
_currency = CurrencyModel.objects.get(pk=MAIN_CURRENCY_ID)
self.exchange = _currency.exchange
self.symbol = _currency.HTML_letter_code
self.short = DEFAULT_SHORT
else:
self.id = MAIN_CURRENCY_ID
self.symbol = DEFAULT_SYMBOL
@ -34,7 +39,9 @@ class Currency(object):
try:
_currency = CurrencyModel.objects.get(pk=self.id)
self.symbol = _currency.HTML_letter_code
self.short = _currency.abridgement
self.exchange = _currency.exchange
print(self.short)
except CurrencyModel.DoesNotExist:
self.symbol = DEFAULT_SYMBOL
request.session['currency_id'] = c_id
@ -42,10 +49,14 @@ class Currency(object):
def get_symbol(self):
return Markup(self.symbol)
def get_short_currency_name(self):
return self.short
def get_price(self, price):
_price = int(price * self.exchange)
return _price
def get_string_price(self, price):
return Markup('{price} {code}'.format(price=self.get_price(price), code=self.symbol))
return Markup('{price} <span class="price__currency">{code}</span>'.
format(price=self.get_price(price), code=self.symbol))

Loading…
Cancel
Save