<?php
use wap\assets\AppAsset;
use yii\helpers\Html;
use yii\helpers\Url;

$this->title = '日志详情';

/* @var $this \yii\web\View */

$asset = $this->getAssetManager()->getBundle(AppAsset::className());
$this->registerJsFile($asset->baseUrl.'/js/blog.detail.js', ['depends' => [AppAsset::className()]]);
?>

<div class="modal fade">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-body">
      </div>
    </div>
  </div>
</div> 

<div class="mainbody">
    <div class="detail-content">
        <form class="detailform">
            <tbody>
                <table width="100%">
                    <tr>
                        <td width="60">标题</td>
                        <td><?= $model['title'] ?></td>
                    </tr>
                    <tr>
                        <td>提交人</td>
                        <td><?= $model['user']['realname'] ?>   <?= date('Y-m-d', $model['work_time']) ?>/<?= $model['workload'] ?>H</td>
                    </tr>
                    <tr>
                        <td>关联<?= (!empty($model['link_data']['link_type']['name'])) ? $model['link_data']['link_type']['name'] : '' ?></td>
                        <td>
                           <?php  $linkType = $model->link_data['link_type']; if (!empty($model->link_data)&&!empty($model->link_data[$linkType['pk']])) : ?>
                            <a href="<?php $linkType['view_url']['id'] = $model->link_data[$linkType['pk']];
                            echo Url::to($linkType['view_url']) ?>" target="_blank" ><?= $model->link_data['name'] ?></a>
                            <?php endif; ?>
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">内容</td>
                        <td><?= $model['content'] ?></td>
                    </tr>
                    <tr class="formend">
                        <td>批示</td>
                        <td><input type="text" name="remark" class="form-control" value="<?= $model['remark'] ?>"></td>
                    </tr>
                </table>
            </tbody>
            <?php if ($model['user_id'] != Yii::$app->user->id) : ?>
            <p><button type="button" id="approve-btn" data-url="<?= Url::to(['detail', 'id' => $model['blog_id']]) ?>" class="btn btn-primary">提  交</button></p>
            <?php endif; ?>
        </form>
    </div>
</div>
