<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head profile="http://gmpg.org/xfn/11">
        <meta http-equiv="Content-type" content="$theme.type; charset=utf-8" />
        <title>{% block title %}$site.name{% if title %} &raquo; ${ title | escape }{% endif %}{% endblock %}</title>
        <meta name="generator" content="Chyrp" />
        <link rel="pingback" href="$site.chyrp_url/includes/xmlrpc.php" />
        <link rel="EditURI" type="application/rsd+xml" href="$site.chyrp_url/includes/rsd.php" />
        $theme.feeds
        $theme.stylesheets
        $theme.javascripts
${ trigger.call("head") }
    </head>
    <body>
        {% if visitor.group.can("add_post", "add_draft", "add_page", "view_own_draft", "view_draft", "change_settings", "toggle_extensions") %}
        <div id="controls" {% if hide_admin %} style="display: none"{% endif %}>
            <ul>
                {% if visitor.group.can("add_post") %}
                <li><a id="add_post" href="{% admin "write_post" %}">${ "Write" | translate }</a></li>
                {% elseif visitor.group.can("add_draft") %}
                <li><a id="add_draft" href="{% admin "write_post" %}">${ "Write Draft" | translate }</a></li>
                {% endif %}
                {% if visitor.group.can("add_page") %}
                <li><a id="add_page" href="{% admin "write_page" %}">${ "Add Page" | translate }</a></li>
                {% endif %}
                {% if visitor.group.can("view_own_draft", "view_draft") %}
                <li><a id="your_drafts" href="{% url "drafts" %}">${ "Your Drafts" | translate }</a></li>
                {% endif %}
                {% if visitor.group.can("change_settings", "toggle_extensions") %}
                <li><a id="site_settings" href="$site.chyrp_url/admin/">${ "Admin" | translate }</a></li>
                {% endif %}
                <li class="close"><a class="toggle_admin" href="{% url "toggle_admin" %}">${ "Close" | translate }</a></li>
            </ul>
        </div>
        {% endif %}
        {% if site.name %}
        <div id="header">
            <div class="header_box">
                <form action="$site.url" method="get" accept-charset="utf-8">
					<input type="hidden" name="action" value="search" id="action" />
					<input type="text" id="search" name="query" value="${ GET.query | escape }" />
                </form>
                <h1><a href="$site.url">$site.name</a></h1>
                {% if site.description %}
                <h2>$site.description</h2>
                {% endif %}
            </div>
        </div>
        {% endif %}

        <div id="wrapper">
{% include "content/sidebar.twig" %}
            <div id="content">
                {% for type, messages in flash.all | items %}
                {% for message in messages %}
                <div class="${ type | depluralize }">$message</div>
                {% endfor %}
                {% endfor %}
{% block content %}{% endblock %}
                <div class="clear"></div>
                <div class="paginate">
					$posts.prev_link
					$posts.next_link
					{% if posts.paginated and posts.pages > 1 %}
					<span class="pages">${ "Page %d of %d" | translate | format(posts.page, posts.pages) }</span>
					{% endif %}
				</div>
                <div id="footer">
                    <p>Grackle theme &copy; 2008&ndash;2009 <a href="http://nscott.net/">Nevan Scott</a></p>
                    <p>${ "Powered by <a class=\"chyrp\" href=\"http://chyrp.net/\">Chyrp</a>" | translate }</p>
                </div>
            </div>
            <div class="clear"></div>
        </div>
${ trigger.call("end_content") }
        <!-- Queries: $sql_queries | Load Time: $theme.load_time -->
    </body>
</html>
