<div class="card">
	<div class="card-header card-header-plain">
		<div class="card-desc">
			<h4 class="card-title">
				{{ 'RECENT-ACTIVITY.LAST-EDITED-DMP' | translate}}
			</h4>
			<p class="card-category">
				{{ 'RECENT-ACTIVITY.LICENSE' | translate}}
			</p>
		</div>
		<a class="view-all" [class.clickable]="isAuthenticated()" [routerLink]="['plans/']">
			{{ 'GENERAL.ACTIONS.VIEW-ALL' | translate}}</a>
	</div>
	<div class="card-body table-responsive">
		<table class="table table-hover">
			<thead class="text-default">
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.NAME' | translate}}</th>
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.TEMPLATE' | translate }}</th>
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.GRANT' | translate }}</th>
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.ROLE' | translate }}</th>
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.ORGANIZATION' | translate }}</th>
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.STATUS' | translate }}</th>
				<th>{{ 'DATASET-PROFILE-LISTING.COLUMNS.EDITED' | translate }}</th>
				<th></th>
			</thead>
			<tbody *ngIf="dmpActivities != null">
				<a *ngFor="let activity of dmpActivities" class="table-row" [routerLink]="['../plans/overview/' + activity.id]">
					<!-- <tr (click)="redirect(activity.id, recentActivityTypeEnum.Dmp)" *ngFor="let activity of dmpActivities" style="cursor: pointer;"> -->
					<td>{{ activity.label }}</td>
					<td>
						<div *ngIf="activity.profile" matTooltip="{{ activity.profile }}" class="template-name">
							{{ activity.profile }}
						</div>
						<div *ngIf="!(activity.profile)" class="template-name">--</div>
					</td>
					<td>{{ activity.grant }}</td>
					<td>{{ roleDisplay(activity.users)}}</td>
					<td>{{ activity.organisations }}</td>
					<td *ngIf="activity.status === 1 && activity.public === true">
						<div class="is-public">
							{{'TYPES.DMP-VISIBILITY.PUBLIC' | translate}}
						</div>
					</td>
					<td *ngIf="activity.status === 1 && activity.public === false" class="text-center">
						{{ enumUtils.toDmpStatusString(activity.status) }}
					</td>
					<td *ngIf="activity.status === 0" class="text-center">
						{{ enumUtils.toDmpStatusString(activity.status) }}
					</td>
					<td>
						{{ activity.modifiedTime | date: "shortDate" }}
					</td>
					<td>
						<button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto more-icon" (click)="$event.preventDefault(); $event.stopPropagation();">
							<mat-icon class="more-horiz">more_horiz</mat-icon>
						</button>
						<mat-menu #actionsMenu="matMenu">
							<button mat-menu-item (click)="editClicked(activity)" class="menu-item">
								<mat-icon>edit</mat-icon>{{ 'DMP-LISTING.ACTIONS.EDIT' | translate }}
							</button>
							<button mat-menu-item (click)="cloneClicked(activity)" class="menu-item">
								<mat-icon>add</mat-icon>{{ 'DMP-LISTING.ACTIONS.CLONE' | translate }}
							</button>
							<button mat-menu-item (click)="deleteClicked(activity)" class="menu-item">
								<mat-icon>delete</mat-icon>{{ 'DMP-LISTING.ACTIONS.DELETE' | translate }}
							</button>
							<button mat-menu-item [matMenuTriggerFor]="exportMethod" class="menu-item">
								<mat-icon>save_alt</mat-icon>{{ 'DMP-LISTING.ACTIONS.EXP-AS' | translate }}
							</button>
						</mat-menu>
						<mat-menu #exportMethod>
							<button mat-menu-item (click)="downloadPDF(activity.id)">
								<i class="fa fa-file-pdf-o pr-2"></i>
								<span>{{'GENERAL.FILE-TYPES.PDF' | translate}}</span>
							</button>
							<button mat-menu-item (click)="downloadDocx(activity.id)">
								<i class="fa fa-file-word-o pr-2"></i>
								<span>{{'GENERAL.FILE-TYPES.DOC' | translate}}</span>
							</button>
							<button mat-menu-item (click)="downloadXml(activity.id)">
								<i class="fa fa-file-code-o pr-2"></i>
								<span>{{'GENERAL.FILE-TYPES.XML' | translate}}</span>
							</button>
							<button mat-menu-item (click)="downloadJson(activity.id)">
								<i class="fa fa-file-o pr-2"></i>
								<span>{{'GENERAL.FILE-TYPES.JSON' | translate}}</span>
							</button>
						</mat-menu>
					</td>
				</a>
			</tbody>
			<tbody *ngIf="dmpActivities == null">
				<tr>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
				</tr>
			</tbody>
		</table>
	</div>
</div>
