{% load staticfiles i18n %}
{% load compress %}
{% load seahub_tags avatar_tags group_avatar_tags %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block sub_title %}{% endblock %}{{ site_title }}</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="{% trans "File Collaboration Team Organization" %}" />
<link rel="icon" type="image/x-icon" href="{{ MEDIA_URL }}img/favicon.png?t=1398068110" />
<!--[if IE]>
<link rel="shortcut icon" href="{{ MEDIA_URL }}img/favicon.png?t=1398068110"/>
<![endif]-->

{% compress css %}
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/seahub.css?t=1398068110" />
<link rel="stylesheet" type="text/css" href="{% static "css/select2-3.5.2.css" %}"/>
<link rel="stylesheet" type="text/css" href="{% static "css/magnific-popup.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "css/backbone.css" %}"/>
{% endcompress %}

{% block extra_style %}{% endblock %}
{% if branding_css != '' %}<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}{{ branding_css }}" />{% endif %}
</head>

<body>
    <div id="wrapper" class="{{ LANGUAGE_CODE }}">
        <!--[if lt IE 10]>
        <p id="top-browser-tip">{% trans "We no longer support this version of IE. Please upgrade it to version 10 or above." %} <span class="close">{% trans "Close" %}</span></p>
        <![endif]-->
        {% block info_bar_message %}
        {% if request.user.is_authenticated and request.cur_note %}
        <div id="info-bar">
            <p id="info-bar-info">{{ request.cur_note.message|urlize|url_target_blank }}</p>
            <img src="{{ MEDIA_URL }}img/del.png" class="close" alt="" />
        </div>
        {% endif %}
        {% endblock info_bar_message %}

        <div id="header">
            <div id="header-inner">
                {% block notice_panel %}{% endblock %}
                <a href="{{ SITE_ROOT }}" id="logo" class="fleft">
                    {% if seacloud_mode %}
                    <img src="{{ MEDIA_URL }}img/seacloud_logo.png?t=1398068110" title="Seacloud" alt="logo" width="186" height="31" />
                    {% else %}
                    <img src="{{ MEDIA_URL }}{{ logo_path }}" title="Seafile" alt="logo" width="{{logo_width}}" height="{{logo_height}}" />
                    {% endif %}
                </a>
                {% block nav %}
                <ul class="nav">
                    <li class="nav-item">
                    <a href="{{ SITE_ROOT }}#" class="a">{% trans "My Home" %}</a>
                    </li>

                    {% if grps %}
                    <li class="nav-item nav-item-group" style="position:relative;">
                    <a href="{% url 'group_list' %}" class="a" id="top-nav-grp">{% trans "Groups" %} <span class="icon-caret-down"></span></a>
                    </li>
                    {% else %}
                    <li class="nav-item">
                    <a href="{% url 'group_list' %}" class="a">{% trans "Groups" %}</a>
                    </li>
                    {% endif %}

                    {% if user.permissions.can_view_org %}
                    <li class="nav-item">
                    <a href="{{ SITE_ROOT }}#org/" class="a">{% trans "Organization" %}</a>
                    </li>
                    {% endif %}

                    <li class="nav-item">
                    <a href="{{ SITE_ROOT }}help/" class="a">{% trans "Help" %}</a>
                    </li>
                </ul>
                {% endblock %}

                {% block header_right %}
                {% if request.user.is_authenticated %}
                <div class="fright">
                {% if has_file_search %}
                    {% include 'snippets/search_form.html' %}
                {% endif %}

                <div id="msg-count" class="fleft">
                    <div id="notice-icon" class="cspt" title="{% trans "Notifications" %}">
                        <img src="{{ MEDIA_URL }}img/bell.png" alt="" />
                        <span class="num hide">0</span>
                    </div>
                    <div id="notice-popup" class="hide">
                        <div class="outer-caret up-outer-caret"><div class="inner-caret"></div></div>
                        <h3 class="hd">{% trans "Notifications" %}</h3>
                        <div class="con">
                            <img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
                            <ul class="hide" id="notice-list"></ul>
                            <p class="alc"><a href="{% url 'user_notification_list' %}" class="all">{% trans "See All Notifications" %}</a></p>
                        </div>
                        <img src="{{ MEDIA_URL }}img/del.png" class="close"/>
                    </div>
                </div>

                <div id="account" class="fright">
                    <div id="my-info">
                        {% avatar request.user 36 %} <span class="icon-caret-down vam"></span>
                    </div>
                    <div id="user-info-popup" class="top-info-popup hide">
                        <div class="outer-caret up-outer-caret"><div class="inner-caret"></div></div>
                        <div class="item ovhd">
                            {% avatar request.user 36 %}
                            <div class="txt">
                                {{ request.user.username|email2nickname }} <br />
                                {{ request.user.username}}
                            </div>
                        </div>
                        <img src="{{MEDIA_URL}}img/loading-icon.gif" alt="" class="loading-tip" />
                        <div id="space-traffic" class="hide" data-url="{% url 'space_and_traffic' %}"></div>
                        <a class="item" href="{{ SITE_ROOT }}profile/">{% trans "Settings" %}</a>
                        <a href="{{ SITE_ROOT }}accounts/logout/" class="item" id="logout">{% trans "Log out" %}</a>
                    </div>
                    {% if request.user.is_staff %}
                    <div class="manage">
                        {% block sys_admin %}<a href="{% url 'sys_useradmin' %}" title="{% trans "System Admin" %}" class="a"><img src="{{ MEDIA_URL }}img/admin_in.png" alt="" /></a>{% endblock %}
                    </div>
                    {% endif %}
                    {% if request.user.org and request.user.org.is_staff %}
                    <div class="manage">
                        {% block org_admin %}<a href="{% url 'org_user_admin'%}" title="{% trans "Admin" %}" class="a"><img src="{{ MEDIA_URL }}img/admin_in.png" alt="" /></a>{% endblock %}
                    </div>
                    {% endif %}
                </div>
                </div>
                {% endif %}
                {% endblock %}
            </div>
        </div>

        <div id="main" class="clear">
            <div id="title-panel" class="w100 ovhd">
                {% block title_panel %}{% endblock %}
            </div>
            <div id="left-panel">
                {% block left_panel %}{% endblock %}
            </div>
            <div id="right-panel">
                {% block right_panel %}{% endblock %}
            </div>
            <div id="main-panel" class="clear w100 ovhd">
                {% block main_panel %} {% endblock %}
            </div>

            <div id="confirm-popup" class="hide">
                <div id="confirm-con"></div>
                <button id="confirm-yes" class="btn">{% trans "Yes"%}</button>
                <button class="simplemodal-close btn">{% trans "No"%}</button>
            </div>
        </div>

        {% include 'footer.html' %}
        {% include 'js/templates.html' %}
</div><!-- wrapper -->

<script type="text/javascript">
var app = {
    config: {
        mediaUrl: '{{ MEDIA_URL }}',
        siteRoot: '{{ SITE_ROOT }}',
        _tmplRoot: '{{ SITE_ROOT }}_templates/js/'
    }
};
</script>
<script src="{{ STATIC_URL }}scripts/i18n/{{ LANGUAGE_CODE }}/djangojs.js"></script>

{% block extra_script %}{% endblock %}

</body>
</html>
