{% extends base %}

{% block head %}

<link rel="stylesheet" type="text/css" href="{{_server_home}}/_static/lib/webuploader/webuploader.css">
<script type="text/javascript" src="{{_server_home}}/_static/lib/webuploader/webuploader.nolog.min.js"></script>
<script type="text/javascript" src="{{_server_home}}/_static/js/message/message.js?ts={{_ts}}"></script>

{% end %}

{% block body_left %}
    {% include message/component/message_title.html %}

    {% init month_size = 0 %}

    <!-- Tab页 -->
    {% include message/component/message_tab_log.html %}

    {% include common/date/month_picker.html %}

    <!-- 编辑 -->
    {% include message/component/message_edit.html %}


    <div class="card">
        
        <a class="list-link" href="{{_server_home}}/message/calendar?date={{date}}">
            <span>按月查看</span>
            <div class="float-right">
                <span class="list-item-badge">{{ month_size }}</span>
                <i class="fa fa-chevron-right"></i>
            </div>
        </a>

    </div>
        
    <div class="card">
        {% if len(message_list) == 0 %}
            {% include common/text/empty_text.html %}
        {% end %}

        {% for folder in message_list %}
            <a href="{{_server_home}}/message/date_detail?date={{folder.date}}" class="list-link {{folder.css_class}}">
                <span>{{folder.title}}</span>
                <div class="float-right">
                    <span class="list-item-badge">{{ len(folder.item_list) }}</span>
                    <i class="fa fa-chevron-right"></i>
                </div>
            </a>
        {% end %}
    </div>
    
    <script type="text/javascript">
        $(function (e) {
            function onMonthSelected(event) {
                var date = event.target;
                var show_empty = getUrlParam("show_empty", "");
                window.location.href = "?date=" + date + "&show_empty=" + show_empty;
            }

            xnote.on("date.month.selected", onMonthSelected);
        })
    </script>

{% end %}

{% block body_right %}
    {% include message/component/message_date_right.html %}
{% end %}
