{% import "TopxiaWebBundle::macro.html.twig" as web_macro %}
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""> <!--<![endif]-->
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{% block title %} {{ setting('site.name', 'EDUSOHO') }} - {% if setting('site.slogan') %}{{ setting('site.slogan') }} -{% endif %} Powered by EduSoho 校园版{% endblock %}</title>
  <meta name="keywords" content="{% block keywords %}{% endblock %}" />
  <meta name="description" content="{% block description %}{% endblock %}" />
  <meta content="{{ csrf_token('site') }}" name="csrf-token" />
  {{ setting('login_bind.verify_code', '')|raw }}
  {% if setting('site.favicon') %}
  <link href="{{ asset(setting('site.favicon')) }}" rel="shortcut icon" />
  {% endif %}
  {% block stylesheets %}
    <link href="{{ asset('assets/libs/gallery2/bootstrap/3.1.1/css/bootstrap.css') }}" rel="stylesheet" />
    <link rel="stylesheet" media="screen" href="{{ asset('assets/css/common.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('assets/css/bootstrap-extends.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/web.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/member.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('assets/css/k12-style.css') }}" />
    <link rel="stylesheet" media="screen" href="{{ asset('assets/css/k12-iconfont.css') }}" />    
    <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/web-k12.css') }}" />  
    <!--[if lt IE 8]>
      <link href="{{ asset('assets/css/oldie.css') }}" rel="stylesheet">
    <![endif]-->
  {% endblock %}
  <!--[if lt IE 9]>
    <script src="{{ asset('assets/libs/html5shiv.js') }}"></script>
  <![endif]-->

  <!--[if IE 8]>
    <script src="{{ asset('assets/libs/respond.min.js') }}"></script>
  <![endif]-->

  {% block head_scripts %}{% endblock %}

</head>
<body {% if bodyClass|default('') %}class="{{ bodyClass }}"{% endif %}>

{% block body %}

  <div class="navbar navbar-inverse site-navbar" id="site-navbar"  data-counter-url="{{ path('user_remind_counter') }}">
    <div class="container">
      <div class="container-gap">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          {% if setting('site.logo') %}
            <a class="navbar-brand-logo" href="{{ path('homepage') }}"><img src="{{ asset(setting('site.logo')) }}"></a>
          {% else %}
            <a class="navbar-brand" href="{{ path('homepage') }}">{{ setting('site.name', 'EDUSOHO') }}</a>
          {% endif %}
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
          </ul>
          {{ render(controller('TopxiaWebBundle:Default:topNavigation', {siteNav:siteNav|default(null)})) }}

          <ul class="nav navbar-nav navbar-right">
            {% if app.user %}
              {% if app.user.isTeacher() %}
                <li><a href="{{ path('my_teaching') }}"> 我的教学 </a></li>
              {% elseif not app.user.isParent() %}
                <li><a href="{{ path('my_class') }}"> 我的班级 </a></li>
              {% endif %}
              <li><a href="{{ path('notification') }}" class="badge-container notification-badge-container">
                <span class="glyphicon glyphicon-bullhorn hidden-lt-ie8"></span>
                <span class="visible-lt-ie8">通知</span>
                {% if app.user.newNotificationNum > 0 %}<span class="badge">{{ app.user.newNotificationNum }}</span>{% endif %}</a></li>
              <li>
                <a href="{{ path('message') }}" class="badge-container message-badge-container">
                <span class="glyphicon glyphicon-envelope hidden-lt-ie8"></span>
                <span class="visible-lt-ie8">私信</span>
                {% if app.user.newMessageNum > 0 %}<span class="badge">{{ app.user.newMessageNum }}</span>{% endif %}
                </a>
              </li>
              <li class="visible-lt-ie8"><a href="{{ path('settings') }}">{{ app.user.truename }}</a></li>
              <li class="dropdown hidden-lt-ie8">

                <a href="javascript:;" class="dropdown-toggle"  data-toggle="dropdown">
                  <img src="{{ file_path(app.user.smallAvatar, 'avatar.png') }}" class="navbar-user-avatar">
                  {{ app.user.truename }} <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                  {% if app.user.isParent() %}
                    <li><a href="{{ path('my_children') }}"><i class="glyphicon glyphicon-home"></i> 我的主页</a></li>
                  {% else %}
                    <li><a href="{{ path('user_show', {id:app.user.id}) }}"><i class="glyphicon glyphicon-home"></i> 我的主页</a></li>
                  {% endif %}
                  {% if app.user.isStudent() %}
                     <li><a href="{{ path('my_courses_learning', {id:app.user.id}) }}"><i class="glyphicon glyphicon-user"></i> 个人中心</a></li>
                  {% endif %}
                  <li><a href="{{ path('settings') }}"><i class="glyphicon glyphicon-cog"></i> 帐号设置</a></li>
                  <li class="divider"></li>
                  {% if is_granted('ROLE_BACKEND') %}
                    <li><a href="{{ path('admin') }}"><i class="glyphicon glyphicon-dashboard"></i> 管理后台</a></li>
                    <li class="divider"></li>
                  {% endif %}
                  <li><a href="{{ path('logout') }}"><i class="glyphicon glyphicon-off"></i> 退出</a></li>
                </ul>
              </li>
            {% else %}
              {# <li><a href="{{ path('search') }}"><span class="glyphicon glyphicon-search"></span> 搜索</a></li> #}
              <li><a id="login_link" href="{{ path('login') }}"><span class="glyphicon glyphicon-user prs"></span> 登录</a></li>
              {# <li><a href="{{ path('register') }}">注册</a></li> #}
            {% endif %}
          </ul>
        </div><!--/.navbar-collapse -->
      </div>
    </div>
  </div>

  <div id="content-container" class="container">
    {% if app.user and app.user.setup == 0 and (hideSetupHint is not defined or hideSetupHint != true) %}
      <div class="alert alert-warning">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
        为了帐号的安全，以及更好的使用体验，请设置您的Email地址。
        <a href="{{ path('settings_setup') }}">现在就去设置</a>
      </div>
    {% endif %}
    {% block content %}{% endblock %}
    
  </div><!-- /container -->

  <div class="site-footer container clearfix">

    {{ render(controller('TopxiaWebBundle:Default:footNavigation')) }}

    <div class="text-gray" data-role="default-foot-bar">
      {% include "TopxiaWebBundle::powered-by.html.twig" %}
      {{ setting('site.analytics')|raw }}
      <div class="pull-right">{% if setting('site.copyright') %}课程内容版权均归<a href="/">{{ setting('site.copyright') }}</a>所有{% endif %}&nbsp;{% if setting('site.icp') %}<a href="http://www.miibeian.gov.cn/" target="_blank">{{ setting('site.icp') }}</a>{% endif %}</div>

      <div class="pull-right mhs"><a href="{{ path('course_archive') }}">课程存档</a></div>
    </div>
  </div>

  {% block bottom %}{% endblock %}
  <div id="login-modal" class="modal" data-url="/login/ajax"></div>
<div id="modal" class="modal"></div>
{% endblock %}

{% include 'TopxiaWebBundle::script_boot.html.twig' with {script_main: asset('bundles/topxiaweb/js/app.js')} %}


</body>
</html>