Files
classifieds/app/templates/base.html
T
2026-07-13 16:12:49 -04:00

92 lines
4.4 KiB
HTML

<!doctype html>
<html lang="{{ get_locale() }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Classifieds{% endblock %}</title>
{% block meta_description %}<meta name="description" content="Classifieds — buy, sell, find jobs and services in your local Vietnamese and Hispanic community across the US.">{% endblock %}
{# Open Graph #}
<meta property="og:site_name" content="Classifieds">
<meta property="og:title" content="{% block og_title %}Classifieds{% endblock %}">
<meta property="og:description" content="{% block og_description %}Buy, sell, find jobs and services in your local community.{% endblock %}">
<meta property="og:type" content="{% block og_type %}website{% endblock %}">
{% block og_image %}{% endblock %}
{% block og_url %}<meta property="og:url" content="{{ request.url }}">{% endblock %}
{# Canonical #}
<link rel="canonical" href="{{ request.base_url }}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&family=Hanken+Grotesk:wght@400;500;600;700&family=Space+Mono&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
{% block head %}{% endblock %}
</head>
<body>
<header class="site-header">
{% set slot = "header" %}{% include "ads/_slot.html" %}
<div class="wrap">
<a class="brand" href="{{ url_for('main.index') }}"><span class="brand-mark">C</span>Classifieds</a>
<button class="nav-toggle" aria-label="{{ _('Menu') }}" onclick="document.querySelector('.nav').classList.toggle('open')">&#9776;</button>
<nav class="nav">
<a href="{{ url_for('listings.browse') }}">{{ _('Browse') }}</a>
<a href="{{ url_for('payments.pricing') }}">{{ _('Pricing') }}</a>
{% if current_user.is_authenticated %}
<a href="{{ url_for('listings.create') }}">{{ _('Post') }}</a>
<a href="{{ url_for('listings.mine') }}">{{ _('My listings') }}</a>
<a href="{{ url_for('messaging.my_favorites') }}">{{ _('Saved') }}</a>
<a href="{{ url_for('messaging.inbox') }}" class="msg-link">
{{ _('Messages') }}
{% if unread_count %}<span class="badge-count">{{ unread_count }}</span>{% endif %}
</a>
<a href="{{ url_for('payments.my_billing') }}">{{ _('Billing') }}</a>
{% if current_user.is_admin %}
<a href="{{ url_for('admin.dashboard') }}">{{ _('Admin') }}</a>
{% endif %}
<span class="hi">{{ current_user.display_name }}</span>
<a href="{{ url_for('auth.logout') }}">{{ _('Sign out') }}</a>
{% else %}
<a href="{{ url_for('auth.login') }}">{{ _('Sign in') }}</a>
<a class="btn" href="{{ url_for('auth.register') }}">{{ _('Register') }}</a>
{% endif %}
<span class="langs">
{% for code in SUPPORTED_LOCALES %}
<a href="{{ url_for('i18n.set_lang', code=code) }}"
class="{{ 'on' if get_locale()|string == code else '' }}">{{ code|upper }}</a>
{% endfor %}
</span>
</nav>
</div>
</header>
<main class="wrap">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="flashes">
{% for category, msg in messages %}
<div class="flash flash-{{ category }}">{{ msg }}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</main>
<footer class="site-footer">
{% set slot = "footer" %}{% include "ads/_slot.html" %}
<div class="wrap">© {{ 2025 }} Classifieds · <a href="{{ url_for('ads.sponsor_directory') }}">{{ _('Sponsors') }}</a></div>
</footer>
{% block scripts %}{% endblock %}
<script>
// Auto-dismiss flash toasts after 5 s
document.querySelectorAll('.flash').forEach(function(el) {
setTimeout(function(){ el.style.opacity='0'; setTimeout(function(){ el.remove(); }, 400); }, 5000);
el.style.transition = 'opacity .4s';
});
// Close mobile nav on link click
document.querySelectorAll('.nav a').forEach(function(a) {
a.addEventListener('click', function() {
document.querySelector('.nav').classList.remove('open');
});
});
</script>
</body>
</html>