<div>
    <h2 id="page-heading">
        <span jhiTranslate="faeBooApp.photo.home.title">Photos</span>
        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-photo" [routerLink]="['/photo/new']">
            <fa-icon [icon]="'plus'"></fa-icon>
            <span  jhiTranslate="faeBooApp.photo.home.createLabel">
            Create new Photo
            </span>
        </button>
    </h2>
    <jhi-alert></jhi-alert>
    <br/>
    <div class="table-responsive" *ngIf="photos">
        <table class="table table-striped">
            <thead>
            <tr>
            <th><span jhiTranslate="global.field.id">ID</span></th>
            <th><span jhiTranslate="faeBooApp.photo.imageURL">Image URL</span></th>
            <th><span jhiTranslate="faeBooApp.photo.size">Size</span></th>
            <th><span jhiTranslate="faeBooApp.photo.post">Post</span></th>
            <th><span jhiTranslate="faeBooApp.photo.album">Album</span></th>
            <th></th>
            </tr>
            </thead>
            <tbody>
            <tr *ngFor="let photo of photos ;trackBy: trackId">
                <td><a [routerLink]="['/photo', photo.id, 'view' ]">{{photo.id}}</a></td>
                <td>{{photo.imageURL}}</td>
                <td>{{photo.size}}</td>
                <td>
                    <div *ngIf="photo.post">
                        <a [routerLink]="['../post', photo.post?.id, 'view' ]" >{{photo.post?.id}}</a>
                    </div>
                </td>
                <td>
                    <span *ngFor="let album of photo.albums; let last = last">
                            <a class="form-control-static" [routerLink]="['../album', album?.id, 'view' ]">{{album.name}}</a>{{last ? '' : ', '}}
                        </span>
                </td>
                <td class="text-right">
                    <div class="btn-group flex-btn-group-container">
                        <button type="submit"
                                [routerLink]="['/photo', photo.id, 'view' ]"
                                class="btn btn-info btn-sm">
                            <fa-icon [icon]="'eye'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.view">View</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/photo', photo.id, 'edit']"
                                class="btn btn-primary btn-sm">
                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.edit">Edit</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/', { outlets: { popup: 'photo/'+ photo.id + '/delete'} }]"
                                replaceUrl="true"
                                queryParamsHandling="merge"
                                class="btn btn-danger btn-sm">
                            <fa-icon [icon]="'times'"></fa-icon>
                            <span class="d-none d-md-inline" jhiTranslate="entity.action.delete">Delete</span>
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
