refactor: Centralizacja COMPANY_COUNT_MARKETING = 150
- Dodano stałą globalną COMPANY_COUNT_MARKETING w app.py - Dodano do context_processor jako COMPANY_COUNT - Zaktualizowano szablony: index.html, chat.html, landing.html, release_notes - Jedno miejsce do zmiany gdy Izba zaktualizuje cel Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
79c1b2ddd9
commit
c8f70dc2cf
16
app.py
16
app.py
@ -46,6 +46,13 @@ elif os.path.exists('nordabiz_config.txt'):
|
||||
else:
|
||||
load_dotenv(override=True)
|
||||
|
||||
# ============================================================
|
||||
# GLOBAL CONSTANTS - MARKETING
|
||||
# ============================================================
|
||||
# Liczba podmiotów gospodarczych (cel marketingowy Izby NORDA)
|
||||
# Używana we wszystkich miejscach wyświetlających liczbę firm
|
||||
COMPANY_COUNT_MARKETING = 150
|
||||
|
||||
# Configure logging with in-memory buffer for debug panel
|
||||
class DebugLogHandler(logging.Handler):
|
||||
"""Custom handler that stores logs in memory for real-time viewing"""
|
||||
@ -304,7 +311,8 @@ def inject_globals():
|
||||
"""Inject global variables into all templates"""
|
||||
return {
|
||||
'current_year': datetime.now().year,
|
||||
'now': datetime.now() # Must be value, not method - templates use now.strftime()
|
||||
'now': datetime.now(), # Must be value, not method - templates use now.strftime()
|
||||
'COMPANY_COUNT': COMPANY_COUNT_MARKETING, # Liczba podmiotów (cel marketingowy)
|
||||
}
|
||||
|
||||
|
||||
@ -10033,12 +10041,12 @@ def release_notes():
|
||||
},
|
||||
]
|
||||
|
||||
# Dynamiczne statystyki z bazy danych
|
||||
# Statystyki (używa globalnej stałej COMPANY_COUNT_MARKETING)
|
||||
db = SessionLocal()
|
||||
try:
|
||||
stats = {
|
||||
'companies': db.query(Company).count(),
|
||||
'categories': db.query(Category).count(),
|
||||
'companies': COMPANY_COUNT_MARKETING,
|
||||
'categories': db.query(Category).filter(Category.parent_id.isnot(None)).count(),
|
||||
}
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
@ -1076,7 +1076,7 @@
|
||||
<div class="timeline-date">Listopad 2025</div>
|
||||
<div class="timeline-content">
|
||||
<strong>Uruchomienie NordaGPT</strong>
|
||||
<p>Premiera asystenta AI dla członków Norda Biznes. Integracja z bazą 150 firm.</p>
|
||||
<p>Premiera asystenta AI dla członków Norda Biznes. Integracja z bazą {{ COMPANY_COUNT }} firm.</p>
|
||||
<span class="timeline-badge launch">Premiera</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -803,7 +803,7 @@
|
||||
Katalog firm Norda Biznes
|
||||
</h1>
|
||||
<p style="font-size: var(--font-size-lg); opacity: 0.9;">
|
||||
150 podmiotów gospodarczych • 4 kategorie • 17 podkategorii
|
||||
{{ COMPANY_COUNT }} podmiotów gospodarczych • 4 kategorie • 17 podkategorii
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@ -269,7 +269,7 @@
|
||||
|
||||
<div class="stats-inline">
|
||||
<span>
|
||||
<strong>150</strong>
|
||||
<strong>{{ COMPANY_COUNT }}</strong>
|
||||
<div>podmiotów gospodarczych</div>
|
||||
</span>
|
||||
<span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user