aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.html
blob: bdc8a0e18154611ac399251185f25ef15a1681a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<div id="box">
    <div id="header">
        <h1> Cupboard </h1>
        <button *ngIf="isManager()" class="button2" (click)="this.selectForm('create')"><span class="icon">add</span>Create Need</button>
    </div>

    <div id="header2">
        <div id="searchArea">
            <form id="search-form" #searchForm="ngForm">
                <input type="text" name="search" class="wide-input" placeholder="Search in {{needs.length}} needs..." (input)="search(searchForm.value)" ngModel>
                <input type="reset" value="Clear" (click)="search(null)"> <br>
            </form>
        </div>
        <div id="sortArea">
            <label for="sort">Sort by: </label>
            <select id='sort' [(ngModel)] = "currentSortAlgo" class="wide-input" (change)="search(searchForm.value)" [value]="currentSortAlgo">
                <option *ngFor="let algorithm of Object.values(SortingAlgoArrays)" value="{{algorithm}}">
                    {{algorithm.display[sortMode === 'Ascending' ? 0 : 1]}}
                </option>
            </select>
            <button (click)="changeSortMode(searchForm.value)">
                <span class="icon">{{sortMode === 'Ascending' ? 'arrow_upward': 'arrow_downward'}}</span>
            </button>
            <label>Needs per page: </label>
<!--            <input type ="number" [(ngModel)]="itemsPerPage" min="1" max="{{searchResults.length}}">-->
        </div>
        <!--<button (click)="close()">Close</button>-->
    </div>
    <h2 *ngIf="(searchResults | async)?.length < needs.length && (searchResults | async)?.length != 0"> Search Results({{needs.length - (searchResults | async)?.length}} needs filtered): </h2>
    <h2 *ngIf="(searchResults | async)?.length == needs.length"> All Needs </h2>
    <h2 *ngIf="(searchResults | async)?.length == 0"> No Results Found </h2>

    <app-need-list [needs]="searchResults" #needList></app-need-list>
</div>

<!--<ng-template [ngIf]="isManager()" >-->
<!--<div>-->
<!--    <app-need-edit *ngIf="selectedForm === 'update'" [selectedNeed]="selectedNeed" (refreshNeedList)="needList.refresh()"></app-need-edit>-->
<!--    <div>-->
<!--        <div id="create-form" *ngIf="selectedForm === 'create'">-->
<!--            <h1> Create Need </h1>-->
<!--            <form #cupboardForm="ngForm" (ngSubmit)="submit(cupboardForm.value)">-->
<!--                <label>Name:</label><br>-->
<!--                <input type="text" name="name" ngModel><br>-->
<!--                <label>Image:</label><br>-->
<!--                <input type="text" name="image" ngModel><br>-->
<!--                <label>Location:</label><br>-->
<!--                <input type="text" name="location" ngModel><br>-->
<!--                <label>Max Goal:</label><br>-->
<!--                <input type="number" name="maxGoal" ngModel><br>-->
<!--                <label>Type</label><br>-->
<!--                <input type="radio" name="type" value="MONETARY" ngModel>-->
<!--                <label>Monetary</label><br>-->
<!--                <input type="radio" name="type" value="PHYSICAL" ngModel>-->
<!--                <label>Physical</label><br>-->
<!--                <input type="checkbox" name="urgent" value="false" ngModel>-->
<!--                <label>Urgent</label><br>-->
<!--                <label>Description</label><br>-->
<!--                <textarea name="description"></textarea><br>-->
<!--                <input type="submit" value="Submit">-->

<!--            </form>-->
<!--        </div>-->
<!--    </div>-->
<!--</div>-->
<!--</ng-template>-->