This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
bookmarks.component.html 8.65 KiB
Newer Older
Michael Breu's avatar
Michael Breu committed
<div class="card-container">
    <h2 id="page-heading">
        <span jhiTranslate="gitsearchApp.userWatchList.home.title">User Watch Lists</span>

        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-user-watch-list" [routerLink]="['/bookmarks/new']">
            <fa-icon icon="plus"></fa-icon>
            <span class="hidden-sm-down"  jhiTranslate="gitsearchApp.userWatchList.home.createLabel">
            Create a new User Watch List 
            </span>
        </button>
    </h2>

    <jhi-alert-error></jhi-alert-error>

    <jhi-alert></jhi-alert>

<div class="row"
     infiniteScroll
     [infiniteScrollDistance]="2"
     [infiniteScrollThrottle]="50"
     (scrolled)="onScroll()">

Michael Breu's avatar
Michael Breu committed
    <div class="col-12 col-md-5 col-lg-4 col-xl-3">
Michael Breu's avatar
Michael Breu committed
        <div class="table-responsive" id="entities" *ngIf="userWatchLists && userWatchLists.length > 0">
        <div class="col-sm-12">
            <form name="searchForm" class="form-inline">
                <div class="input-group w-100 mt-3">
                    <input type="text" class="form-control" [(ngModel)]="currentSearch" id="currentSearch" name="currentSearch" placeholder="{{ 'gitsearchApp.userWatchList.home.search' | translate }}">

                    <button class="input-group-append btn btn-info" (click)="search(currentSearch)">
                        <fa-icon icon="search"></fa-icon>
                    </button>

                    <button class="input-group-append btn btn-danger" (click)="search('')" *ngIf="currentSearch">
                        <fa-icon icon="trash-alt"></fa-icon>
                    </button>
                </div>
            </form>
        </div>
Michael Breu's avatar
Michael Breu committed
        <table class="table table-striped" aria-describedby="page-heading">
            <thead>
                <tr jhiSort [(predicate)]="predicate" [(ascending)]="ascending" [callback]="reset.bind(this)">
                    <th scope="col"  jhiSortBy="name"><span jhiTranslate="gitsearchApp.userWatchList.name">Name</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"></th>
                </tr>
            </thead>
            <tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
                <tr *ngFor="let userWatchList of userWatchLists ;trackBy: trackId">
Michael Breu's avatar
Michael Breu committed
                    <td class="{{isSelected(userWatchList)?'selected':''}}" (click)="view(userWatchList)" style="cursor: pointer;">{{ userWatchList.name }}</td>
Michael Breu's avatar
Michael Breu committed
                    <td class="text-right">
                        <div class="btn-group">
                            <button type="submit" (click)="view(userWatchList)" style="border-width:0px;background-color: transparent;"
Michael Breu's avatar
Michael Breu committed
                                    >
                                <fa-icon icon="eye"></fa-icon>
                            </button>

                            <button type="submit"   style="border-width:0px;background-color: transparent;"
                                    [routerLink]="['/bookmarks', userWatchList.id, 'edit']"
Michael Breu's avatar
Michael Breu committed
                                    >
                                <fa-icon icon="pencil-alt"></fa-icon>
                            </button>

                            <button type="submit" (click)="delete(userWatchList)"  style="border-width:0px;background-color: transparent;"
Michael Breu's avatar
Michael Breu committed
                                    >
                                <fa-icon icon="times"></fa-icon>
                            </button>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>
Michael Breu's avatar
Michael Breu committed
        <span *ngIf="getCommonActions().length > 0">
		<p style="text-align: left; margin-top: 20px;">
Michael Breu's avatar
Michael Breu committed
			<strong jhiTranslate="gitsearchApp.userWatchList.export"></strong>
Michael Breu's avatar
Michael Breu committed
		</p>
		<a *ngFor="let action of getCommonActions()"
			class="btn btn-outline-secondary" role="button" aria-pressed="true"
			style="float: left; margin-right: 5px; margin-top: 5px;"
			(click)="startAction(action)">{{action.commandName}}</a>
		</span>
        </div>
    <div class="col-12 col-md-7 col-lg-8 col-xl-9">
        <div *ngIf="results.length === 0" >
            <span jhiTranslate="search.noResults">No results found</span>
        </div>
        <div *ngIf="hitCount !== 0" >
            <span>{{ 'search.numberResults' | translate:{'length': hitCount} }}</span>
        </div>
        <div class="row">
            <jhi-exercise-card *ngFor="let result of results"
                               class="card-container col-12 col-lg-6 col-xl-4"
                               [exercise]="result"
                               (exerciseSelectionEvent)="selectExercise($event)">
            </jhi-exercise-card>
        </div>
    </div>
    
    <jhi-exercise-details [exercise]="selectedResult"></jhi-exercise-details>
    
    <!--  old Version
Michael Breu's avatar
Michael Breu committed
    <div class="col-12 col-md-7 col-lg-8 col-xl-9">
    <div>
        <div class="col-sm-12">
            <form name="searchForm" class="form-inline">
                <div class="input-group w-100 mt-3">
                    <input type="text" class="form-control" [(ngModel)]="currentSearch" id="currentSearch" name="currentSearch" placeholder="{{ 'gitsearchApp.userWatchList.home.search' | translate }}">

                    <button class="input-group-append btn btn-info" (click)="search(currentSearch)">
                        <fa-icon icon="search"></fa-icon>
                    </button>

                    <button class="input-group-append btn btn-danger" (click)="search('')" *ngIf="currentSearch">
                        <fa-icon icon="trash-alt"></fa-icon>
                    </button>
                </div>
            </form>
        </div>
    </div>

    <div class="alert alert-warning" id="no-result" *ngIf="userWatchLists?.length === 0">
        <span jhiTranslate="gitsearchApp.userWatchList.home.notFound">No userWatchLists found</span>
    </div>

    <div class="table-responsive" id="entities" *ngIf="userWatchLists && userWatchLists.length > 0">
        <table class="table table-striped" aria-describedby="page-heading">
            <thead>
                <tr jhiSort [(predicate)]="predicate" [(ascending)]="ascending" [callback]="reset.bind(this)">
                    <th scope="col"  jhiSortBy="id"><span jhiTranslate="global.field.id">ID</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"  jhiSortBy="name"><span jhiTranslate="gitsearchApp.userWatchList.name">Name</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"  jhiSortBy="userIdLogin"><span jhiTranslate="gitsearchApp.userWatchList.userId">User Id</span> <fa-icon icon="sort"></fa-icon></th>
                    <th scope="col"></th>
                </tr>
            </thead>
            <tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
                <tr *ngFor="let userWatchList of userWatchLists ;trackBy: trackId">
                    <td><a [routerLink]="['/user-watch-list', userWatchList.id, 'view']">{{ userWatchList.id }}</a></td>
                    <td>{{ userWatchList.name }}</td>
                    <td>
                        {{ userWatchList.userIdLogin }}
                    </td>
                    <td class="text-right">
                        <div class="btn-group">
                            <button type="submit"
                                    [routerLink]="['/user-watch-list', userWatchList.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]="['/user-watch-list', userWatchList.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" (click)="delete(userWatchList)"
                                    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>
Michael Breu's avatar
Michael Breu committed
    </div>