Обновлённая страница точки; переход на страницу точки с карточки.
This commit is contained in:
parent
4810904059
commit
e12dde2cf1
|
|
@ -4,6 +4,7 @@ public/photos/*.jpg
|
||||||
public/photos/*.jpeg
|
public/photos/*.jpeg
|
||||||
public/photos/*.png
|
public/photos/*.png
|
||||||
public/photos/*.gif
|
public/photos/*.gif
|
||||||
|
public/photos/*?*
|
||||||
|
|
||||||
public/photos/small/*.jpg
|
public/photos/small/*.jpg
|
||||||
public/photos/small/*.jpeg
|
public/photos/small/*.jpeg
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ class PageController extends Controller
|
||||||
|
|
||||||
$point->categoryIcon = $categories[$point->categoryId]['icon'];
|
$point->categoryIcon = $categories[$point->categoryId]['icon'];
|
||||||
$point->categoryName = $categories[$point->categoryId]['name'];
|
$point->categoryName = $categories[$point->categoryId]['name'];
|
||||||
|
preg_match_all("/.*?[.?!](?:\s|$)/s", $point->descriptionHtml, $items);
|
||||||
|
|
||||||
$randomPoint = Point::model()->getRandom();
|
$randomPoint = Point::model()->getRandom();
|
||||||
$similarPoints = Point::model()->getAll(array('where' => 'categoryId = '.$point->categoryId.' AND `id` <> '.$point->id.' ORDER BY RAND() LIMIT 6;'));
|
$similarPoints = Point::model()->getAll(array('where' => 'categoryId = '.$point->categoryId.' AND `id` <> '.$point->id.' ORDER BY RAND() LIMIT 6;'));
|
||||||
|
|
@ -75,6 +76,7 @@ class PageController extends Controller
|
||||||
|
|
||||||
self::render('point.php', array(
|
self::render('point.php', array(
|
||||||
'point' => $point,
|
'point' => $point,
|
||||||
|
'text' => $items[0],
|
||||||
'randomPoint' => $randomPoint,
|
'randomPoint' => $randomPoint,
|
||||||
'similarPoints' => $similarPoints,
|
'similarPoints' => $similarPoints,
|
||||||
'closestPoints' => $closestPoints,
|
'closestPoints' => $closestPoints,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,9 @@
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body style="padding: 10px 25px; overflow-y: scroll;">
|
<body style="padding: 10px 25px; overflow-y: scroll;">
|
||||||
|
<div class="header">
|
||||||
|
<a href="/"><img src="/img/logo_page.png" title="WIKIPOINTS.RU" /></a>
|
||||||
|
</div>
|
||||||
<?= isset($content) && !empty($content) ? $content : 'No content =(' ?>
|
<?= isset($content) && !empty($content) ? $content : 'No content =(' ?>
|
||||||
<?= self::renderPartial('modals/about.php', array(), true) ?>
|
<?= self::renderPartial('modals/about.php', array(), true) ?>
|
||||||
<?= self::renderPartial('modals/howToUse.php', array(), true) ?>
|
<?= self::renderPartial('modals/howToUse.php', array(), true) ?>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,8 @@
|
||||||
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-2" style="width: 250px!important;">
|
<div class="col-md-12">
|
||||||
<a href="/"><img src="/img/logo.png" style="width: 198px;"/></a>
|
<h1 style="text-align: right;"><?= $point->name ?></h1>
|
||||||
<br/>
|
<div class="coords-container">
|
||||||
<h2>Автор точки</h2>
|
|
||||||
<img src="<?= $point->authorUser->photo ?>" style="max-width: 180px;" />
|
|
||||||
<p><span class="glyphicon glyphicon-user"></span> <?= $point->authorUser->nick ?></p>
|
|
||||||
<p><span class="glyphicon glyphicon-pencil"></span> <?= $point->authorUser->getPointsCount() ?> - создано точек</p>
|
|
||||||
<!-- <p><span class="glyphicon glyphicon-thumbs-up"></span> 10 - рейтинг</p>-->
|
|
||||||
<hr/>
|
|
||||||
<h3><?= $randomPoint->name ?></h3>
|
|
||||||
<p style="text-align: center;"><a href="/page/point/id/<?= $randomPoint->id ?>"><img src="<?= $randomPoint->getImg() ?>" style="width: 200px;"/></a></p>
|
|
||||||
<p>
|
|
||||||
<?= mb_substr($randomPoint->description, 0, 120, 'UTF-8') ?>...
|
|
||||||
<a class="" href="/page/point/id/<?= $randomPoint->id ?>" role="button"><nobr>далее »</nobr></a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-7">
|
|
||||||
<h1><?= $point->name ?></h1>
|
|
||||||
|
|
||||||
Координаты:
|
Координаты:
|
||||||
<nobr>
|
<nobr>
|
||||||
<?= $point->lat > 0 ? 'N' : 'S' ?><?= $point->lat > 0 ? $point->lat : (-1 * $point->lat) ?>°
|
<?= $point->lat > 0 ? 'N' : 'S' ?><?= $point->lat > 0 ? $point->lat : (-1 * $point->lat) ?>°
|
||||||
|
|
@ -30,11 +15,9 @@
|
||||||
</nobr>
|
</nobr>
|
||||||
/
|
/
|
||||||
<a href="/?point=<?= $point->id ?>">На карте</a>
|
<a href="/?point=<?= $point->id ?>">На карте</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<br/><br/>
|
|
||||||
<?php
|
<?php
|
||||||
preg_match_all("/.*?[.?!](?:\s|$)/s", $point->descriptionHtml, $items);
|
|
||||||
$text = $items[0];
|
|
||||||
if (count($text) > 4)
|
if (count($text) > 4)
|
||||||
{
|
{
|
||||||
for ($index = 0; $index < 4; $index++)
|
for ($index = 0; $index < 4; $index++)
|
||||||
|
|
@ -84,10 +67,11 @@
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<hr/>
|
<p style="margin-top: 25px; text-align: right;">
|
||||||
<p>
|
|
||||||
[ <span class="glyphicon glyphicon-star"></span> <?= $countInFavs ?> - в закладках ]
|
[ <span class="glyphicon glyphicon-star"></span> <?= $countInFavs ?> - в закладках ]
|
||||||
[ <span class="glyphicon glyphicon-thumbs-up"></span> <?= $countLikes ?> - нравится ]
|
[ <span class="glyphicon glyphicon-thumbs-up"></span> <?= $countLikes ?> - нравится ]
|
||||||
|
[ <span class="glyphicon glyphicon-user"></span> <?= $point->authorUser->nick ?> - <span class="glyphicon glyphicon-pencil"></span> <?= $point->authorUser->getPointsCount() ?> ]
|
||||||
|
[ <span class="glyphicon glyphicon-new-window"></span> <a href="<?= $point->source ?>" target="_blank">источник</a> ]
|
||||||
|
|
||||||
<!-- [ <span class="glyphicon glyphicon-star"></span>
|
<!-- [ <span class="glyphicon glyphicon-star"></span>
|
||||||
<span class="glyphicon glyphicon-star"></span>
|
<span class="glyphicon glyphicon-star"></span>
|
||||||
|
|
@ -96,19 +80,39 @@
|
||||||
<span class="glyphicon glyphicon-star-empty"></span> ] -->
|
<span class="glyphicon glyphicon-star-empty"></span> ] -->
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2" style="width: 250px!important;">
|
</div>
|
||||||
<h2>Поблизости:</h2>
|
<hr/>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h3 style="margin-top: 0;">Поблизости:</h3>
|
||||||
<?php if (empty($closestPoints)): ?>
|
<?php if (empty($closestPoints)): ?>
|
||||||
нет известных нам точек.
|
нет известных нам точек.
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php foreach ($closestPoints as $cPoint): ?>
|
<?php foreach ($closestPoints as $cPoint): ?>
|
||||||
<a href="/page/point/id/<?= $cPoint->id ?>"><img src="<?= $cPoint->getImg()?>" title="<?= $cPoint->name ?>" style="width: 105px;"/></a>
|
<a href="/page/point/id/<?= $cPoint->id ?>" style="display: inline-block; height: 139px; width: 186px; overflow: hidden;"><img src="<?= $cPoint->getImg() ?>" title="<?= $cPoint->name ?>" style="width: 186px;"/></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<hr/>
|
<hr/>
|
||||||
<h2>Похожие:</h2>
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h3 style="margin-top: 0;">Похожие:</h3>
|
||||||
<?php foreach ($similarPoints as $sPoint): ?>
|
<?php foreach ($similarPoints as $sPoint): ?>
|
||||||
<a href="/page/point/id/<?= $sPoint->id ?>"><img src="<?= $sPoint->getImg()?>" title="<?= $sPoint->name ?>" style="width: 105px;"/></a>
|
<a href="/page/point/id/<?= $sPoint->id ?>" style="display: inline-block; height: 139px; width: 186px; overflow: hidden;"><img src="<?= $sPoint->getImg() ?>" title="<?= $sPoint->name ?>" style="width: 186px;"/></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<a href="/page/point/id/<?= $randomPoint->id ?>" style="float: left; margin: 0 20px 0 0;"><img src="<?= $randomPoint->getImg() ?>" style="width: 200px;"/></a>
|
||||||
|
<h2 style="margin-top: 0;">Это интересно: <?= $randomPoint->name ?></h2>
|
||||||
|
<p>
|
||||||
|
<?= mb_substr($randomPoint->description, 0, 400, 'UTF-8') ?>...
|
||||||
|
<a class="" href="/page/point/id/<?= $randomPoint->id ?>" role="button"><nobr> читать далее »</nobr></a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br/><br/><br/>
|
||||||
|
|
@ -77,3 +77,6 @@ div#box {background-image: url('/img/back.png'); background-repeat: no-repeat; b
|
||||||
#suggestContainer {position: absolute;top: 40px;background-color: #fff;padding-bottom: 8px; border-bottom: 1px solid #333; width: 100%; display: none;}
|
#suggestContainer {position: absolute;top: 40px;background-color: #fff;padding-bottom: 8px; border-bottom: 1px solid #333; width: 100%; display: none;}
|
||||||
#suggestContainer > div:hover {background-color: #eee;}
|
#suggestContainer > div:hover {background-color: #eee;}
|
||||||
#suggestContainer > div.hover {background-color: #eee;}
|
#suggestContainer > div.hover {background-color: #eee;}
|
||||||
|
|
||||||
|
/* ------------- PAGE --------------------*/
|
||||||
|
.coords-container {text-align: right; margin-bottom: 20px; color: #777;font-size: 0.9em;}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -199,11 +199,11 @@ function showInfo(id)
|
||||||
description += '</div><div class="clear"></div>';
|
description += '</div><div class="clear"></div>';
|
||||||
description += '<div class="btn-group control">';
|
description += '<div class="btn-group control">';
|
||||||
|
|
||||||
if (data.source.length > 11)
|
// if (data.source.length > 11)
|
||||||
{
|
// {
|
||||||
description += '<a type="button" class="btn btn-default" href="' + data.source + '" target="blank"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>';
|
// description += '<a type="button" class="btn btn-default" href="' + data.source + '" target="blank"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>';
|
||||||
}
|
// }
|
||||||
// description += '<a type="button" class="btn btn-default" href="/page/point/id/' + id + '"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>';
|
description += '<a type="button" class="btn btn-default" href="/page/point/id/' + id + '"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>';
|
||||||
description += '<button type="button" class="btn btn-default" onclick="addToRoute(' + id + ')"><span class="glyphicon glyphicon-map-marker"></span> <span class="label">В маршрут</span></button>';
|
description += '<button type="button" class="btn btn-default" onclick="addToRoute(' + id + ')"><span class="glyphicon glyphicon-map-marker"></span> <span class="label">В маршрут</span></button>';
|
||||||
// description += '<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> <span class="label">Был здесь</span></button>';
|
// description += '<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> <span class="label">Был здесь</span></button>';
|
||||||
description += '<button type="button" class="btn btn-default" onclick="addRemoveLike(' + id + ')"><span id="myLikesButton" class="glyphicon glyphicon-' + (data.iLike ? 'ok' : 'thumbs-up') + '"></span> <span class="label">Нравится</span></button>';
|
description += '<button type="button" class="btn btn-default" onclick="addRemoveLike(' + id + ')"><span id="myLikesButton" class="glyphicon glyphicon-' + (data.iLike ? 'ok' : 'thumbs-up') + '"></span> <span class="label">Нравится</span></button>';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue