argos/dmp-admin/src/app/managers/dmp-profile-editor/dmp-profile-editor.componen...

100 lines
4.7 KiB
HTML

<div class="editor-container container">
<div [ngClass]="{true:'visible', false:'invisible'}[tableVisible]">
<table class="table table-striped" [mfData]="tableData | dmpProfileTableFilter : filterQuery" #mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
<thead>
<tr>
<th colspan="1">
<input class="form-control" [(ngModel)]="filterQuery" placeholder='Filter'/>
</th>
<th>
<button class="btn btn-default" (click)="refreshTable($event)">
<span class="glyphicon glyphicon-refresh"></span>
</button>
</th>
</tr>
<tr>
<th [ngClass]="{true:'visible', false:'invisible'}[showIDs]"><mfDefaultSorter by="id">ID</mfDefaultSorter></th>
<th><mfDefaultSorter by="label">Label</mfDefaultSorter></th>
<th><mfDefaultSorter by="definition">Definition</mfDefaultSorter></th>
</tr>
</thead>
<tbody>
<tr class="grayout-empty-table" *ngIf="!mf.data[0]" [contextMenu]="basicMenu" [contextMenuSubject]="dmpProfile"> <td colspan="3">No elements</td></tr>
<tr *ngFor="let dmpProfile of mf.data" class="hover" [contextMenu]="basicMenu" [contextMenuSubject]="dmpProfile">
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{dmpProfile.id}}</td>
<td>{{dmpProfile?.label}}</td>
<td>{{dmpProfile?.definition}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3">
<mfBootstrapPaginator [rowsOnPageSet]="[10,20,40]"></mfBootstrapPaginator>
</td>
</tr>
</tfoot>
</table>
</div>
<!-- this is the dmp editor -->
<div [ngClass]="{true:'visible', false:'invisible'}[editorVisible]">
<div> <!-- form container -->
<div style="display:block;">
<button (click)="switchToTable()" class="btn btn-lg btn-success pull-right" style="max-width:120px;">
<span class="glyphicon glyphicon-arrow-left"></span> Go back
</button>
</div>
<form [formGroup]="dmpProfileEditorForm" novalidate style="display:block;">
<div class="form-group" [ngClass]="{null:'invisible'}[editingDmpProfile?.id]">
<label class="center-block">ID: {{editingProject?.id}}
<input class="form-control invisible" formControlName="id" [ngModel]="editingDmpProfile?.id">
</label>
</div>
<div class="form-group">
<label class="center-block">Label:
<input class="form-control" formControlName="label" [ngModel]="editingDmpProfile?.label" (ngModelChange)="editingDmpProfile.label=$event">
</label>
</div>
<div class="form-group">
<label class="center-block">Definition:
<input class="form-control" formControlName="definition" [ngModel]="editingDmpProfile?.definition" (ngModelChange)="editingDmpProfile.definition$event">
</label>
</div>
<div class="form-group" style="width:540px;">
<button style="float:right;" type="submit" (click)="save($event, $data, $form)"class="btn btn-success">Save</button>
</div>
</form>
<!--
<p>Form value: {{ dmpProfileEditorForm.value | json }}</p>
-->
</div>
</div>
</div>
<context-menu>
<ng-template contextMenuItem [subMenu]="manage">
<span></span>Manage DMP Profiles
</ng-template>
<context-menu #manage>
<ng-template contextMenuItem (execute)="newDmpProfile($event?.item)">
<span class="glyphicon glyphicon-plus"></span>Create DMP Profile
</ng-template>
<ng-template contextMenuItem (execute)="editDmpProfile($event?.item?.id)">
<span class="glyphicon glyphicon-pencil"></span>Edit this DMP Profile
</ng-template>
<ng-template contextMenuItem (execute)="delete($event?.item?.id)">
<span class="glyphicon glyphicon-trash red"></span> Delete this
</ng-template>
</context-menu>
<ng-template contextMenuItem>
<span></span>Show full tree connections
</ng-template>
</context-menu>