argos/dmp-frontend/src/app/projects/project.html

143 lines
7.0 KiB
HTML
Raw Normal View History

<meta name="google-signin-client_id" content="524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com">
<table class="table table-striped" [mfData]="tableData | projectTableFilter : filterQuery : whoami?.id : onlyMyProjects"
2017-11-01 10:56:35 +01:00
#mf="mfDataTable" [mfRowsOnPage]="rowsOnPage" [(mfSortBy)]="sortBy" [(mfSortOrder)]="sortOrder">
<thead>
<tr>
<th colspan="1">
<input class="form-control" [(ngModel)]="filterQuery" placeholder='Filter' />
</th>
<th style="width:50px;">
2017-11-07 13:15:50 +01:00
<button class="btn btn-default" (click)="getProjects('false')">
2017-11-01 10:56:35 +01:00
<span class="glyphicon glyphicon-refresh"></span>
</button>
</th>
<th colspan="1">
<div class="checkbox">
<label><input type="checkbox" [(ngModel)]="onlyMyProjects" >Show only my projects</label>
</div>
2017-11-01 10:56:35 +01:00
</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="abbreviation">Αbbreviation</mfDefaultSorter>
</th>
<th>
2017-11-16 14:21:57 +01:00
<mfDefaultSorter by="startdate">Start Date</mfDefaultSorter>
2017-11-01 10:56:35 +01:00
</th>
<th>
2017-11-16 14:21:57 +01:00
<mfDefaultSorter by="enddate">End Date</mfDefaultSorter>
2017-11-01 10:56:35 +01:00
</th>
<th>
2017-11-06 17:25:23 +01:00
<mfDefaultSorter by="status">Status</mfDefaultSorter>
2017-11-01 10:56:35 +01:00
</th>
<th>
<mfDefaultSorter by="description">Description</mfDefaultSorter>
2017-11-01 10:56:35 +01:00
</th>
<th>
<mfDefaultSorter>Actions </mfDefaultSorter>
</th>
</tr>
</thead>
<tbody>
<tr class="grayout-empty-table" *ngIf="!mf.data[0]">
<td colspan="7">No elements</td>
</tr>
<tr *ngFor="let project of mf.data" class="hover">
2017-11-06 17:25:23 +01:00
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{project?.id}}</td>
2017-11-16 18:07:27 +01:00
<td>{{(project?.label?.length > 40) ? (project?.label | slice:0:40)+'...':(project?.label) }}</td>
2017-11-01 10:56:35 +01:00
<td>{{project?.abbreviation}}</td>
<td>{{project?.startdate | date:'medium' }}</td>
<td>{{project?.enddate | date:'medium'}}</td>
2017-11-06 17:25:23 +01:00
<td>{{project?.status | statusToString}}</td>
2017-11-16 18:07:27 +01:00
<td>{{(project?.description?.length > 40) ? (project?.description | slice:0:40)+'...':(project?.description) }}</td>
2017-11-16 14:21:57 +01:00
<td>
2017-11-17 02:15:09 +01:00
<a [ngClass]="{'not-active': whoami?.id!=project?.creationUser?.id }" class="editGridColumn" (click)="editRow(project, $event)">
2017-11-16 14:21:57 +01:00
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit properties" id="editDMP" ></i>
</a>
<!--
<a>
<i class="fa fa-eraser fa-fw" data-toggle="tooltip" title="delete project"></i>
</a>
-->
</td>
2017-11-01 10:56:35 +01:00
</tr>
</tbody>
<tfoot>
<tr>
2017-11-20 11:06:36 +01:00
<td colspan="1">
2017-11-01 11:47:30 +01:00
<button type="button" class="btn btn-info btncustom" (click)="newProject(item)">New Project</button>
2017-11-20 11:06:36 +01:00
</td>
<td colspan="5">
<mfBootstrapPaginator [rowsOnPageSet]="[5,10,20]"></mfBootstrapPaginator>
2017-11-01 10:56:35 +01:00
</td>
</tr>
</tfoot>
</table>
2017-10-19 16:33:12 +02:00
2017-11-01 11:47:30 +01:00
<div class="modal fade" id="newEditProjectModal" tabindex="-1" role="dialog" aria-labelledby="newProjectModalLabel" aria-hidden="true">
2017-10-19 16:33:12 +02:00
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
2017-11-01 11:47:30 +01:00
<h5 class="modal-title" id="exampleModalLabel">Project</h5>
2017-10-19 16:33:12 +02:00
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
2017-11-07 11:46:24 +01:00
<form #newProjectForm="ngForm" (ngSubmit)="SaveProject()" novalidate>
2017-10-19 16:33:12 +02:00
<label for="label-name" class="form-control-label">Label:</label>
2017-11-07 11:46:24 +01:00
<input type="text" class="form-control" id="label-name" [(ngModel)]= "project.label" name = "label" required>
2017-10-19 16:33:12 +02:00
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Abbreviation:</label>
2017-10-24 11:49:02 +02:00
<input class="form-control" id="abbreviation-text" [(ngModel)]= "project.abbreviation" name = "abbreviation">
2017-10-19 16:33:12 +02:00
</div>
<div class="form-group">
<label for="reference-text" class="form-control-label">Reference:</label>
2017-10-24 11:49:02 +02:00
<input class="form-control" id="reference-text" [(ngModel)]= "project.reference" name = "reference">
2017-10-19 16:33:12 +02:00
</div>
<div class="form-group">
<label for="uri-text" class="form-control-label">Uri:</label>
2017-10-24 11:49:02 +02:00
<input class="form-control" id="uri-text" [(ngModel)]= "project.uri" name = "uri">
2017-10-19 16:33:12 +02:00
</div>
<div class="form-group">
<label for="start-date" class="form-control-label">Start Date:</label>
2017-11-07 11:46:24 +01:00
<input class="form-control" type='date' class="form-control" [(ngModel)]= "project.startdate" id='start-date' name = "startdate" required/>
2017-10-19 16:33:12 +02:00
</div>
<div class="form-group">
<label for="end-date" class="form-control-label">End Date:</label>
2017-11-07 11:46:24 +01:00
<input class="form-control" type='date' class="form-control" [(ngModel)]= "project.enddate" id='end-date' name = "enddate" required/>
2017-10-19 16:33:12 +02:00
</div>
<div class="form-group">
<label for="status-name" class="col-form-label">Status:</label>
<select class="form-control" id="statusid" [(ngModel)]="project.status" name="statusDropDown">
<option *ngFor="let opt of statusDropDown.options" [value]="opt.key">{{opt.value}}</option>
</select>
</div>
<div class="form-group">
<label for="code-name" class="form-control-label">Description:</label>
<textarea rows="3" class="form-control" name="desc" id="description" [(ngModel)]= "project.description"> </textarea>
2017-10-19 16:33:12 +02:00
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
2017-11-07 11:46:24 +01:00
<button type="submit" class="btn btn-primary" [disabled]="!newProjectForm.form.valid" (click)="SaveProject();">Save project</button>
2017-10-19 16:33:12 +02:00
</div>
</div>
</div>
2017-10-18 18:30:39 +02:00
</div>