<div class="dataset-card">
	<a [routerLink]="getItemLink()" class="pointer">
		<div class="d-flex flex-direction-row">
			<div class="col-auto dataset-label">{{'DATASET-LISTING.DATASET-DESCRIPTION' | translate}}</div>
			<div *ngIf="!isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.EDITED' | translate}}: {{dataset.modified | dateTimeCultureFormatter: "d MMMM y"}}</div>
			<div *ngIf="isPublic" class="col-auto ml-auto edited-date">{{'DATASET-LISTING.STATES.PUBLISHED' | translate}}: {{dataset.dmpPublishedAt | dateTimeCultureFormatter: "d MMMM y"}}</div>
		</div>
		<div *ngIf="dataset.status === 1" class="col-auto dataset-title">{{dataset.label}}</div>
		<div *ngIf="dataset.status === 0" class="col-auto dataset-title-draft">{{dataset.label}}</div>
		<div class="dataset-subtitle">
			<span *ngIf="isUserDatasetRelated()" class="col-auto">{{ roleDisplay(dataset.users) }}</span>
			<span *ngIf="isUserDatasetRelated()">.</span>
			<span class="col-auto" *ngIf="dataset.status === 1 && dataset.public === true"><span class="material-icons icon-align">public</span>{{'DATASET-LISTING.STATES.PUBLIC' | translate}}</span>
			<span *ngIf="dataset.status === 1 && dataset.public === false" class="col-auto"><span class="material-icons icon-align">done</span>{{ enumUtils.toDmpStatusString(dataset.status) }}</span>
			<span *ngIf="dataset.status === 0" class=" col-auto draft"><span class="material-icons icon-align">create</span>{{ enumUtils.toDmpStatusString(dataset.status) }}</span>
			<span>.</span>
			<span class="col">{{'DATASET-LISTING.COLUMNS.GRANT' | translate}}: {{dataset.grant}}</span>
		</div>
		<div class="d-flex flex-direction-row pt-3 pb-3">
			<div class="col-auto dataset-subtitle pr-0">{{'DATASET-LISTING.TOOLTIP.PART-OF' | translate}}
				<div class="col-auto dmp-label ml-3">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div>
			</div>
			<!-- <div class="col-auto dmp-label">{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}</div> -->
			<div class="col dmp-title">{{dataset.dmp}}</div>
		</div>
	</a>
	<div class="dataset-card-actions">
		<a class="col-auto border-right pointer" [matMenuTriggerFor]="exportMenu"><span class="material-icons icon-align pr-2">open_in_new</span>{{'DATASET-LISTING.ACTIONS.EXPORT' | translate}}</a>
		<a class="col-auto border-right pointer" *ngIf="isUserOwner" (click)="openShareDialog(dataset.dmpId, dataset.dmp)"><span class="material-icons icon-align pr-2">group_add</span>{{'DATASET-LISTING.ACTIONS.INVITE-SHORT' | translate}}</a>
		<a class="col-auto border-right pointer" *ngIf="isAuthenticated()" (click)="openDmpSearchDialogue(dataset)"><span class="material-icons icon-align pr-2">file_copy</span>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}</a>
		<a class="col-auto border-right pointer" *ngIf="isAuthenticated() && isUserDatasetRelated()" (click)="deleteClicked(dataset.id)"><span class="material-icons icon-align pr-2">delete</span>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}</a>

		<!-- <a *ngIf="this.isAuthenticated()" class="col-auto pointer" [matMenuTriggerFor]="actionsMenu"><span class="material-icons icon-align pl-2">more_horiz</span></a> -->
		<!-- <a class="col-auto" [matMenuTriggerFor]="actionsMenu" *ngIf="!publicMode"><span class="material-icons icon-align pl-2">more_horiz</span></a> -->
	</div>
	<mat-menu #actionsMenu="matMenu">
		<button *ngIf="isAuthenticated()" mat-menu-item (click)="openDmpSearchDialogue(dataset)" class="menu-item">
			<mat-icon>file_copy</mat-icon>{{'DATASET-WIZARD.ACTIONS.COPY-DATASET' | translate}}
		</button>
		<button *ngIf="isUserDatasetRelated()" mat-menu-item (click)="deleteClicked(dataset.id)" class="menu-item">
			<mat-icon>delete</mat-icon>{{ 'DATASET-WIZARD.ACTIONS.DELETE' | translate }}
		</button>
		<!-- <button mat-menu-item *ngIf="needsUpdate(activity)" class="menu-item" (click)="openUpdateDatasetProfileDialogue(activity.id);">
			<mat-icon>update</mat-icon>
			{{ 'DATASET-WIZARD.ACTIONS.UPDATE-DATASET-PROFILE' | translate }}
		</button> -->
	</mat-menu>

	<mat-menu #exportMenu="matMenu" xPosition="before">
		<button mat-menu-item (click)="downloadPDF(dataset)">
			<i class="fa fa-file-pdf-o pr-2"></i>
			<span>{{'GENERAL.FILE-TYPES.PDF' | translate}}</span>
		</button>
		<button mat-menu-item (click)="downloadDOCX(dataset)">
			<i class="fa fa-file-word-o pr-2"></i>
			<span>{{'GENERAL.FILE-TYPES.DOC' | translate}}</span>
		</button>
		<button mat-menu-item (click)="downloadXML(dataset)">
			<i class="fa fa-file-code-o pr-2"></i>
			<span>{{'GENERAL.FILE-TYPES.XML' | translate}}</span>
		</button>
	</mat-menu>
