diff options
| author | benal01 <bja4245@rit.edu> | 2025-04-02 22:52:09 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-02 22:52:09 -0400 | 
| commit | fb6d8140830bbb5081056105eaa775f26885da8f (patch) | |
| tree | c744dd407f46f71b692aaaad6d4c66237c8ba9a5 /ufund-ui | |
| parent | a6cdb080576ef24718986bccd0a12d174c8aaa05 (diff) | |
| parent | 2b7c42ffacaaf884bc9497e975c0c3274e9f966e (diff) | |
| download | JellySolutions-fb6d8140830bbb5081056105eaa775f26885da8f.tar.gz JellySolutions-fb6d8140830bbb5081056105eaa775f26885da8f.tar.bz2 JellySolutions-fb6d8140830bbb5081056105eaa775f26885da8f.zip  | |
Merge branch 'main' into need-image
Diffstat (limited to '')
3 files changed, 16 insertions, 9 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.html b/ufund-ui/src/app/components/need-list/need-list.component.html index 593aebf..84f80dc 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.html +++ b/ufund-ui/src/app/components/need-list/need-list.component.html @@ -16,7 +16,7 @@              <span class="icon">{{sortMode === 'Ascending' ? 'arrow_upward': 'arrow_downward'}}</span>          </button>          <label>Needs per page: </label> -        <input type ="number" [(ngModel)]="itemsPerPage" (change)="resetVisibleNeeds()" min="1" max="{{searchResults.length}}"> +        <input type ="number" [(ngModel)]="itemsPerPage" (change)="editNeedsPerPage()" min="1" max="{{searchResults.length}}">      </div>      <!--<button (click)="close()">Close</button>-->  </div> @@ -42,7 +42,8 @@              <div class="prog">                  <span id="hover-status-label-{{need.id}}"> </span> -                <span>{{getPrefix(need)}}{{need.current}}/{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span> + +                <span>{{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.current}}/{{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.maxGoal}} ({{((need.current / need.maxGoal) * 100).toFixed(0)}}%)</span>                  <progress [value]="need.current" [max]="need.maxGoal"></progress>              </div> diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index 2ec850e..ae6bc99 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -96,9 +96,14 @@ export class NeedListComponent {        this.updateVisibleNeeds()    } -  editNeedsPerPage(amount: number) { -    this.itemsPerPage = amount; -    this.updateVisibleNeeds(); +  editNeedsPerPage() { +    if (this.itemsPerPage > this.searchResults.length) { +      this.itemsPerPage = this.searchResults.length; +    } +    if (this.itemsPerPage < 1) { +      this.itemsPerPage = 1; +    } +    this.resetVisibleNeeds();    }    updateVisibleNeeds() { 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 f8c2007..6921eac 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 @@ -8,13 +8,14 @@          <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> +      <div class="left"> +        <span><strong>Target Goal:</strong> {{(need.type === GoalType.MONETARY) ? "$" : ""}}{{need.maxGoal}}</span> -    <span><strong>Amount Currently Collected:</strong> {{need.current}}</span> +        <span><strong>Amount Currently Collected:</strong> {{need.type.toString() == 'MONETARY' ? '$' : ''}}{{need.current}}</span> -    <span><strong>Location:</strong> {{need.location}}</span> +        <span><strong>Location:</strong> {{need.location}}</span>              <span><strong>Urgency: </strong>                  <span *ngIf="!need.urgent">Not urgent</span>  | 
