<!DOCTYPE html>
<html lang="en">
<style type="text/css">
    div.scrollmenu {
        width: 98vw;
    }
    
</style>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="user-scalable=0; initial-scale=1.0; width=device-width; maximum-scale=1.0;">
    <link href="ico/favicon.ico" rel="shortcut icon">
    <link rel="stylesheet" href="<?php echo e(asset('front/css/bootstrap.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('front/css/style.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('front/css/typicons.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(asset('front/css/font-awesome.css')); ?>" />
    <link rel="stylesheet" href="<?php echo e(asset('front/js/tip/tooltipster.css')); ?>">
    <script type='text/javascript' src="<?php echo e(asset('front/js/jquery.js')); ?>"></script>
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css')); ?>"/>
</head>
<body>
    <div style="width: 100vw;padding-top: 1vh;">
        <a class="btn btn-info" href="<?php echo e($url . 'getNewsData&uid=' . $user_id); ?>">返回未讀公告</a>
    </div>
    <div class="row scrollmenu" style="width: 100vw;margin-top: 5px;">
        <table style="margin-left: 20px;width: 100vw-20px;margin-bottom: 10vh;" border="1">
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap><?php echo app('translator')->get('messages.title'); ?></td>
                <td style="width: 70vw;"><?php echo e($news->title); ?></td>
            </tr>
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap><?php echo app('translator')->get('messages.publish_dept'); ?></td>
                <td style="background-color:#ECF5FF;width:75vw;"><?php echo e($news->author); ?></td>
            </tr>
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap><?php echo app('translator')->get('messages.publish_date'); ?></td>
                <td style="background-color:#ECF5FF;width:75vw;"><?php echo e($news->created_at); ?></td>
            </tr>
            <?php if($news->file != ''): ?>
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap><?php echo app('translator')->get('messages.attachment'); ?></td>
                <td style="background-color:#ECF5FF;width:75vw;"><a href='<?php echo e($news->file); ?>'><?php echo app('translator')->get('messages.clickMeToViewAttachment'); ?></a></td>
            </tr>
            <?php endif; ?>
            <?php if($news->link != ''): ?>
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap><?php echo app('translator')->get('messages.related_link'); ?></td>
                <td style="background-color:#ECF5FF;width:75vw;"><a href='<?php echo e($news->link); ?>'><?php echo app('translator')->get('messages.clickMeToViewAttachment'); ?></a></td>
            </tr>
            <?php endif; ?>
            <?php if($news->cover_img != ''): ?>
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap>封面圖檔</td>
                <td style="background-color:#ECF5FF;width:75vw;"><img src="<?php echo e($news->cover_img); ?>"></td>
            </tr>
            <?php endif; ?>
            <?php if($news->content != ''): ?>
            <tr>
                <td style="background-color:#ACD6FF;width:25vw;" nowrap>內容</td>
                <td style="background-color:#ECF5FF;width:75vw;word-break:break-all;"><?php echo $news->content; ?></td>
            </tr>
            <?php endif; ?>
        </table>
    </div>

    <script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/datatables/media/js/jquery.dataTables.min.js')); ?>"></script>
    <script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js')); ?>"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            var imgs = document.getElementsByTagName('img');
            for(var i=0; i<imgs.length;i++){
                var img = imgs[i];
                img.style.maxWidth = '100%';
                img.style.height = 'auto';
            }
        });
    </script>
</body>

</html>
