wikipoints/ground/views/pointsTemplate.php

93 lines
3.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if (App::getParam('user')) {
$user = User::model()->getByPK((int) App::getParam('user'));
if ($user->id == 0) {
App::redirect('/page/points/');
}
}
?>
<div id="pageSmoothBackground" style="background-image: url(<?= $randomPoint->getImg('middle') ?>);"></div>
<div class="container" style="background-color: rgba(255,255,255, 0.8);margin-top: -10px;padding-bottom: 30px;">
<div class="row">
<div class="col-md-12">
<h1 style="text-align: right;">Списки точек по категориям</h1>
<div class="coords-container">
Перейти: <a href="/">на карту</a>
<?php if (App::getParam('user')): ?>
/ <a href="/user/<?=$user->id?>">страница <?=$user->nick?></a>.
<?php endif; ?>
</div>
<div style="text-align: justify;">
<?php if ($notModeratedPoints): ?>
<h3>Точки на модерации</h3>
<?php foreach ($notModeratedPoints as $point): ?>
#<?= $point['id'] ?> <img src="/ico/lock.png" />
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<img src="<?= $point['categoryIcon'] ?>" /> <a href="/point/<?= $point['id'] ?>"><?= $point['name'] ?></a>
<?= $point['author'] ?>
<br/>
<?php endforeach; ?>
<hr/>
<?php endif; ?>
<h3>Выбор типа точки</h3>
<?php
foreach ($categories as $category) {
print "<a href='/page/points/category/$category->id'>";
print "<img src='$category->icon' title='$category->name' />";
print "</a>";
}
?>
<a href='/page/points/'>Все точки</a>
<?php
$header = 'Список точек';
if ((int) App::getParam('category')) {
$header = 'Список точек в категории "' . $categories[(int) App::getParam('category')]->name . '"';
}
if (isset($user) && $user && $user->id) {
$header = 'Список точек пользователя <a href="/user/'.$user->id.'">"' . $user->nick . '"</a>';
}
?>
<h3><?= $header ?></h3>
<?php foreach ($points as $point): ?>
#<?= $point['id'] ?> <img src="<?= $point['categoryIcon'] ?>" /> <a href="/point/<?= $point['id'] ?>"><?= $point['name'] ?></a>
<?= $point['author'] ?>
<br/>
<?php endforeach; ?>
</div>
</div>
</div>
<?php if (!(int) App::getParam('category')):?>
<nav>
<ul class="pagination">
<li class="<?= ($page >= $pagesCount) ? 'disabled' : '' ?>">
<a href="<?= ($page >= $pagesCount) ? '#' : '?page='.($page+1) ?>" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
<?php for ($index = $pagesCount; $index > 0; $index--): ?>
<li><a href="?page=<?= $index ?>" style="<?= $index==$page ? 'background-color: #eeeeed;' : '' ?>"><?= $index ?></a></li>
<?php endfor; ?>
<li class="<?= ($page <= 1) ? 'disabled' : '' ?>">
<a href="<?= ($page <= 1) ? '#' : '?page='.($page-1) ?>" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</ul>
</nav>
<?php endif; ?>
<hr/>
<div class="row">
<div class="col-md-12">
<a href="/point/<?= $randomPoint->id ?>" style="float: left; margin: 0 20px 0 0;"><img src="<?= $randomPoint->getImg() ?>" style="width: 200px;"/></a>
<h3 style="margin-top: 0;">Это интересно: <?= $randomPoint->name ?></h3>
<p>
<?= mb_substr($randomPoint->description, 0, 400, 'UTF-8') ?>…
<a class="" href="/point/<?= $randomPoint->id ?>" role="button"><nobr> читать далее »</nobr></a>
</p>
</div>
</div>
</div>