</div>


<!-- Version 0 -->
<!-- <div class="listing-item" *ngIf="!isDeleted">
	<a [routerLink]="getItemLink()">
		<div class="col">
			<div class="row">
				<div class="col-12 gray-container container-header">
					<p (click)="$event.stopImmediatePropagation();">{{ dataset.grantAbbreviation }}</p> -->
<!-- <p (click)="$event.stopImmediatePropagation(); grantClicked(dataset)">{{ dataset.grantAbbreviation }}</p> -->
<!-- <button mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto" (click)="$event.stopImmediatePropagation();">
						<mat-icon class="more-horiz">more_horiz</mat-icon>
					</button> -->
<!-- </div>
			</div>
			<div class="row">
				<div class="col-auto">
					<mat-icon *ngIf="isDraft" matTooltip="{{'DATASET-LISTING.TOOLTIP.DATASET-STATUS.DRAFT' | translate}}" class="draft-bookmark">
						bookmark
					</mat-icon>
					<mat-icon *ngIf="!isDraft" matTooltip="{{'DATASET-LISTING.TOOLTIP.DATASET-STATUS.FINALIZED' | translate}}" class="finalized-bookmark">
						bookmark
					</mat-icon>
				</div>
				<div class="col">
					<div class="row d-flex flex-wrap">
						<div class="col pl-0">
							<h4 class="title pl-0" *ngIf="isDraft">
								<span>{{ 'TYPES.DATASET-STATUS.DRAFT' | translate }}:</span> {{ dataset.label }}</h4>
							<h4 class="title pl-0" *ngIf="!isDraft">{{ dataset.label }}</h4>
						</div>
					</div>
					<div class="row">
						<div class="col-12 pl-0">
							<p class="mt-1 mb-2">{{dataset.description}}</p>
						</div>
					</div>
					<div class="row">
						<div class="col-auto about-item pl-0">
							<a class="row storage" [routerLink]="getDmpLink()">
								<mat-icon matTooltip="{{'DATASET-LISTING.TOOLTIP.DMP' | translate}}" class="col-auto gray-icon pr-0 pt-2">
									storage
								</mat-icon>
								<h4 class="col mt-2 ml-1 mr-3 p-1">{{ dataset.dmp }}</h4>
							</a>
						</div>

						<div class="col-auto about-item pl-0">
							<div class="row">
								<mat-icon matTooltip="{{'DATASET-LISTING.TOOLTIP.GRANT' | translate}}" class="col-auto gray-icon pr-0 pt-2">
									work_outline
								</mat-icon>
								<h4 class="col mt-2 ml-1 mr-3 p-1">{{ dataset.grant }}</h4>
							</div>
						</div>

						<div class="col-auto about-item pl-0">
							<mat-icon matTooltip="{{'DATASET-LISTING.TOOLTIP.TEMPLATES-INVOLVED' | translate}}" class="gray-icon pt-2">
								assignment
							</mat-icon>
							<div class="pt-1">
								<div matTooltip="{{ dataset.profile }}" class="chip ml-2 mr-2">{{ dataset.profile }}</div>
							</div>
						</div>
						<div class="row" *ngIf="!isPublic">
							<mat-icon matTooltip="{{'DATASET-LISTING.TOOLTIP.VERSION' | translate}}" class="col-auto gray-icon pr-0 pt-2">
								history
							</mat-icon>
							<h4 class="col mt-2 ml-1 mr-3 p-1">{{ dataset.version }}</h4>
						</div>

						<div class="col-auto about-item ml-auto">
							<p *ngIf="isDraft">{{'DATASET-LISTING.COLUMNS.LAST-EDITED' | translate}} {{ dataset.modified | date: "shortDate"}}</p>
							<p *ngIf="!isDraft">{{'DATASET-LISTING.COLUMNS.FINALIZED' | translate}} {{ dataset.finalizedAt | date: "shortDate"}}</p>
						</div>
					</div>
				</div>
			</div> -->
<!-- <div class="info">
				<h6>{{ dataset.dmp }}</h6>
				<p>{{ dataset.grant }}</p>
			</div>
			<div class="row" style="margin-left: 0px !important">
				<div class="chip">
					<p>{{ dataset.profile }}</p>
				</div>
			</div> -->
<!-- </div>
	</a>
</div> -->
<!-- <mat-divider *ngIf="showDivider"></mat-divider> -->
