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

191 lines
8.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="container-fluid">
<h3>{{'PROJECT-LISTING.TITLE' | translate}}</h3>
<app-projects-criteria-component></app-projects-criteria-component>
<mat-card class="mat-card">
<mat-progress-bar *ngIf="dataSource?.isLoadingResults" mode="query"></mat-progress-bar>
<mat-table [dataSource]="dataSource" matSort>
<!-- Column Definition: Name -->
<ng-container cdkColumnDef="name">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.NAME' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.label}}</mat-cell>
</ng-container>
<!-- Column Definition: Αbbreviation -->
<ng-container cdkColumnDef="abbreviation">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.ABBREVIATION' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.abbreviation}} </mat-cell>
</ng-container>
<!-- Column Definition: Start -->
<ng-container cdkColumnDef="start">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.START' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.startDate}} </mat-cell>
</ng-container>
<!-- Column Definition: End -->
<ng-container cdkColumnDef="end">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.END' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"> {{row.endDate}} </mat-cell>
</ng-container>
<!-- Column Definition: Submission Time -->
<ng-container cdkColumnDef="actions">
<mat-header-cell *matHeaderCellDef>{{'PROJECT-LISTING.COLUMNS.ACTIONS' | translate}}</mat-header-cell>
<mat-cell *matCellDef="let row"></mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns" (click)="rowClick(row.id)"></mat-row>
</mat-table>
<mat-paginator #paginator
[length]="dataSource?.totalCount"
[pageSizeOptions]="[10, 25, 100]">
</mat-paginator>
</mat-card>
<button mat-fab class="mat-fab-bottom-right" color="primary" [routerLink]=" ['./new'] ">
<mat-icon class="mat-24">add</mat-icon>
</button>
</div>
<!-- <meta name="google-signin-client_id" content="524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com">
<table class="table table-striped" [mfData]="tableData | projectTableFilter : filterQuery : whoami?.id : onlyMyProjects"
#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;">
<button class="btn btn-default" (click)="getProjects('false')">
<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>
</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>
<mfDefaultSorter by="startdate">Start Date</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="enddate">End Date</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="status">Status</mfDefaultSorter>
</th>
<th>
<mfDefaultSorter by="description">Description</mfDefaultSorter>
</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">
<td [ngClass]="{true:'visible', false:'invisible'}[showIDs]">{{project?.id}}</td>
<td>{{(project?.label?.length > 40) ? (project?.label | slice:0:40)+'...':(project?.label) }}</td>
<td>{{project?.abbreviation}}</td>
<td>{{project?.startdate | date:'medium' }}</td>
<td>{{project?.enddate | date:'medium'}}</td>
<td>{{project?.status | statusToString}}</td>
<td>{{(project?.description?.length > 40) ? (project?.description | slice:0:40)+'...':(project?.description) }}</td>
<td>
<a [ngClass]="{'not-active': whoami?.id!=project?.creationUser?.id }" class="editGridColumn" (click)="editRow(project, $event)">
<i class="fa fa-pencil fa-fw" data-toggle="tooltip" title="edit properties" id="editDMP" ></i>
</a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="1">
<button type="button" class="btn btn-info btncustom" (click)="newProject(item)">New Project</button>
</td>
<td colspan="5">
<mfBootstrapPaginator [rowsOnPageSet]="[5,10,20]"></mfBootstrapPaginator>
</td>
</tr>
</tfoot>
</table>
<div class="modal fade" id="newEditProjectModal" tabindex="-1" role="dialog" aria-labelledby="newProjectModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Project</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form #newProjectForm="ngForm" (ngSubmit)="SaveProject()" novalidate>
<label for="label-name" class="form-control-label">Label:</label>
<input type="text" class="form-control" id="label-name" [(ngModel)]= "project.label" name = "label" required>
<div class="form-group">
<label for="abbreviation-text" class="form-control-label">Abbreviation:</label>
<input class="form-control" id="abbreviation-text" [(ngModel)]= "project.abbreviation" name = "abbreviation">
</div>
<div class="form-group">
<label for="reference-text" class="form-control-label">Reference:</label>
<input class="form-control" id="reference-text" [(ngModel)]= "project.reference" name = "reference">
</div>
<div class="form-group">
<label for="uri-text" class="form-control-label">Uri:</label>
<input class="form-control" id="uri-text" [(ngModel)]= "project.uri" name = "uri">
</div>
<div class="form-group">
<label for="start-date" class="form-control-label">Start Date:</label>
<input class="form-control" type='date' class="form-control" [(ngModel)]= "project.startdate" id='start-date' name = "startdate" required/>
</div>
<div class="form-group">
<label for="end-date" class="form-control-label">End Date:</label>
<input class="form-control" type='date' class="form-control" [(ngModel)]= "project.enddate" id='end-date' name = "enddate" required/>
</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>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" [disabled]="!newProjectForm.form.valid" (click)="SaveProject();">Save project</button>
</div>
</div>
</div>
</div>
-->