<div class="listing-item">
	<a [routerLink]="['/plans/overview/' + dmp.id]">
		<div class="col">
			<div class="row">
				<div class="col-12 gray-container container-header">
					<p>{{dmp.grantAbbreviation}}</p>
					<button *ngIf="isDraft" mat-icon-button [matMenuTriggerFor]="actionsMenu" class="ml-auto" (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(dmp.id)" class="menu-item">
							<mat-icon>edit</mat-icon>{{ 'DMP-LISTING.ACTIONS.EDIT' | translate }}
						</button>
						<button mat-menu-item (click)="openShareDialog(dmp.id,dmp.label)">
							<mat-icon>share</mat-icon>{{'DMP-LISTING.ACTIONS.INVITE' | translate}}
						</button>
						<button mat-menu-item (click)="addDataset(dmp.id)">
							<mat-icon>add</mat-icon>{{'DMP-LISTING.ACTIONS.ADD-DATASET' | translate}}
						</button>
						<button mat-menu-item (click)="showDatasets(dmp.id, dmp.label)">
							<mat-icon>list</mat-icon>{{'DMP-LISTING.ACTIONS.DATASETS' | translate}}
						</button>
						<button mat-menu-item (click)="viewVersions(dmp.groupId, dmp.label)">
							<mat-icon>library_books</mat-icon>{{'DMP-LISTING.ACTIONS.VIEW-VERSION' | translate}}
						</button>
					</mat-menu>
				</div>
			</div>
			<div class="row">
				<div class="col-auto">
					<mat-icon *ngIf="isDraft" matTooltip="{{'DMP-LISTING.TOOLTIP.DMP-STATUS.DRAFT' | translate}}" class="draft-icon">
						lock_open
					</mat-icon>
					<mat-icon *ngIf="isFinalized && !isPublished" matTooltip="{{'DMP-LISTING.TOOLTIP.DMP-STATUS.FINALIZED' | translate}}" class="lock-icon">
						lock
					</mat-icon>
					<div *ngIf="isPublished" class="outer-circle"><div class="inner-circle" matTooltip="{{'DMP-LISTING.TOOLTIP.DMP-STATUS.PUBLISHED' | translate}}"></div></div>
					<!-- <mat-icon *ngIf="isPublished" matTooltip="{{'DMP-LISTING.TOOLTIP.DMP-STATUS.PUBLISHED' | translate}}" class="published-icon">radio_button_checked</mat-icon> -->
				</div>
				<div class="col">
					<div class="row d-flex flex-wrap">
						<!-- <div class="col-12 d-flex flex-wrap"> -->
						<div class="col pl-0">
							<h4 class="title pl-0" *ngIf="isDraft">
								<span>{{ 'TYPES.DMP.DRAFT' | translate }}:</span> {{dmp.label}}
							</h4>
							<h4 class="title pl-0" *ngIf="!isDraft">{{dmp.label}}</h4>
						</div>
						<!-- </div> -->
					</div>
					<div class="row">
						<div class="col-auto pl-0">
							<p class="mt-1 description">{{dmp.description}}</p>
						</div>
						<div class="col-auto about-item ml-auto">
							<p>{{'DMP-LISTING.COLUMNS.VERSION' | translate}} : {{dmp.version}}</p>
						</div>
					</div>
					<div class="row">
						<div class="col-auto about-item pl-0">
							<mat-icon class="gray-icon pt-2" matTooltip="{{'DMP-LISTING.TOOLTIP.LEVEL-OF-ACCESS' | translate}}">
								settings
							</mat-icon>
							<h4 class="mt-1 ml-1 mr-3 p-1 role">{{roleDisplay(dmp.users).toUpperCase()}}</h4>
						</div>
						<div class="col-auto about-item">
							<a class="datasets-counter" [routerLink]="['/plans/edit/' + dmp.id]" [queryParams]="{ tab: 'datasetDescriptions' }">
								<mat-icon class="gray-icon pt-2" matTooltip="{{'DMP-LISTING.TOOLTIP.INVOLVED-DATASETS' | translate}}">
									storage
								</mat-icon>
								<h4 class="mt-1 ml-1 mr-3 p-1">{{dmp.datasets.length}}</h4>
							</a>
						</div>
						<div class="col-auto about-item pt-2 pl-0">
							<mat-icon class="gray-icon" matTooltip="{{'DMP-LISTING.TOOLTIP.TEMPLATES-INVOLVED' | translate}}">assignment</mat-icon>
							<div *ngFor="let profile of dmp.associatedProfiles" class="pb-1">
								<div matTooltip="{{profile.label}}" class="chip ml-2 mr-2">{{profile.label}}</div>
							</div>
						</div>
						<div class="col-auto about-item ml-auto">
							<p *ngIf="isDraft">{{'DMP-PROFILE-LISTING.COLUMNS.LAST-EDITED' | translate}} {{dmp.modifiedTime | date: "shortDate"}}</p>
							<p *ngIf="isFinalized && !isPublished">{{'TYPES.DMP.FINALISED' | translate}} {{dmp.finalizedAt | date: "shortDate"}}</p>
							<p *ngIf="isPublished">{{'DMP-PROFILE-LISTING.COLUMNS.PUBLISHED' | translate}} {{dmp.publishedAt | date: "shortDate"}}</p>
						</div>
					</div>
				</div>
			</div>
			<!-- <div class="row d-flex align-items-center my-1">
				<mat-icon class="col-auto gray-icon">group</mat-icon>
				<div class="row" *ngFor="let user of dmp.users">
					<div class="col-auto squared-chip mr-2">{{user.name}}</div>
				</div>
			</div> -->
		</div>
	</a>
</div>
<!-- <mat-divider *ngIf="showDivider"></mat-divider> -->
