facilmap/frontend/app/search/search-route.html

59 wiersze
4.5 KiB
HTML
Czysty Zwykły widok Historia

2016-10-18 18:27:57 +00:00
<div class="fm-search fm-search-route panel panel-default" ng-class="{'fm-hasResults': routes.length > 0}">
<div class="panel-body">
2016-10-12 12:15:48 +00:00
<form ng-submit="reset(); route()" ui-sortable="sortableOptions" ng-model="destinations">
<div class="form-group" ng-repeat="destination in destinations">
<div class="input-group">
<span class="input-group-addon">
<a href="javascript:" class="sort-handle"><span class="glyphicon glyphicon-resize-vertical"></span></a>
<a href="javascript:" ng-click="removeDestination($index); reroute(true)" ng-show="destinations.length > 2" uib-tooltip="Remove this destination" tooltip-append-to-body="true"><span class="glyphicon glyphicon-minus"></span></a>
</span>
<div class="has-feedback">
<input type="search" class="form-control" ng-model="destination.query" placeholder="{{$index == 0 ? 'From' : $index == destinations.length-1 ? 'To' : 'Via'}}" tabindex="{{$index+1}}">
2017-02-10 17:26:21 +00:00
<a href="javascript:" class="reset-button form-control-feedback" ng-click="destination.query=''" ng-show="destination.query.length > 0"><span class="icon-clear"></span></a>
</div>
2016-10-19 12:43:08 +00:00
<span class="input-group-btn" uib-dropdown keyboard-nav="true" ng-show="destination.query.length > 0">
<button type="button" class="btn btn-default" uib-dropdown-toggle ng-click="loadSuggestions(destination)"><span class="caret"></span></button>
<ul class="dropdown-menu" role="menu" uib-dropdown-menu>
<li ng-repeat="suggestion in destination.suggestions" ng-class="{active: destination.selectedSuggestionIdx == $index}"><a href="javascript:" ng-click="destination.selectedSuggestionIdx = $index; reroute()">{{suggestion.display_name}} ({{suggestion.type}})</a></li>
</ul>
</span>
</div>
</div>
<div class="form-group">
<div class="btn-toolbar">
2016-11-21 08:04:29 +00:00
<button type="button" class="btn btn-default" ng-click="addDestination()" uib-tooltip="Add another destination" tooltip-append-to-body="true"><span class="glyphicon glyphicon-plus"></span></button>
<div class="btn-group">
<button type="button" class="btn btn-default" uib-btn-radio="'car'" ng-model="routeMode" tabindex="{{destinations.length+1}}" ng-click="reroute(true)" uib-tooltip="Go by car" tooltip-append-to-body="true"><span class="icon-car"></span></button>
<button type="button" class="btn btn-default" uib-btn-radio="'bicycle'" ng-model="routeMode" tabindex="{{destinations.length+2}}" ng-click="reroute(true)" uib-tooltip="Go by bicycle" tooltip-append-to-body="true"><span class="icon-bicycle"></span></button>
<button type="button" class="btn btn-default" uib-btn-radio="'pedestrian'" ng-model="routeMode" tabindex="{{destinations.length+3}}" ng-click="reroute(true)" uib-tooltip="Go by walk" tooltip-append-to-body="true"><span class="icon-walk"></span></button>
</div>
<button type="submit" class="btn btn-primary" tabindex="{{destinations.length+4}}">Go!</button>
2017-02-10 17:26:21 +00:00
<button ng-show="routeObj || routeError" type="button" class="btn btn-link" tabindex="{{destinations.length+5}}" ng-click="reset()" uib-tooltip="Clear route" tooltip-append-to-body="true"><span class="glyphicon glyphicon-remove"></span></button>
<button type="button" class="btn btn-default pull-right active" ng-click="showSearchForm()" uib-tooltip="Switch to search from" tooltip-append-to-body="true"><span class="glyphicon glyphicon-road"></span></button>
</div>
</div>
2016-10-18 18:27:57 +00:00
<div class="fm-search-results" ng-show="routeObj || routeError">
<div uib-alert class="alert-danger no-results" ng-if="routeError">{{routeError}}</div>
<dl ng-show="routeObj">
<dt>Distance</dt>
2016-10-18 18:27:57 +00:00
<dd>{{routeObj.distance | fmRound:2}} km <span ng-show="routeObj.time != null">({{routeObj.time | fmFormatTime}} h {{routeObj.routeMode | fmRoutingMode}})</span></dd>
</dl>
2016-10-18 18:27:57 +00:00
<div class="fm-search-buttons" ng-show="routeObj && !readonly">
2016-10-19 12:43:08 +00:00
<div uib-dropdown keyboard-nav="true" ng-if="(types | fmPropertyCount:{type:'line'}) > 1" dropdown-append-to-body="true">
<button id="add-type-button" type="button" class="btn btn-default" uib-dropdown-toggle>Add to map <span class="caret"></span></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="add-type-button" uib-dropdown-menu>
2016-10-18 18:27:57 +00:00
<li role="menuitem" ng-repeat="type in types | fmObjectFilter:{type:'line'}"><a href="#" ng-click="addToMap(type)">{{type.name}}</a></li>
</ul>
</div>
2016-10-18 18:27:57 +00:00
<button ng-if="(types | fmPropertyCount:{type:'line'}) == 1" type="button" class="btn btn-default" ng-click="addToMap()">Add to map</button>
</div>
</div>
</form>
</div>
</div>