aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-page/need-page.component.html
blob: a8479fdfa280b7be5ff194c4135bd11e607e0a3d (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
<div id="box">
    <h1>{{need?.name}}</h1>
    <div>
        <h3>Looking for <u>{{need?.type}}</u> Donations.</h3>
    </div>
    <div *ngIf="need?.filterAttributes">
        <p>Tags:</p>
        <ul style="display: flex; column-gap: 24px;">
            <li *ngFor="let tag of need?.filterAttributes">
                <p>{{tag}}</p>
            </li>
        </ul>
    </div>

    <hr>
    <span>{{need?.description}}</span>
    <img *ngIf="need?.image" alt="Need image" [src]="need?.image"/>
    <p>Location: {{need?.location}}</p>
    <p>Urgent: {{need?.urgent}}</p>
    <span>{{need?.current}} / {{need?.maxGoal}}</span>
    <progress [value]="need?.current" [max]="need?.maxGoal"></progress>
    <span>This goal is <strong>{{(((need?.current ?? 0)*100) / (need?.maxGoal ?? 0)).toFixed(0)}}%</strong> complete!</span>
    <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 [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>

<!--    <app-need-edit id="editor" [selectedNeed]="need!"></app-need-edit>-->
</div>