pyfedi/app/templates/base.html

110 lines
5.6 KiB
HTML
Raw Normal View History

2023-10-20 19:49:01 -07:00
{% macro render_username(user) %}
{% if user.deleted %}
[deleted]
{% else %}
<a href="{{ url_for('activitypub.user_profile', actor=user.user_name) }}">{{ user.user_name }}</a>
{% endif %}
{% endmacro %}
2023-07-27 21:22:12 -07:00
<!doctype html>
<html lang="en">
<head>
{% block head %}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="Content-Language" content="en" />
<meta name="msapplication-TileColor" content="#007BBF">
<meta name="theme-color" content="#007BBF">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
{% block styles %}
2023-08-22 02:24:11 -07:00
{{ bootstrap.load_css() }}
2023-07-27 21:22:12 -07:00
<link href="{{ url_for('static', filename='structure.css', changed=getmtime('structure.css')) }}" type="text/css" rel="stylesheet" />
<link href="{{ url_for('static', filename='styles.css', changed=getmtime('styles.css')) }}" type="text/css" rel="stylesheet" />
{% endblock %}
<title>{% if title %}{{ title }} - {{ _('PyFedi') }}{% else %}{{ _('PyFedi') }}{% endif %}</title>
2023-10-28 01:33:40 -07:00
<link rel="apple-touch-icon" sizes="152x152" href="/static/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/images/favicon-16x16.png">
2023-07-27 21:22:12 -07:00
<link rel="manifest" href="/static/site.webmanifest">
2023-10-28 01:33:40 -07:00
<link rel="shortcut icon" type="image/png" href="/static/images/favicon-32x32.png">
<link href='/static/images/favicon.ico' rel='icon' type='image/x-icon'>
2023-07-27 21:22:12 -07:00
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="/static/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
{% if canonical %}
<link rel="canonical" href="{{ canonical }}" />
{% endif %}
2023-10-23 00:18:46 -07:00
{% if description %}
<meta name="description" content="{{ description }}" />
{% endif %}
{% if og_image %}
<meta property="og:image" content="{{ og_image }}" />
{% endif %}
2023-07-27 21:22:12 -07:00
{% endblock %}
</head>
2023-10-28 01:33:40 -07:00
<body class="d-flex flex-column" style="padding-top: 78px;">
2023-07-27 21:22:12 -07:00
<!-- Page content -->
{% block navbar %}
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<div class="container-lg">
2023-10-28 01:33:40 -07:00
<a class="navbar-brand" href="/" target="_blank"><img src="/static/images/logo2.png" alt="Logo" width="50" height="50" />PieFed</a>
2023-07-27 21:22:12 -07:00
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent" role="navigation">
<ul class="nav navbar-nav ml-md-4">
{% if current_user.is_anonymous %}
2023-08-22 02:24:11 -07:00
<li class="nav-item"><a class="nav-link" href="/">{{ _('Home') }}</a></li>
<li class="nav-item"><a class="nav-link" href="/communities">{{ _('Communities') }}</a></li>
<li class="nav-item"><a class="nav-link" href="/auth/login">{{ _('Log in') }}</a></li>
<li class="nav-item"><a class="nav-link" href="/auth/register">{{ _('Register') }}</a></li>
2023-07-27 21:22:12 -07:00
{% else %}
2023-08-22 02:24:11 -07:00
<li class="nav-item"><a class="nav-link" href="/">{{ _('Home') }}</a></li>
<li class="nav-item"><a class="nav-link" href="/communities">{{ _('Communities') }}</a></li>
2023-10-07 01:32:19 -07:00
<li class="nav-item"><a class="nav-link" href="/u/{{ current_user.user_name }}">{{ current_user.user_name }}</a></li>
<li class="nav-item"><a class="nav-link" href="/auth/logout">{{ _('Log out') }}</a></li>
2023-07-27 21:22:12 -07:00
{% endif %}
</ul>
</div>
</div>
</nav>
{% endblock %}
{% block content %}
<div id="outer_container" class="container-lg flex-shrink-0 mt-4 pt-1">
2023-07-27 21:22:12 -07:00
{% with messages = get_flashed_messages(with_categories=True) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}" role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{# application content needs to be provided in the app_content block #}
{% block app_content %}{% endblock %}
</div>
<footer class="footer mt-auto">
</footer>
{% endblock %}
{% block scripts %}
{{ str(moment.include_moment()).replace('<script>', '<script nonce="' + session['nonce'] + '">')|safe }}
{{ str(moment.lang(g.locale)).replace('<script>', '<script nonce="' + session['nonce'] + '">')|safe }}
2023-07-27 21:22:12 -07:00
{% endblock %}
2023-08-22 02:24:11 -07:00
{{ bootstrap.load_js() }}
2023-07-27 21:22:12 -07:00
<script type="text/javascript" src="{{ url_for('static', filename='js/htmx.min.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/scripts.js', changed=getmtime('js/scripts.js')) }}"></script>
{% block end_scripts %}
{% endblock %}
</body>
</html>