Do not offer import of types and views when no permission (fixes #86)

pull/108/head
Candid Dauth 2017-12-25 17:20:14 +01:00
rodzic e803d61dc1
commit 0a661dd026
2 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -17,11 +17,11 @@
<tr ng-repeat="(importTypeId, objectCount) in importTypeCounts">
<td><label for="map-type-{{importTypeId}}">{{results.types[importTypeId].type == 'marker' ? 'Markers' : 'Lines'}} of type “{{results.types[importTypeId].name}}” ({{objectCount}})</label></td>
<td><select id="map-type-{{importTypeId}}" ng-model="mapping[importTypeId]" class="form-control">
<option ng-if="importTypeId" ng-value="'i' + importTypeId">Import type “{{results.types[importTypeId].name}}”</option>
<option ng-if="client.writable == 2 && importTypeId" ng-value="'i' + importTypeId">Import type “{{results.types[importTypeId].name}}”</option>
<option ng-repeat="type in client.types" ng-if="type.name == results.types[importTypeId].name && type.type == results.types[importTypeId].type" ng-value="'e' + type.id">Existing type “{{type.name}}”</option>
<option ng-value="false">Do not import</option>
<option disabled>──────────</option>
<option ng-repeat="(typeId, type) in results.types" ng-if="type.type == results.types[importTypeId].type && typeId != importTypeId" ng-value="'i' + typeId">Import type “{{type.name}}”</option>
<option ng-repeat="(typeId, type) in results.types" ng-if="client.writable == 2 && type.type == results.types[importTypeId].type && typeId != importTypeId" ng-value="'i' + typeId">Import type “{{type.name}}”</option>
<option ng-repeat="type in client.types" ng-if="type.type == results.types[importTypeId].type && type.name != results.types[importTypeId].name" ng-value="'e' + type.id">Existing type “{{type.name}}”</option>
</select></td>
</tr>
@ -29,7 +29,7 @@
<td><label for="map-untyped-markers">Untyped markers ({{untypedMarkers}})</label></td>
<td><select id="map-untyped-markers" ng-model="mapUntypedMarkers" class="form-control">
<option ng-value="false">Do not import</option>
<option ng-repeat="(typeId, type) in results.types" ng-if="type.type == 'marker'" ng-value="'i' + typeId">Import type “{{type.name}}”</option>
<option ng-repeat="(typeId, type) in results.types" ng-if="client.writable == 2 && type.type == 'marker'" ng-value="'i' + typeId">Import type “{{type.name}}”</option>
<option ng-repeat="type in client.types" ng-if="type.type == 'marker'" ng-value="'e' + type.id">Existing type “{{type.name}}”</option>
</select></td>
</tr>
@ -37,7 +37,7 @@
<td><label for="map-untyped-lines">Untyped lines/polygons ({{untypedLines}})</label></td>
<td><select id="map-untyped-lines" ng-model="mapUntypedLines" class="form-control">
<option ng-value="false">Do not import</option>
<option ng-repeat="(typeId, type) in results.types" ng-if="type.type == 'line'" ng-value="'i' + typeId">Import type “{{type.name}}”</option>
<option ng-repeat="(typeId, type) in results.types" ng-if="client.writable == 2 && type.type == 'line'" ng-value="'i' + typeId">Import type “{{type.name}}”</option>
<option ng-repeat="type in client.types" ng-if="type.type == 'marker'" ng-value="'e' + type.id">Existing type “{{type.name}}”</option>
</select></td>
</tr>

Wyświetl plik

@ -25,7 +25,7 @@
<li ng-repeat="view in searchResults.views" class="list-group-item">
<a href="javascript:" ng-click="showView(view)">{{view.name}}</a>
<span class="result-type">(View)</span>
<a href="javascript:" ng-if="!viewExists(view)" ng-click="addView(view)" class="pull-right" uib-tooltip="Add this view to the map" tooltip-append-to-body="true"><span class="glyphicon glyphicon-plus"></span></a>
<a href="javascript:" ng-if="client.padId && client.writable == 2 && !viewExists(view)" ng-click="addView(view)" class="pull-right" uib-tooltip="Add this view to the map" tooltip-append-to-body="true"><span class="glyphicon glyphicon-plus"></span></a>
</li>
</ul>
</div>
@ -43,7 +43,7 @@
<li ng-repeat="type in searchResults.types" class="list-group-item">
{{type.name}}
<span class="result-type">(Type)</span>
<a href="javascript:" ng-if="!typeExists(type)" ng-click="addType(type)" class="pull-right" uib-tooltip="Add this type to the map" tooltip-append-to-body="true"><span class="glyphicon glyphicon-plus"></span></a>
<a href="javascript:" ng-if="client.padId && client.writable == 2 && !typeExists(type)" ng-click="addType(type)" class="pull-right" uib-tooltip="Add this type to the map" tooltip-append-to-body="true"><span class="glyphicon glyphicon-plus"></span></a>
</li>
</ul>
</div>