diff options
| author | sowgro <tpoke.ferrari@gmail.com> | 2025-04-06 15:15:47 -0400 | 
|---|---|---|
| committer | sowgro <tpoke.ferrari@gmail.com> | 2025-04-06 15:15:47 -0400 | 
| commit | 9f14b3787a8cfc49fd168b1242adcc6d5fa8bfd6 (patch) | |
| tree | 8af111a538a8d6361e1cf07467b9c31568284921 /ufund-ui/src/app/components/need-page/need-page.component.html | |
| parent | 1ac878b4aaa19ab889c7a98b7dab6acd57c778b3 (diff) | |
| parent | 04cb51b2e7891785c956c5faa73fb88cc04e82e0 (diff) | |
| download | JellySolutions-9f14b3787a8cfc49fd168b1242adcc6d5fa8bfd6.tar.gz JellySolutions-9f14b3787a8cfc49fd168b1242adcc6d5fa8bfd6.tar.bz2 JellySolutions-9f14b3787a8cfc49fd168b1242adcc6d5fa8bfd6.zip  | |
Merge branch 'main' into light-mode
# Conflicts:
#	ufund-ui/src/app/app.component.html
#	ufund-ui/src/app/components/funding-basket/funding-basket.component.html
#	ufund-ui/src/app/components/need-list/need-list.component.html
#	ufund-ui/src/app/components/need-page/need-page.component.css
Diffstat (limited to 'ufund-ui/src/app/components/need-page/need-page.component.html')
| -rw-r--r-- | ufund-ui/src/app/components/need-page/need-page.component.html | 79 | 
1 files changed, 39 insertions, 40 deletions
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.html b/ufund-ui/src/app/components/need-page/need-page.component.html index 6921eac..2629346 100644 --- a/ufund-ui/src/app/components/need-page/need-page.component.html +++ b/ufund-ui/src/app/components/need-page/need-page.component.html @@ -1,51 +1,50 @@  <div id="box"> -    <h1>{{need.name}}</h1> -    <span class="needType">{{need.type}} GOAL</span> -    <p>{{need.description}}</p> -    <div class="prog"> -<!--        <span>{{need?.current}} / {{need?.maxGoal}}</span>--> -        <progress [value]="need.current" [max]="need.maxGoal"></progress> -        <span>This goal is <strong>{{(((need.current)*100) / (need.maxGoal)).toFixed(0)}}%</strong> complete!</span> -    </div> - +    @if (need) { +        <img *ngIf="need.image" alt="Need image" class="need-image" [src]="need.image"/> +        <h1>{{need.name}}</h1> +        <span class="needType">{{need.type}} GOAL</span> +        <p>{{need.description}}</p> +        <div class="prog"> +            <progress [value]="need.current" [max]="need.maxGoal"></progress> +            <span>This goal is <strong>{{(((need.current)*100) / (need.maxGoal)).toFixed(0)}}%</strong> complete!</span> +        </div> -    <div class="split"> -      <div class="left">          <span><strong>Target Goal:</strong> {{(need.type === GoalType.MONETARY) ? "$" : ""}}{{need.maxGoal}}</span>          <span><strong>Amount Currently Collected:</strong> {{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.current}}</span>          <span><strong>Location:</strong> {{need.location}}</span> -            <span><strong>Urgency: </strong> -                <span *ngIf="!need.urgent">Not urgent</span> -                <span *ngIf="need.urgent" class="urgent">URGENT</span> -            </span> -         -            <div *ngIf="need.filterAttributes.length > 0"> -                <strong>Tags:</strong> -                <ul style="display: flex; column-gap: 24px;"> -                    <li *ngFor="let tag of need?.filterAttributes"> -                        <p>{{tag}}</p> -                    </li> -                </ul> -            </div> -        </div> -        <div class="right"> -          <img *ngIf="need.image" alt="Need image" class="need-image" [src]="need.image"/> +        <span><strong>Urgency: </strong> +            <span *ngIf="!need.urgent">Not urgent</span> +            <span *ngIf="need.urgent" class="urgent">URGENT</span> +        </span> + +        <div *ngIf="need.filterAttributes?.length"> +            <strong>Tags:</strong> +            <ul style="display: flex; column-gap: 24px;"> +                <li *ngFor="let tag of need?.filterAttributes"> +                    <p>{{tag}}</p> +                </li> +            </ul>          </div> -    </div> -     -    <div class="actionArea"> -        <button *ngIf="isHelper()" (click)="add(need!)"> -            <span class="icon">add</span>Add To Basket -        </button> -<!--        <button *ngIf="isManager()" (click)="edit(need!)">--> -<!--            <span class="icon">edit</span>Edit Need--> -<!--        </button>--> -        <button *ngIf="isManager()" (click)="delete(need!.id)" > -            <span class="icon">delete</span>Delete Need -        </button> -    </div> +        <div class="actionArea"> +            <button *ngIf="usersService.isHelper()" (click)="add(need)" [disabled]="usersService.inBasket(usersService.getBasket() | async, need)"> +                <span class="icon">{{usersService.inBasket(usersService.getBasket() | async, need)? "check": "add" }}</span>Add To Basket +            </button> +            <ng-template #edit> +                <app-need-edit [mode]="'Edit'" *ngIf="need" [need]="need" (refreshNeedList)="ngOnInit()"></app-need-edit> +            </ng-template> +            <button *ngIf="usersService.isManager()" (click)="modalService.showModal(edit)"> +                <span class="icon">edit</span>Edit Need +            </button> +            <button *ngIf="usersService.isManager()" (click)="delete(need!.id)" > +                <span class="icon">delete</span>Delete Need +            </button> +        </div> +    } @else { +        <h1>Need not found</h1> +        <span>The requested need does not exist. <a routerLink="/cupboard">Browse the cupboard</a></span> +    }  </div>  | 
