<!DOCTYPE html>
<html lang="en">
<head>
        {% block title %}
        <title>
            {% if settings.PARENT_SITE_NAME %}
            {{ settings.PARENT_SITE_NAME }} -
            {% endif %} Blogs
        </title>
        {% endblock %}
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="https://use.fontawesome.com/releases/v5.0.8/css/all.css" rel="stylesheet">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    
    {% load static %}
    <link rel="stylesheet" href="{% static 'css/blogs-common.css'%}">
</head>

<body>

    <header class="mb-3 border-bottom">
        <div class="container">
            <div class="row pt-2">
                <div class="col">
                    <h5><a class="text-dark" href="{% url 'blogs:home' %}" style="text-decoration: none">Blogs</a></h5>
                </div>
                <div class="col">
                    {% if user.is_authenticated %}
                    <div class="dropdown float-right">
                        <a class="h5 text-secondary" href="#" role="button" id="optionsDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <i class="fas fa-bars"></i>
                        </a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="optionsDropdown">
                            <a class="dropdown-item" href="{% url 'blogs:new' %}">New Post</a>
                            <a class="dropdown-item" href="{% url 'blogs:drafts' %}">Drafts</a>
                            {% block dropdown_options %}
                            {% endblock %}
                        </div>
                    </div>
                    {% endif %}
                </div>
            </div>
        </div>
    </header>

    <main class="container">
        {% if messages %}
        <div class="alert alert-success alert-dismissible" role="alert">
            {% for message in messages %}
            {{ message }}<br>
            {% endfor %}
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
        {% endif %}

    {% block content %} {% endblock %}
    </main>

    <footer class='footer mt-3 border-top'>
        {% include 'django-blogs/footer.html' %}
    </footer>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>  

    {% block scripts %}
    <!-- block to add your own scripts -->
    {% endblock %}

</body>
</html>