<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    {% load forum_extras %}
    <title>{% block title %}小程序开发社区{% endblock %}</title>
    <script type="text/javascript" src="/static/js/base/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/static/js/base/bootstrap.min.js"></script>
    <script type="text/javascript" src="/static/js/base/in-min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap/bootstrap.min.css" />
    <link rel="stylesheet" href="/static/css/main.css?t=20130807001.css" />
    <link rel="apple-touch-icon" href="/static/images/f2e.im.icon.png">
    {% block stylesheet %}{% endblock %}
    {% block javascript %}{% endblock %}
    <style type="text/css">
        .totop a {
            display: block;
            width: 40px;
            height: 35px;
            background: url('/static/images/totop.gif') no-repeat;
            text-indent: -9999px;
            text-decoration: none;
        }

        .totop a:hover {
            background-position: 0 -35px;
        }
    </style>
</head>
<body>

<div class="navbar navbar-inverse navbar-fixed-top top-navbar">
    <div class="navbar-inner">
        <div class="container">
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <a class="brand" href="/">微信小程序</a>
            <div class="divider-vertical"></div>
            <div class="nav-collapse collapse">
                {% if active_page %}
                <ul class="nav">
                    {% for href, id, caption in navigation_bar %}
                        <li{% ifequal id active_page %} class="active"{% endifequal %}>
                            <a href="{{ href|escape }}">{{ caption|escape }}</a>
                        </li>
                    {% endfor %}
                </ul>
                {% else %}
                <ul class="nav">
                    {% for href, id, caption in navigation_bar %}
                    <li{% ifequal id 'index' %} class="active"{% endifequal %}>
                    <a href="{{ href|escape }}">{{ caption|escape }}</a>
                </li>
                {% endfor %}
                </ul>
                {% endif %}
            </div>
            <!--/.nav-collapse -->
            <form class="navbar-search pull-left J_search">
                <input type="text" class="search-query" placeholder="{#Search#}" x-webkit-speech>
            </form>
            <div class="nav-collapse collapse pull-right">
                <ul class="nav account-menu">
                    {% if user.is_authenticated %}
                        <li>
                            <a href="/u/{% if user.username %}{{ user.username }}{% else %}{{ user.id }}{% endif %}/">{{ user.username }}</a>
                        </li>
                        <li>
                            <a href="/setting">
                                <span class="">设置</span>
                            </a>
                        </li>
                        <li>
                            <a href="/logout/">
                                <span class="">登出</span>
                            </a>
                        </li>
                    {% else %}
                        <li><a href="/">首页</a></li>
                        <li>
                            <a href="/login/">
                            <span class="">登录</span>
                            </a>
                        </li>
                        <li><a href="/register/" class="">注册</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </div>
</div>

<div class="container-fluid container mt15">
    <div class="row-fluid">
        <div class="span9 left">
            {% block main %}{% endblock %}
        </div>

        <div class="span3 right">
            {% block sidebar %}{% endblock %}
        </div>
    </div>
</div>

{% include "snippet/footer.html" %}

</body>
</html>
