{% load snipt_tags %}

<!DOCTYPE html>
<html lang="en" class="{% block html-class %}{% endblock %}">
<head>

    <title>
        {% block page-title %}
            // 
            {% if blog_user.profile.blog_title %}
                {{ blog_user.profile.blog_title }}
            {% else %}
                {{ blog_user.username }}
            {% endif %}
        {% endblock %}
    </title>

    <meta charset="utf-8" />

    {% if 'page' in request.GET %}
        <meta name="robots" content="noindex, follow" />
    {% endif %}

    {% if blog_user.profile.gittip_username %}
        <script type="text/javascript" charset="utf-8">
            window.gittip_username = '{{ blog_user.profile.gittip_username }}';
        </script>
    {% endif %}

    {% if debug %}
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/bootstrap.css" />
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/blog-themes/pro-adams/style.css" />
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/highlightjs-themes/tomorrow.css" />
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/themes.css" />
    {% else %}
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/pro.css?22" />
    {% endif %}

    <link rel="shortcut icon" href="/static/images/blog-favicon.ico" >

    {% if custom_css %}
        <style type="text/css">
            {{ custom_css.code }}
        </style>
    {% endif %}

    {% if has_snipts and not detail %}
        <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ request.path }}?rss{% if not public %}&api_key={{ request.user.api_key.key }}{% endif %}" />
    {% endif %}

    <!--[if IE]>
        <style type="text/css">
            .group {
                display: block;
                zoom: 1;
            }
        </style>
    <![endif]-->

    <!--[if lt IE 9]>
        <script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

</head>

<body class="{% block body-class %}{% endblock %}">

    <div class="frame">
        <div class="left-y ruler"></div>
        <div class="right-y ruler"></div>
        {% block header %}
            <header class="main">
                <a href="/" class="logo">
                    <span class="avatar" style="background-image: url('https://secure.gravatar.com/avatar/{{ blog_user.email|md5 }}?s=80');"></span>
                </a>
                <div class="bio">
                    <a class="name" href="/">
                        {% if blog_user.profile.blog_title %}
                            {{ blog_user.profile.blog_title }}
                        {% else %}
                            {{ blog_user.username }}
                        {% endif %}
                    </a>
                    {% if header %}
                        {{ header.stylized|safe }}
                    {% endif %}
                </div>
            </header>
        {% endblock %}
        <section class="main group">
            <section class="content group">
                {% block content %}{% endblock %}
            </section>
            <aside class="main">
                {% if sidebar %}
                    {{ sidebar.stylized|safe }}
                {% endif %}
                {% if blog_user.profile.google_ad_client %}
                    <div class="google-ads">
                        <script type="text/javascript">
                            google_ad_client = '{{ blog_user.profile.google_ad_client }}';
                            google_ad_slot = '{{ blog_user.profile.google_ad_slot }}';
                            google_ad_width = {{ blog_user.profile.google_ad_width }};
                            google_ad_height = {{ blog_user.profile.google_ad_height }};
                        </script>
                        <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
                    </div>
                {% endif %}
                {% if normal_snipts %}
                    <section class="module snipts">
                        <h1>Recent snipts</h1>
                        <ul>
                            {% for snipt in normal_snipts %}
                                <li><a href="{{ snipt.get_full_absolute_url }}">{{ snipt.title }}</a></li>
                            {% endfor %}
                        </ul>
                    </section>
                {% endif %}
            </aside>
        </section>
    </div>

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/pro.js?2"></script>

    {% include 'analytics.html' %}

</body>
</html>
