aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/funding-basket/funding-basket.component.html
blob: 178a2cd9504eafa2bfd07acc7fc57ee7c1e2650d (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
<h1>Funding Basket</h1>

<div id="needCount">
    <label for="needCount">Needs in Basket:</label>
    <span>{{ this.usersService.getBasket().getValue().length }}</span>
</div>

<div *ngIf="this.usersService.getBasket().getValue().length == 0">
    <h2>There are no needs in the basket</h2>
</div>

<table class="needs" id="funding-basket" *ngIf="this.usersService.getBasket().getValue().length != 0">
    <thead>
        <tr>
            <th class="need"></th>
        </tr>
    </thead>
    <tbody>
        <tr *ngFor="let need of usersService.getBasket().getValue()">
            <td>
                <a routerLink="/need/{{need.id}}">{{need.name}}</a>
                <p>Goal: {{need.maxGoal}}</p>
                <p>Current: {{need.current}}</p>
                <p>How much to Contribute: <input type="number" placeholder="insert value" min="0" id={{need.id}} class="contribution"></p>
                <br>
                <div>
                    <button type="button" class="removeNeed" title="delete need"
                    (click)="this.usersService.removeNeed(need.id)">Remove Need</button>
                </div>
            </td>
        </tr>
    </tbody>
</table>
<br>
<div>
    <p *ngIf="!isValid">Invalid input in funding basket!</p>
    <button type="submit" class="checkout" title="checkout" (click)="checkout()">Checkout</button>
</div>