Kgshop commited on
Commit
b6edd3c
·
verified ·
1 Parent(s): 2cb2227

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -144,6 +144,7 @@ def catalog():
144
  categories = data['categories']
145
  is_authenticated = 'user' in session
146
  selected_currency = session.get('currency', 'USD') if is_authenticated else 'USD'
 
147
 
148
  catalog_html = '''
149
  <!DOCTYPE html>
@@ -571,7 +572,7 @@ def catalog():
571
  const products = {{ products|tojson }};
572
  let selectedProductIndex = null;
573
  const selectedCurrency = '{{ selected_currency }}';
574
- const kgsToUsd = {{ load_config()|tojson }};
575
 
576
  function toggleTheme() {
577
  document.body.classList.toggle('dark-mode');
@@ -775,7 +776,8 @@ def catalog():
775
  repo_id=REPO_ID, is_authenticated=is_authenticated,
776
  wholesale_address=WHOLESALE_ADDRESS, retail_address=RETAIL_ADDRESS,
777
  session=session, convert_price=convert_price,
778
- selected_currency=selected_currency, currencies=CURRENCIES)
 
779
 
780
  @app.route('/product/<int:index>')
781
  def product_detail(index):
@@ -1443,7 +1445,7 @@ def admin():
1443
  <div class="user-item">
1444
  <p><strong>Логин:</strong> {{ login }}</p>
1445
  <p><strong>Имя:</strong> {{ user['first_name'] }}</p>
1446
- <p><strong>Фlastname:</strong> {{ user['last_name'] }}</p>
1447
  <p><strong>Страна:</strong> {{ user['country'] }}</p>
1448
  <p><strong>Город:</strong> {{ user['city'] }}</p>
1449
  <form method="POST">
 
144
  categories = data['categories']
145
  is_authenticated = 'user' in session
146
  selected_currency = session.get('currency', 'USD') if is_authenticated else 'USD'
147
+ kgs_to_usd = load_config() # Загружаем курс здесь
148
 
149
  catalog_html = '''
150
  <!DOCTYPE html>
 
572
  const products = {{ products|tojson }};
573
  let selectedProductIndex = null;
574
  const selectedCurrency = '{{ selected_currency }}';
575
+ const kgsToUsd = {{ kgs_to_usd|tojson }};
576
 
577
  function toggleTheme() {
578
  document.body.classList.toggle('dark-mode');
 
776
  repo_id=REPO_ID, is_authenticated=is_authenticated,
777
  wholesale_address=WHOLESALE_ADDRESS, retail_address=RETAIL_ADDRESS,
778
  session=session, convert_price=convert_price,
779
+ selected_currency=selected_currency, currencies=CURRENCIES,
780
+ kgs_to_usd=kgs_to_usd)
781
 
782
  @app.route('/product/<int:index>')
783
  def product_detail(index):
 
1445
  <div class="user-item">
1446
  <p><strong>Логин:</strong> {{ login }}</p>
1447
  <p><strong>Имя:</strong> {{ user['first_name'] }}</p>
1448
+ <p><strong>Фамилия:</strong> {{ user['last_name'] }}</p>
1449
  <p><strong>Страна:</strong> {{ user['country'] }}</p>
1450
  <p><strong>Город:</strong> {{ user['city'] }}</p>
1451
  <form method="POST">