|
| 1 | +<app-page-layout> |
| 2 | + <article class="contributors-page"> |
| 3 | + <header class="page-header"> |
| 4 | + <span class="category-badge">Content</span> |
| 5 | + <h1>Contributors</h1> |
| 6 | + <p class="description"> |
| 7 | + Reactome authors and reviewers who have contributed pathways and reactions. |
| 8 | + </p> |
| 9 | + </header> |
| 10 | + |
| 11 | + <!-- Search bar --> |
| 12 | + <div class="search-bar"> |
| 13 | + <div class="search-input-wrapper"> |
| 14 | + <span class="material-symbols-rounded search-icon">search</span> |
| 15 | + <input |
| 16 | + type="text" |
| 17 | + placeholder="Search by name or ORCID..." |
| 18 | + [value]="searchQuery" |
| 19 | + (input)="onSearchInput($event)" |
| 20 | + /> |
| 21 | + @if (searchQuery) { |
| 22 | + <button class="clear-btn" (click)="clearSearch()"> |
| 23 | + <span class="material-symbols-rounded">close</span> |
| 24 | + </button> |
| 25 | + } |
| 26 | + </div> |
| 27 | + </div> |
| 28 | + |
| 29 | + <!-- Letter filter bar --> |
| 30 | + @if (!loading && !error) { |
| 31 | + <div class="letter-filter"> |
| 32 | + <button |
| 33 | + class="letter-chip" |
| 34 | + [class.active]="!activeLetter && !searchQuery" |
| 35 | + (click)="selectAll()" |
| 36 | + >All</button> |
| 37 | + @for (letter of letters; track letter) { |
| 38 | + <button |
| 39 | + class="letter-chip" |
| 40 | + [class.active]="activeLetter === letter" |
| 41 | + (click)="selectLetter(letter)" |
| 42 | + >{{ letter }}</button> |
| 43 | + } |
| 44 | + </div> |
| 45 | + |
| 46 | + <div class="results-info"> |
| 47 | + {{ resultCount }} contributor{{ resultCount !== 1 ? 's' : '' }} |
| 48 | + @if (activeLetter) { |
| 49 | + <span> starting with "{{ activeLetter }}"</span> |
| 50 | + } |
| 51 | + @if (searchQuery) { |
| 52 | + <span> matching "{{ searchQuery }}"</span> |
| 53 | + } |
| 54 | + </div> |
| 55 | + } |
| 56 | + |
| 57 | + @if (loading) { |
| 58 | + <div class="loading-state"> |
| 59 | + <div class="spinner"></div> |
| 60 | + <p>Loading contributors...</p> |
| 61 | + </div> |
| 62 | + } |
| 63 | + |
| 64 | + @if (error && !loading) { |
| 65 | + <div class="error-state"> |
| 66 | + <span class="material-symbols-rounded">error</span> |
| 67 | + <p>Unable to load data. Please try again later.</p> |
| 68 | + </div> |
| 69 | + } |
| 70 | + |
| 71 | + @if (!loading && !error) { |
| 72 | + @if (filteredContributors.length === 0) { |
| 73 | + <div class="empty-state"> |
| 74 | + <span class="material-symbols-rounded">search_off</span> |
| 75 | + <p>No contributors found.</p> |
| 76 | + </div> |
| 77 | + } @else { |
| 78 | + <div class="contributors-table-wrapper"> |
| 79 | + <table class="contributors-table"> |
| 80 | + <thead> |
| 81 | + <tr> |
| 82 | + <th class="col-name sortable" (click)="toggleSort('displayName')"> |
| 83 | + Name |
| 84 | + <span class="material-symbols-rounded sort-icon">{{ sortIcon('displayName') }}</span> |
| 85 | + </th> |
| 86 | + <th class="col-orcid">ORCID</th> |
| 87 | + <th class="col-num sortable" (click)="toggleSort('authoredPathways')"> |
| 88 | + Authored Pathways |
| 89 | + <span class="material-symbols-rounded sort-icon">{{ sortIcon('authoredPathways') }}</span> |
| 90 | + </th> |
| 91 | + <th class="col-num sortable" (click)="toggleSort('reviewedPathways')"> |
| 92 | + Reviewed Pathways |
| 93 | + <span class="material-symbols-rounded sort-icon">{{ sortIcon('reviewedPathways') }}</span> |
| 94 | + </th> |
| 95 | + <th class="col-num sortable" (click)="toggleSort('authoredReactions')"> |
| 96 | + Authored Reactions |
| 97 | + <span class="material-symbols-rounded sort-icon">{{ sortIcon('authoredReactions') }}</span> |
| 98 | + </th> |
| 99 | + <th class="col-num sortable" (click)="toggleSort('reviewedReactions')"> |
| 100 | + Reviewed Reactions |
| 101 | + <span class="material-symbols-rounded sort-icon">{{ sortIcon('reviewedReactions') }}</span> |
| 102 | + </th> |
| 103 | + </tr> |
| 104 | + </thead> |
| 105 | + <tbody> |
| 106 | + @for (c of pagedContributors; track c.person.dbId) { |
| 107 | + <tr> |
| 108 | + <td class="col-name"> |
| 109 | + <a [href]="personUrl(c.person.dbId)" class="person-link">{{ c.person.displayName }}</a> |
| 110 | + </td> |
| 111 | + <td class="col-orcid"> |
| 112 | + @if (c.person.orcidId) { |
| 113 | + <a class="orcid-link" [href]="orcidUrl(c.person.orcidId)" target="_blank" rel="noopener"> |
| 114 | + {{ c.person.orcidId }} |
| 115 | + </a> |
| 116 | + } |
| 117 | + </td> |
| 118 | + <td class="col-num">{{ c.authoredPathways }}</td> |
| 119 | + <td class="col-num">{{ c.reviewedPathways }}</td> |
| 120 | + <td class="col-num">{{ c.authoredReactions }}</td> |
| 121 | + <td class="col-num">{{ c.reviewedReactions }}</td> |
| 122 | + </tr> |
| 123 | + } |
| 124 | + </tbody> |
| 125 | + </table> |
| 126 | + </div> |
| 127 | + |
| 128 | + @if (maxPage > 1) { |
| 129 | + <div class="pagination"> |
| 130 | + <button class="page-btn" [disabled]="currentPage <= 1" (click)="prevPage()"> |
| 131 | + <span class="material-symbols-rounded">chevron_left</span> |
| 132 | + Previous |
| 133 | + </button> |
| 134 | + <span class="page-info">Page {{ currentPage }} of {{ maxPage }}</span> |
| 135 | + <button class="page-btn" [disabled]="currentPage >= maxPage" (click)="nextPage()"> |
| 136 | + Next |
| 137 | + <span class="material-symbols-rounded">chevron_right</span> |
| 138 | + </button> |
| 139 | + </div> |
| 140 | + } |
| 141 | + } |
| 142 | + } |
| 143 | + </article> |
| 144 | +</app-page-layout> |
0 commit comments