{% extends 'maple/base.html' %}
{% from 'base/paginate.html' import paginate%}
{% from 'base/paginate.html' import footer as p_footer %}
{% import 'base/link.html' as link_base %}
{% from 'base/head.html' import breadcrumb %}
{% block main %}
<nav class="navbar navbar-default navbar-fixed-top" style="background:#fff">
    <div class="container-fluid col-md-offset-1 col-md-10">
        <div class="navbar-header" style="padding-top:5px;">
            <a class="navbar-brand" href="{{ url_for('forums.index')}}" style="padding:0px">
                <img alt="Brand" src="{{url_for('static',filename='images/header.png')}}" style="width:42px;">
            </a>
            <div class="navbar-brand" style="padding-top:2;padding-left:30px">
                <span style="font-size:20px;color:#EB5424"><b class="text-capitalize">{{ Title.title}}</b></span>
                <br/>
                <small style="font-size:10px">{{ Title.description}}</small>
            </div>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="{{ url_for('forums.forums')}}">{{ _('社区')}}</a></li>
                <li><a href="{{ url_for('docs.docs')}}">文档</a></li>
                <li><a href="#">博客</a></li>
                <li><a href="{{ url_for('topic.good')}}">精华文章</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">注册</a></li>
                <li><a href="#">登陆</a></li>
            </ul>
        </div>
    </div>
</nav>
<div class="col-md-offset-1 col-md-10" style="padding:0;margin-top:60px">
    {% with messages = get_flashed_messages(with_categories=true) %}
    {% if messages %}
    {% for category,message in messages %}
    {% if category == 'message' -%}
    {% set category = 'info' %}
    {%- endif %}
    <div class="alert alert-{{ category }}" style="padding:8px">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
        <ul>
            <li style="list-style-type:none">{{ message }} </li>
        </ul>
    </div>
    {% endfor %}
    {% endif %}
    {% endwith %}
    {% if g.user.is_authenticated %}
    <div class="btn-group pull-right">
        <button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            {{ current_user.username }} <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
            <li><a href="{{ url_for('user.user',user_url=current_user.username) }}">我的主页</a></li>
            <li><a href="{{ url_for('setting.setting') }}">帐号设置</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="{{ url_for('auth.logout') }}">退出</a></li>
        </ul>
    </div>
    {% else  %}
    <a href="{{ url_for('auth.register') }}" class="btn btn-sm btn-primary pull-right">注册</a>
    <a href="{{ url_for('auth.login') }}" class="btn btn-sm btn-primary pull-right">登陆</a>
    {% endif %}
    <a href="{{ url_for('tag.tag')}}" ><span class="btn btn-sm btn-primary pull-right">所有标签</span></a>
    <a href="{{ url_for('forums.userlist')}}"><span class="btn btn-sm btn-primary pull-right">用户列表</span></a>
    <a href="{{ url_for('forums.notice')}}"><span class="btn btn-sm btn-primary pull-right">消息通知</span></a>
    {% block content %} {% endblock %}
</div>
{% endblock %}
