szurubooru/src/Views/post-view.phtml

103 lines
3.4 KiB
PHTML
Raw Normal View History

2013-10-07 20:45:09 +02:00
<?php if (!empty($this->context->transport->errorMessage)): ?>
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
<?php else: ?>
2013-10-12 10:46:15 +02:00
<div id="sidebar">
<nav>
<div class="left">
<?php if ($this->context->transport->nextPostId): ?>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->transport->nextPostId]) ?>">
<?php else: ?>
<a class="inactive">
<?php endif ?>
<i class="icon-next"></i>
<span>next post</span>
</a>
</div>
<div class="right">
<?php if ($this->context->transport->prevPostId): ?>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->transport->prevPostId]) ?>">
<?php else: ?>
<a class="inactive">
<?php endif ?>
<span>prev post</span>
<i class="icon-prev"></i>
</a>
</div>
<div class="clear"></div>
</nav>
<div class="details">
<h1>details</h1>
<div class="dl-box">
<a href="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>">
<span class="permalink">
<i class="icon-dl"></i>
</span>
<span class="ext">
<?php echo substr($this->context->transport->post->orig_name, strrpos($this->context->transport->post->orig_name, '.') + 1) ?>
</span>
<span class="size">
<?php echo TextHelper::useBytesUnits($this->context->transport->post->size) ?>
</span>
</a>
</div>
<div class="details-box">
<div class="uploader">
<span class="key">Uploader:</span>
<span class="value">
<a href="<?php echo \Chibi\UrlHelper::route('user', 'view', ['id' => $this->context->transport->post->user->id]) ?>">
<?php echo $this->context->transport->post->user->name ?>
</a>
</span>
</div>
<div class="date">
<span class="key">Date:</span>
<span class="value"><?php echo date('Y-m-d H:i', $this->context->transport->post->upload_date) ?></span>
</div>
<div class="safety">
<span class="key">Safety:</span>
<span class="value"><?php echo PostSafety::toString($this->context->transport->post->safety) ?></span>
</div>
</div>
</div>
<div class="tags">
<h1>tags</h1>
<!-- todo: edit tags -->
<ul>
<?php foreach ($this->context->transport->post->sharedTag as $tag): ?>
<li>
<a href="<?php echo \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>">
<?php echo $tag->name ?>
</a>
<span class="count">
<?php echo TextHelper::useDecimalUnits($this->context->transport->tagDistribution[$tag->name]) ?>
</span>
</li>
<?php endforeach ?>
</ul>
</div>
<!-- todo: favorites -->
<!-- todo: control -->
2013-10-09 21:58:57 +02:00
</div>
2013-10-12 10:46:15 +02:00
<div id="inner-content">
<div class="post-wrapper">
<?php if ($this->context->transport->post->type == PostType::Image): ?>
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/>
<?php elseif ($this->context->transport->post->type == PostType::Flash): ?>
<embed type="application/x-shockwave-flash" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>"/>
<?php endif ?>
</div>
</div>
2013-10-07 20:45:09 +02:00
<?php endif ?>