szurubooru/src/Views/user-list.phtml

73 lines
2.1 KiB
PHTML
Raw Normal View History

<?php
2014-02-27 15:04:36 +01:00
CustomAssetViewDecorator::setSubTitle('users');
CustomAssetViewDecorator::addStylesheet('user-list.css');
CustomAssetViewDecorator::addStylesheet('paginator.css');
if ($this->context->user->hasEnabledEndlessScrolling())
2014-02-27 15:04:36 +01:00
CustomAssetViewDecorator::addScript('paginator-endless.js');
?>
2013-10-16 13:07:01 +02:00
<nav class="sort-styles">
<ul>
<?php
$filters =
[
'order:alpha,asc' => 'Sort A&rarr;Z',
'order:alpha,desc' => 'Sort Z&rarr;A',
'order:date,asc' => 'Sort old&rarr;new',
'order:date,desc' => 'Sort new&rarr;old',
];
2013-10-16 13:07:01 +02:00
if ($this->config->registration->staffActivation)
$filters['pending'] = 'Pending staff review';
2013-10-16 13:07:01 +02:00
?>
<?php foreach ($filters as $key => $text): ?>
<?php if ($this->context->filter == $key): ?>
2013-10-16 13:07:01 +02:00
<li class="active">
<?php else: ?>
<li>
<?php endif ?>
2014-04-27 14:44:06 +02:00
<a href="<?= \Chibi\UrlHelper::route('user', 'list', ['filter' => $key]) ?>"><?= $text ?></a>
2013-10-16 13:07:01 +02:00
</li>
<?php endforeach ?>
</ul>
</nav>
<?php if (empty($this->context->transport->users)): ?>
<p class="alert alert-warning">No users to show.</p>
<?php else: ?>
2014-02-16 12:27:47 +01:00
<div class="users-wrapper">
<div class="users paginator-content">
<?php foreach ($this->context->transport->users as $user): ?>
<div class="user">
2014-04-27 14:44:06 +02:00
<a class="avatar" href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>">
<img src="<?= htmlspecialchars($user->getAvatarUrl(100)) ?>" alt="<?= $user->name ?>"/>
2014-02-16 12:27:47 +01:00
</a>
<div class="details">
<h1>
2014-04-27 14:44:06 +02:00
<a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $user->name]) ?>">
<?= $user->name ?>
2014-02-16 12:27:47 +01:00
</a>
</h1>
2013-10-16 13:07:01 +02:00
2014-04-27 14:44:06 +02:00
<div class="date-registered" title="<?= TextHelper::formatDate($user->joinDate, true) ?>">
Registered: <?= TextHelper::formatDate($user->joinDate, false) ?>
</div>
<div class="post-count">
2014-04-27 14:44:06 +02:00
Uploaded: <?= TextHelper::useDecimalUnits($user->getPostCount()) ?>
</div>
<div class="fav-count">
2014-04-27 14:44:06 +02:00
Favorites: <?= TextHelper::useDecimalUnits($user->getFavoriteCount()) ?>
</div>
2014-02-16 12:27:47 +01:00
</div>
2013-10-16 13:07:01 +02:00
</div>
2014-02-16 12:27:47 +01:00
<?php endforeach ?>
</div>
2014-03-04 18:15:16 +01:00
<div class="clear"></div>
2013-10-16 13:07:01 +02:00
</div>
<?php $this->renderFile('paginator') ?>
<?php endif ?>