<!doctype html>
<html lang="ru">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}nikola{% endblock %}</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    
    <div class="feed">
    <header>
        <div style="display: flex;">
            <div style="width: auto;">
                <h3>
                    <a class="brand" href="{{ url_for('feed') }}">
                        {% if session.get('nickname') %}
                            {{ session.get('nickname') }}
                        {% elif session.get('email') %}
                            {{ session.get('email') }}
                        {% else %}
                            KL
                        {% endif %}
                    </a>
                </h3>
                <h2 style="font-weight: bold;">2nd gen</h2>
                <nav>
                    {% if session.get('user_id') %}
                    <a style="text-decoration: underline;" href="{{ url_for('feed') }}">feed</a>
                        {% if session.get('role') == 'admin' %}
                            <a style="text-decoration: underline;" href="{{ url_for('admin_users') }}">users</a>
                            <a style="text-decoration: underline;" href="{{ url_for('admin_blocks') }}">posts</a>
                            <a style="text-decoration: underline;" href="{{ url_for('admin_warden_db') }}">warden</a>
                        {% endif %}
                    <a style="text-decoration: underline;" href="{{ url_for('logout') }}">exit</a>
                    {% else %}
                    <a style="text-decoration: underline;" href="{{ url_for('login') }}">login</a>
                    <a style="text-decoration: underline;" href="{{ url_for('register') }}">register</a>
                    {% endif %}
                </nav>
            </div>

            <div class="circle">
                <a href="{{ url_for('profile') }}">
                    <img class="avatar"
                        src="{% if session.get('avatar_filename') %}
                                {{ url_for('static', filename='avatars/' ~ session.get('avatar_filename')) }}
                                {% else %}
                                {{ url_for('static', filename='images/ava.png') }}
                                {% endif %}"
                        alt="">
                </a>
            </div>

        </div>
    </header>
    </div>

  <main class="container">
    {% block content %}{% endblock %}
  </main>
</body>
</html>