diff options
author | benal01 <bja4245@rit.edu> | 2025-04-05 13:22:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-05 13:22:58 -0400 |
commit | 0103ffc6f84d04433943c644ab759c1d04b5e681 (patch) | |
tree | 1cd8fb31b849b4d5be00d4be0e3db92bbbafb5e1 /ufund-ui/src/app/components/funding-basket/funding-basket.component.html | |
parent | 5a5d31896d79a736bce33b7d1aa7b3168ba308a9 (diff) | |
parent | 04db6f32b249ffb17c571cd6b16c8c54397f0be4 (diff) | |
download | JellySolutions-0103ffc6f84d04433943c644ab759c1d04b5e681.tar.gz JellySolutions-0103ffc6f84d04433943c644ab759c1d04b5e681.tar.bz2 JellySolutions-0103ffc6f84d04433943c644ab759c1d04b5e681.zip |
Merge pull request #27 from RIT-SWEN-261-02/need-list-abstraction
Need list abstraction
Diffstat (limited to '')
-rw-r--r-- | ufund-ui/src/app/components/funding-basket/funding-basket.component.html | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html index bba66a3..3f840e1 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.html +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.html @@ -1,44 +1,24 @@ <div id="box"> - <h1>Funding Basket</h1> - <ng-template [ngIf]="usersService.getBasket().getValue().length"> - <div id="needList"> - <div *ngFor="let need of usersService.getBasket().getValue()" class="needEntry"> - <div [routerLink]="'/need/' + need.id" class="clickable"> - <div class="split"> - <div class="left"> - <span class="needName">{{need.name}}</span> - <span class="needType">{{need.type}}</span> - </div> - - <div class="right"> - <span *ngIf="need.urgent" class="urgent">URGENT</span> - <span *ngIf="need.location"><span class="icon">location_on</span>{{need.location}}</span> - </div> - </div> - - <br> - - <div class="prog"> - <span id="hover-status-label-{{need.id}}"> </span> - <span>{{need.current}}/{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span> - <progress [value]="need.current" [max]="need.maxGoal"></progress> - </div> - </div> - - <div class="actionArea"> - <input type="number" placeholder="Quantity" min="1" [id]="need.id" class="contribution" (input)="resetColor($event)"> - <button class="removeNeed" title="delete need" (click)="this.usersService.removeNeed(need.id)"> - <span class="icon">delete</span> Remove from Basket - </button> - </div> + @if ((authService.getCurrentUserSubject() | async)?.type === userType.HELPER) { + <h1>Funding Basket</h1> + <ng-template [ngIf]="(usersService.getBasket() | async)?.length"> + <ng-template let-need #NLActions> + <input type="number" placeholder="Quantity" min="1" [id]="need?.id" class="contribution" (input)="resetColor($event)"> + <button class="removeNeed" (click)="this.usersService.removeNeed(need.id)"> + <span class="icon">delete</span>Remove from Basket + </button> + </ng-template> + <app-need-list [actionArea]="NLActions" [needs]="(usersService.getBasket() | async)!"/> + <br> + <div id="footer"> + <button class="button2" title="checkout" (click)="checkout()">Checkout</button> </div> + </ng-template> + <div *ngIf="!usersService.getBasket().getValue().length"> + <span>There are no needs in your basket! </span><a routerLink="/cupboard">Browse the cupboard</a> </div> - <br> - <div id="footer"> - <button class="button2" title="checkout" (click)="checkout()">Checkout</button> - </div> - </ng-template> - <div *ngIf="!usersService.getBasket().getValue().length"> - <span>There are no needs in your basket! </span><a routerLink="/cupboard">Browse the cupboard</a> - </div> + } @else { + <h1>Unauthorized</h1> + <span>This page requires you to be logged in as a user! <a routerLink="/login">Log In</a></span> + } </div> |