dnet-applications/apps/dnet-is-application/src/main/resources/static/html/vocs.html

64 lines
2.4 KiB
HTML

<page-title title="Vocabularies"></page-title>
<div class="container-fluid">
<div class="row">
<div class="col">
<p>
<button class="btn btn-sm btn-primary" data-toggle="modal" data-target="#editVocabularyModal" ng-click="prepareNewVoc()">create a new vocabulary</button>
</p>
<page-filter filter="vocFilter" list="vocabularies"></page-filter>
<table class="table table-sm table-striped">
<thead>
<tr>
<th style="width: 25%">ID</th>
<th style="width: 25%">Name</th>
<th>Description</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-show="(vocabularies|filter:vocFilter).length == 0">
<td colspan="4" class="text-muted">no vocabularies</td>
</tr>
<tr ng-repeat="v in vocabularies|filter:vocFilter">
<th><a href="#!/vocabularyEditor?id={{v.id}}">{{v.id}}</a></th>
<td>{{v.name}}</td>
<td>{{v.description}}</td>
<td align="right">
<button type="button" class="btn btn-sm btn-primary" data-toggle="modal" data-target="#editVocabularyModal" ng-click="prepareEditVoc(v)">edit</button>
<button type="button" class="btn btn-sm btn-danger" ng-click="deleteVocabulary(v.id)">delete</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Modals -->
<div class="modal fade" tabindex="-1" id="editVocabularyModal">
<form>
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" ng-if="mode == 'new'">New vocabulary</h4>
<h4 class="modal-title" ng-if="mode == 'edit'">Edit vocabulary</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<form-textfield label="ID" value="tmpVoc.id" ng-show="mode == 'new'"></form-textfield>
<form-textfield-static label="ID" value="tmpVoc.id" ng-show="mode == 'edit'"></form-textfield-static>
<form-textfield label="Name" value="tmpVoc.name"></form-textfield>
<form-textarea label="Description" value="tmpVoc.description" optional="true"></form-textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-sm btn-primary" data-dismiss="modal" ng-click="saveVocabulary(tmpVoc)" ng-disabled="!tmpVoc.id || !tmpVoc.name">Submit</button>
</div>
</div>
</div>
</form>
</div>