wikipoints/views/indexTemplate.php

148 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="addHelper">Теперь просто укажите точку на карте!</div>
<div id="control">
<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()"><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 (App::$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 _c glyphicon-star boxButtonFavorites" onclick="openBox('Favorites')" title="Хочу посетить"></div>
<div class="glyphicon _c glyphicon-cloud-download boxButtonRoutes" onclick="openBox('Routes')" title="Мои маршруты"></div>
<div class="glyphicon _b glyphicon-road boxButtonTracks" onclick="openBox('Tracks')" 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; ?>
</div>
<div id="box">
<span id="boxClose" onclick="closeBox();">&times;</span>
<div id="boxLayers">
<h3>Карты</h3>
<!-- <span class="dot layers questLayer">⚫ </span><a onclick="setLayer('quest');return false;" class="layers questLayer">map Quest</a><br/>-->
<span class="dot layers sputnikLayer">⚫ </span><a onclick="setLayer('sputnik');return false;" class="layers sputnikLayer">OSM-Sputnik</a><br/>
<span class="dot layers osmLayer">⚫ </span><a onclick="setLayer('osm');return false;" class="layers osmLayer">Open Street Map</a><br/>
<span class="dot layers topoLayer">⚫ </span><a onclick="setLayer('topo');return false;" class="layers topoLayer">Генштаб от маршруты.ру</a><br/>
<span class="dot layers googleLayer">⚫ </span><a onclick="setLayer('google');return false;" class="layers googleLayer">Google maps</a><br/>
<span class="dot layers yandexLayer">⚫ </span><a onclick="setLayer('yandex');return false;" class="layers yandexLayer">Яндекс.Карты</a><br/>
<span class="dot layers yandexMapLayer">⚫ </span><a onclick="setLayer('yandexMap');return false;" class="layers yandexMapLayer">Яндекс.Карты (схема)</a><br/>
</div>
<div id="boxFilter">
<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" id="printRoute" target="_blank" title="Печать"><span class="glyphicon glyphicon-print" style="color: #333;"></span></a>
<?php if ($user): ?>
<button class="btn btn-default" onclick="saveRoute()"><span class="glyphicon glyphicon-cloud-upload" title="Сохранить"></span></button>
<?php endif; ?>
<br/>
<hr/>
Получить короткую ссылку:<br/>
<button class="btn btn-default" onclick="getShortLink()"><span class="glyphicon glyphicon-link"></span></button>
<input type="text" id="shortLink"/>
<hr/>
<a href="/payment/thanks" class="btn btn-default" style="color: #333;"><span class="glyphicon glyphicon-gift" aria-hidden="true"></span> Сказать спасибо!</a>
</div>
<?php if ($user): ?>
<div id="boxFavorites">
<h3>Хочу посетить</h3>
<div id="favorites">
<?php if ($favorites): ?>
<a href="/user/favorites/"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> На отдельной странице</a>
<hr/>
<?php foreach ($favorites as $favorite) : ?>
<a onclick="showInfo(<?= $favorite->pointId ?>);return false;" href="#"><?= $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 if ($tracks): ?>
<div id="boxTracks">
<h3>
Мои треки
<a href="/tracks/" title="Управление треками"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></a>
</h3>
<hr/>
<div id="tracks">
<?php foreach ($tracks as $track) : ?>
<div style="border-bottom: solid 1px #CCC">
<input type="checkbox" id="trackShowHide<?= $track->id ?>" onchange="showHideTrack(<?= $track->id ?>)" />
<?= $track->name ?>
<b><?= $track->distance(); ?></b>
<?php if($track->status == Trips::STATUS_PUBLIC):?>
<a href="/?track=<?= $track->id ?>" title="Ссылка на трек. <?="\n"?>[клик правой кнопкой -> копировать адрес]">
<span class="glyphicon glyphicon-link" aria-hidden="true"></span>
</a>
<?php endif;?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?= App::$user ? '' : self::renderPartial('modals/login.php', null, true) ?>
<?= App::$user ? self::renderPartial('modals/addPoint.php', array('categories' => Category::model()->getCategoriesForChoise()), 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; ?>