<?php
use yii\helpers\Url;
use yii\helpers\StringHelper;

?>
<div class="newslist">
    <ul>
        <?php if (empty($messages)) : ?>
            <li style="text-align:center;">暂无数据...</li>
        <?php else : ?>
            <?php foreach ($messages as $data) : ?>
                <li>
                    <span><?= date("Y-m-d", $data['message']['create_time']) ?></span>
                    <?php if (empty($data['message']['is_reply'])) : ?>
                    <a href="javascript:;" title="<?= $data['message']['title'] ?>" class="open-only-see-dialog"  data-url="<?= Url::to(['/message/only-see', 'id' => $data['message_id'], 'link_id' => $data['link_id']]) ?>"  data-height="400" data-width="850" data-reload="false" data-title="查看消息通知" ><?= StringHelper::truncate($data['message']['title'], 18) ?></a>
                    <?php else : ?>
                    <a href="javascript:;" title="<?= $data['message']['title'] ?>" class="open-dialog"  data-url="<?= Url::to(['/message/look-reply', 'id' => $data['message_id'], 'link_id' => $data['link_id']]) ?>"  data-height="400" data-width="850" data-reload="false"  data-title="查看消息通知" ><?= StringHelper::truncate($data['message']['title'], 18) ?></a>
                    <?php endif; ?>
                </li>
            <?php endforeach; ?>
        <?php endif; ?>
    </ul>
</div>
