wikipoints/ground/views/indexTemplate.php

149 lines
8.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
$addWithoutConfirm = false;
if (App::$user) {
$addWithoutConfirm = Point::model()->getCountByUser(App::$user->id) > 0;
}
?>
<div id="map"></div>
<div id="control">
<div class="glyphicon _t glyphicon-info-sign boxButtonInfo" title="Информация" onclick="openBox('Info')"></div>
<div class="glyphicon _c glyphicon-font boxButtonArticles onlyBigScreen" title="Лента статей" onclick="location.href='/feed/'"></div>
<?php if ($user): ?>
<div class="glyphicon glyphicon-user _b boxButtonUser" onclick="location.href='/user/'" title="Профиль">
<?php if(Notifications::getUnreadedCount()): ?>
<div id="notify"><?= Notifications::getUnreadedCount(); ?></div>
<?php endif; ?>
</div>
<?php else: ?>
<div class="glyphicon glyphicon-user _b" id="loginButton" onclick="$('#loginModal').modal('show');" title="Войти для добавления точки"></div>
<?php endif; ?>
<div class="glyphicon glyphicon-plus big _t" title="Приблизить" onclick="myMap.zoomIn()"></div>
<div class="glyphicon glyphicon-minus big _b" title="Отдалить" onclick="myMap.zoomOut()"></div>
<div class="glyphicon _t boxButtonLayers" onclick="openBox('Layers')" title="Слои карты"><img src="/img/buttons/layers.png" style="margin-top: -10px; margin-left: -5px; width: 30px;" /></div>
<div class="glyphicon _c boxButtonFilter" title="Фильтры и поиск" onclick="openBox('Filter')"><img src="/img/buttons/search.png" style="margin-top: -10px; margin-left: -5px; width: 30px;" /></div>
<div class="glyphicon _c" id="showMeOnTheMap" title="Я на карте" onclick="showMeOnTheMap(false)"><img src="/img/buttons/myPosition.png" style="margin-top: -20px; height: 21px;" /></div>
<div class="glyphicon _b boxButtonRoute" title="Маршрут" onclick="openBox('Route')"><img src="/img/buttons/route.png" style="margin-top: -10px; margin-left: -5px; width: 30px;" /></div>
<?php if ($user): ?>
<div class="glyphicon _t" id="addPointButton" title="Добавить точку" onclick="<?= $addWithoutConfirm ? 'activateAddPoint()' : 'showPointagreement()'; ?>"><img src="/img/buttons/addPoint.png" style="margin-top: -10px; height: 30px;" /></div>
<div class="glyphicon glyphicon-star _c boxButtonFavorites" onclick="openBox('Favorites')" title="Хочу посетить"></div>
<div class="glyphicon _b glyphicon-cloud-download _c boxButtonRoutes" onclick="openBox('Routes')" title="Мои маршруты"></div>
<?php else: ?>
<div class="glyphicon" id="addPointButton" onclick="$('#loginModal').modal('show');" title="Добавить точку"><img src="/img/buttons/addPoint.png" style="margin-top: -10px; height: 30px;" /></div>
<?php endif; ?>
<a href="https://vk.com/wikipoints" target="_blank" class="onlyBigScreen"><img src="/img/vkBigLogo.png?2" usemap="#vkbutton" style="margin-left: 285px; margin-top: 0px; position: absolute; display: none;" id="vkBigLogo" /><div class="glyphicon" style="line-height: 0;" title="WikiPoints вКонтакте"><img src="/img/b.png?v=2" style="margin-left: -5px; margin-top: 0px; height: 20px;" /></div></a>
</div>
<div id="box">
<span id="boxClose" onclick="closeBox();">&times;</span>
<div id="boxInfo">
<h3>Информация</h3>
<a href="/article/1">О проекте</a><br/>
<a onclick="showArticle(2);" href="#">Как пользоваться</a><br/>
<a onclick="$('#categoriesModal').modal('show');" href="#">Легенда</a><br/>
<a href="/page/points">Список точек</a><br/>
<?php if (App::$user && App::$user->isAdmin): ?>
<a href="/articles">Статьи</a><br/>
<?php endif; ?>
<br/>
<a href="/?point=random" onclick="showRandomPoint();
return false;">Случайная точка</a>
<br/><br/><br/>
<a href="http://vk.com/wikipoints" target="_blank"><img src="/img/vk-flat.png" width="24" height="24"/> Группа ВКонтакте</a>
<br/><br/>
<a href="https://instagram.com/wikipoints/" target="_blank"><img src="/img/instagram-flat.png" width="24" height="24"/> Instagram</a>
<br/><br/><br/>
<h3>Контакты</h3>
EMail: <a href="mailto:info@wikipoints.ru">info@wikipoints.ru</a><br/>
VK: <a href="https://vk.com/all4dk" target="_blank">https://vk.com/all4dk</a><br/>
</div>
<div id="boxLayers">
<h3>Карты</h3>
<div onclick="setLayer('quest')" class="layers questLayer">map Quest</div>
<div onclick="setLayer('topo')" class="layers topoLayer">Генштаб от маршруты.ру</div>
<div onclick="setLayer('google')" class="layers googleLayer">Google maps</div>
<div onclick="setLayer('yandex')" class="layers yandexLayer">Яндекс.Карты</div>
<div onclick="setLayer('osm')" class="layers osmLayer">Open Street Map</div>
<div onclick="setLayer('yandexMap')" class="layers yandexMapLayer">Яндекс.Карты (схема)</div>
</div>
<div id="boxFilter" style="height: 100%; overflow-y: auto;">
<h3>Фильтры и поиск</h3>
<span class="input-group">
<input type="text" id="addressField" class="form-control" placeholder="Поиск на карте..." />
<span class="input-group-btn">
<button class="btn btn-default" type="button" onclick="searchAdderess()"><span class="glyphicon glyphicon-search"></span></button>
</span>
</span>
<br />
<?php foreach ($categories as $category): ?>
<input type="checkbox" value="<?= $category->id ?>" class="filterSelector"> <?= $category->name ?><br/>
<?php endforeach; ?>
</div>
<div id="boxRoute" style="height: 100%; overflow-y: auto;">
<h3>Маршрут</h3>
<div id="wayPoints">
<span id="routeInfo">
<b>Здравствуйте!</b><br/>
В данный момент тут пусто, но это легко поправить.<br/>
Сюда можно помещать точки, по которым будет строиться маршрут. После построения он отобразится на карте.<br/>
<br/>
<b>1)</b> Выберите точку на карте.<br/>
<b>2)</b> Нажмите кнопку "В маршрут"<br/>
<br/>
Затем выберите следующую точку и повторите действие. Надеемся, что всё получилось!
</span>
</div>
<div id="routeDistance"></div>
<button class="btn btn-info" onclick="buildRoute(true)"><span class="glyphicon glyphicon-send"></span> Проложить</button>
<a class="btn btn-default" href="" id="printRoute" target="_blank" title="Печать"><span class="glyphicon glyphicon-print"></span></a>
<?php if ($user): ?>
<button class="btn btn-default" onclick="saveRoute()"><span class="glyphicon glyphicon-cloud-upload" title="Сохранить"></span></button>
<?php endif; ?>
<br/>
</div>
<?php if ($user): ?>
<div id="boxFavorites">
<h3>Хочу посетить</h3>
<div id="favorites">
<?php if ($favorites): ?>
<?php foreach ($favorites as $favorite) : ?>
<a onclick="showInfo(<?= $favorite->pointId ?>)" class="btn btn-link"><?= $favorite->point->name ?></a><br/>
<?php endforeach; ?>
<?php else: ?>
Ваши закладки пока пусты.
<?php endif; ?>
</div>
</div>
<div id="boxRoutes">
<h3>Мои маршруты</h3>
<div id="routes">
<?php if ($routes): ?>
<?php foreach ($routes as $route) : ?>
<div class="route" onclick="loadRoute(<?= $route->id ?>)"><span onclick="deleteRoute(<?= $route->id ?>);
$(this).parent().remove();
event.stopPropagation();">&times;</span> <?= $route->name ?></div>
<?php endforeach; ?>
<?php else: ?>
У вас пока нет сохраненных маршрутов.
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
<?= $user ? '' : self::renderPartial('modals/login.php', null, true) ?>
<?= $user ? self::renderPartial('modals/addPoint.php', array('categories' => $categories), true) : '' ?>
<?= self::renderPartial('modals/categories.php', array('categories' => $categories), true) ?>
<?= self::renderPartial('modals/image.php', array(), true) ?>
<map name="vkbutton">
<area onclick="hideBigLogo();" shape="rect" coords="0,0,40,40" style="cursor: pointer" title="Спрятать надолго"/>
<area href="https://vk.com/wikipoints" shape="rect" coords="40,0,230,40" title="Посетить группу в VK - это интересно и полезно!" target="_blank"/>
</map>
<?php if (isset($categoryArray)): ?>
<script type="text/javascript">
var categoryArray = '<?= json_encode($categoryArray) ?>';
</script>
<?php endif; ?>