<schema2jsonld *ngIf="url" [URL]="url" [name]="pageTitle" type="other"></schema2jsonld>
<ng-container *ngIf="longView else shortView">
  <div style="min-height: 650px;">
		<div class="uk-container uk-container-large uk-section uk-section-small uk-padding-remove-bottom">
			<div class="uk-padding-small uk-padding-remove-horizontal">
				<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
			</div>
		</div>
		<div class="uk-container uk-container-large uk-section uk-section-small">
			<div *ngIf="showLoading" class="uk-margin-large uk-padding-large uk-padding-remove-horizontal">
				<loading></loading>
			</div>
			<div *ngIf="!showLoading">
				<h1 class="uk-margin-top">
					Curators
				</h1>
				<div *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" class="uk-margin-medium">
					<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
						[texts]="pageContents['top']">
					</helper>
				</div>
				<div *ngIf="curators" class="uk-margin-large-top">
					<div *ngFor="let curator of curators let i=index;" class="uk-card uk-card-default uk-padding uk-margin-medium-bottom">
						<div class="uk-grid" uk-grid>
							<div class="uk-width-2-3@m uk-flex uk-flex-middle">
								<div class="uk-width-small">
									<img *ngIf="curator.photo && curator.photo !== ''" class="uk-border-circle" style="width: 150px; height: 150px;"
										src="{{downloadUrl + curator.photo}}" alt="Curator Photo">
									<img *ngIf="!curator.photo || curator.photo == ''" class="uk-border-circle" style="width: 150px; height: 150px;"
										src="../../assets/common-assets/curator-default.png" alt="Curator Photo">
								</div>
								<div class="uk-width-expand">
									<div class="uk-padding">
										<h4 class="uk-margin-remove">{{curator.name}}</h4>
										<div *ngIf="curator.bio" class="uk-margin-top uk-height-max-large uk-overflow-auto">
											<div class="uk-text-muted uk-margin-small-bottom">
												Biography
											</div>
											<div>
												<div *ngIf="!viewingMore">{{format(curator.bio)}}</div>
												<div *ngIf="viewingMore">{{curator.bio}}</div>
												<div *ngIf="curator.bio.length >= maxCharacters" class="uk-text-right uk-margin-small-top">
													<a *ngIf="curator.bio.length >= maxCharacters"
														(click)="openFsModal(curator)">
														View details
													</a>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							<div *ngIf="curator.affiliations && curator.affiliations.length > 0" class="uk-width-1-3@m uk-padding" style="border-left: 1px solid #eaeaea">
								<div class="uk-text-muted uk-margin-bottom">
									Affiliations
								</div>
								<div class="uk-grid uk-flex-middle uk-child-width-1-2" uk-grid>
									<div *ngFor="let affiliation of curator.affiliations">
										<span *ngIf="!affiliation.website_url">
											<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
										</span>
										<a *ngIf="affiliation.website_url"
												target="_blank" [href]="affiliation.website_url | urlPrefix">
											<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
										</a>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="uk-margin-medium">
				<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
					[texts]="pageContents['bottom']">
				</helper>
			</div>
		</div>
  </div>
</ng-container>

<!-- Short view for community's homepage -->
<ng-template #shortView>
  <div *ngIf="curators && curators.length > 0" class="uk-grid" uk-grid>
    <span class="uk-width-auto">
      Curated by:
    </span>
    <div class="uk-width-expand uk-padding-remove uk-overflow-auto">
      <div class="uk-height-max-medium uk-margin-xsmall-left">
				<a routerLink="/curators">
					<span *ngFor="let curator of curators.slice(0,curatorsLimit) let i=index;">
						{{curator.name}}
						<span *ngIf="i < curators.length-1 && i < curatorsLimit-1">, </span>
					</span>
					<span *ngIf="curators.length > curatorsLimit">
						+{{curators.length-curatorsLimit}} more
					</span>
				</a>
      </div>
    </div>
  </div>
</ng-template>
<fs-modal #fsModal classTitle="">
	<div *ngIf="curatorInModal" class="uk-width-1-1 uk-height-1-1">
		<div class="uk-container uk-container-large uk-section">
			<div class="uk-margin-large-top uk-grid uk-grid-large" uk-grid>
				<div class="uk-width-1-3@m">
					<h2>
						{{curatorInModal.name}}
					</h2>
					<img *ngIf="curatorInModal.photo && curatorInModal.photo !== ''" class="uk-width-2-3 uk-border-circle uk-margin-top uk-margin-bottom"
						src="{{downloadUrl + curatorInModal.photo}}" alt="Curator Photo">
					<img *ngIf="!curatorInModal.photo || curatorInModal.photo == ''" class="uk-width-2-3 uk-border-circle uk-margin-top uk-margin-bottom"
						src="../../assets/common-assets/curator-default.png" alt="Curator Photo">
				</div>
				<div class="uk-width-2-3@m">
					<ul class="uk-tab" uk-tab>
            <li>
              <a>Biography</a>
            </li>
            <li *ngIf="curatorInModal.affiliations && curatorInModal.affiliations.length > 0">
              <a>Affiliations</a>
            </li>
          </ul>
					<ul class="uk-switcher">
            <li class="uk-padding uk-padding-remove-left">
							<h5>
								Biography
							</h5>
							<div>
								{{curatorInModal.bio}}
							</div>
						</li>
						<li *ngIf="curatorInModal.affiliations && curatorInModal.affiliations.length > 0" class="uk-padding uk-padding-remove-left">
							<div class="uk-grid uk-flex-middle uk-child-width-1-3" uk-grid>
								<div *ngFor="let affiliation of curatorInModal.affiliations">
									<span *ngIf="!affiliation.website_url">
										<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
									</span>
									<a *ngIf="affiliation.website_url"
											target="_blank" [href]="affiliation.website_url | urlPrefix">
										<img [src]="affiliation.logo_url | urlPrefix" [alt]="affiliation.name">
									</a>
								</div>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
</fs-modal>
