luyadev/luya-module-news

View on GitHub
src/frontend/views/default/detail.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php
use luya\admin\filters\MediumCrop;
use luya\news\models\Article;
use luya\web\View;

/** @var View $this  */
/** @var Article $model */
?>
<h1><?= $model->title; ?></h1>
<?php if ($model->image_id): ?>
    <img src="<?= $model->getImage()->applyFilter(MediumCrop::identifier())->source; ?>" class="pull-right img-responsive img-rounded" />
<?php endif; ?>
<?= $model->text; ?>
<?php if ($model->image_list): ?>
    <div class="row" style="margin-top:15px;">
        <?php foreach ($model->image_list as $imageId): $image = Yii::$app->storage->getImage($imageId['imageId']); ?>
            <div class="col-md-4">
                <img src="<?= $image->source; ?>" class="img-responsive img-rounded" />
            </div>
        <?php endforeach;?>
    </div>
<?php endif; ?>
<?php if ($model->link): ?>
    <a href="<?= $model->link->getHref(); ?>" target="<?= $model->link->getTarget(); ?>">Detail</a>
<?php endif; ?>
<p>Author: <?= $model->authorName; ?></p>
<p style="margin-top:15px;"><small><i><?= strftime('%A, %e. %B %Y', $model->timestamp_create); ?></i></small>