This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/app/views/post/show_partials/_statistics_panel.php

47 lines
2.4 KiB
PHP
Raw Normal View History

2013-10-27 01:06:58 +02:00
<div id="stats" class="vote-container">
<ul>
<li><?= $this->t('.id') ?>: <?= $this->post->id ?></li>
2016-12-02 08:02:17 +01:00
<?php if ($this->post->image()) : ?>
<div style="width: 25em; height: <?= max($this->user->avatar_height, 80) ?>px; position: relative;">
<div style="position: absolute; bottom: 0;">
<?= $this->avatar($this->user, 1) ?>
</div>
2016-12-17 17:06:19 +01:00
<?php endif ?>
2013-10-27 01:06:58 +02:00
<li><?= $this->t('.posted') ?>: <?= $this->t(['.posted_data_html', 'time' => $this->linkTo($this->t(['time.x_ago', 't' => $this->timeAgoInWords($this->post->created_at)]), ["#index", 'tags' => "date:" . substr($this->post->created_at, 0, 10)], ['title' => substr(date('r', strtotime($this->post->created_at)), 0, -6)]), 'user' => $this->linkToIf($this->post->user_id, $this->post->author(), ['user#show', 'id' => $this->post->user_id])]) ?></li>
<?php if (current_user()->is_admin() && $this->post->approver) : ?>
<li><?= $this->t('.approver') ?>: <?= $this->post->approver->name ?></li>
<?php endif ?>
<?php if ($this->post->image()) : ?>
<li><?= $this->t('.size') ?>: <?= $this->post->width ?>x<?= $this->post->height ?></li>
<?php endif ?>
<?php if ($this->post->source) : ?>
<?php
if (strpos($this->post->source, 'http') === 0) :
$init = substr($this->post->source, 4, 1) == 's' ? 8 : 7;
?>
<li><?= $this->t('.source') ?>: <?= $this->linkTo(substr($this->post->source, $init, 20) . "...", $this->post->normalized_source(), array('rel' => 'nofollow', 'target' => '_blank')) ?></li>
<?php else: ?>
<li><?= $this->t('.source') ?>: <?= $this->post->source ?></li>
<?php endif ?>
<?php endif ?>
<li><?= $this->t('.rating') ?>: <?= $this->post->pretty_rating() ?> <?= $this->vote_tooltip_widget() ?></li>
<li>
<?= $this->t('.score') ?>: <span id="post-score-<?= $this->post->id ?>"><?= $this->post->score ?></span>
<?= $this->vote_widget(current_user()) ?>
</li>
<li><?= $this->t('.favorited_by') ?>: <span id="favorited-by"><?= $this->favorite_list($this->post) ?></span> <span id="favorited-by-more"></span></li>
</ul>
</div>
<?= $this->contentFor('post_cookie_javascripts', function() { ?>
<script type="text/javascript">
var widget = new VoteWidget($("stats"));
widget.set_post_id(<?= $this->post->id ?>);
widget.init_hotkeys();
Post.init_add_to_favs(<?= $this->post->id ?>, $("add-to-favs"), $("remove-from-favs"));
</script>
<?php }) ?>