<!--留言板模块-->
<div ms-controller="postMessage" id="postMessage">
    <div class="pannel-box content-message-post" id="msgSendBox">
        <h2 class="pannel-title">{{__('lc_document_postMessage')}}
            <small>
                <a href="javascript:void(0)" ms-on-click="@cancelReply">{{__('label_messageBoard_cancelReply')}}</a>
            </small>
        </h2>
        <div class="give-message">
            <form name="postMsgForm" ms-validate="@validate">
                <input id="contentId" type="hidden" value="{{post._id}}" />
                <textarea class="form-control" rows="3" name="email" ms-duplex="@content"
                    placeholder="{{__('lc_please_write_message')}}"
                    ms-rules="{required:true,minlength:5,maxlength:200 }"
                    data-required-message="{{__('validate_inputNull',[__('label_messageBoard_message')])}}"
                    data-message="{{__('validate_rangelength',[__('label_messageBoard_message'),5,200])}}"></textarea>
                <div class="send-button">
                    <div class="user-notice">
                        {% if logined %} {{__('lc_message_hello')}}，{{userInfo.userName}}！ {% else %}
                        <a href="/users/login">{{__('lc_login')}}</a>&nbsp;{{__('lc_join_document_postMessage')}}
                        {% endif %}
                        <span class="text-danger" :visible="@showErr" ms-html="@message"></span>
                    </div>
                    <button type="submit" class="btn btn-primary">{{__('lc_postMessage')}}</button>
                </div>
            </form>
        </div>
    </div>

    <div :visible="@messageList.length>0" class="pannel-box content-message-list">
        <h1 class="pannel-title">{{__('label_messageBoard_messagelist')}}（
            <span ms-text="@messageList.length"></span> ）</h1>
        <div class="content-list">
            <ul>
                <li ms-for="item in @messageList">
                    <div class="row">
                        <div class="col-md-12 col-sm-12 msgList" ms-hover="['active']">
                            <div class="col-md-1 col-xs-1 user-logo">
                                <img ms-attr="{src: @getAuthor(@item,'adminAuthor','author').logo}" />
                            </div>
                            <div class="col-md-11 col-xs-11" ms-attr="{id: 'msglist_' + @item._id}">
                                <div class="user-name">
                                    <div class="name">
                                        <span ms-text="@getAuthor(@item,'adminAuthor','author').userName"></span>
                                    </div>
                                    &nbsp;
                                    <span class="time" ms-text="@item.date"></span>
                                    <span class="reply pull-right">
                                        <a href="javascript:void(0)"
                                            ms-on-click="@reply(@item._id,@getAuthor(@item,'adminAuthor','author'),@item.utype)">{{__('label_messageBoard_reply')}}</a>
                                    </span>
                                </div>
                                <div class="user-content">
                                    <span :visible="@getAuthor(@item,'replyAuthor','adminReplyAuthor')"
                                        style="color: #409EFF;margin-right:10px;"
                                        ms-text="'@'+@getAuthor(@item,'replyAuthor','adminReplyAuthor').userName"></span>
                                    <span ms-html="@item.content"></span>
                                </div>
                            </div>
                        </div>
                    </div>
                </li>

            </ul>
        </div>
    </div>

</div>
<script>
    $(function () {
        getPostMessages();
    })
</script>