|
16 | 16 | <h2 class="category-header">{{ category }}</h2> |
17 | 17 |
|
18 | 18 | {% assign currentPositionCategory = people_by_category | where: "name" , category | first %} |
19 | | - |
20 | | - <div class="category-body"> |
21 | 19 |
|
22 | | - {% for person in currentPositionCategory.items %} |
23 | | - <div class="person-container" data-person="{{ person.name }}"> |
| 20 | + {% assign items_with_start_date = currentPositionCategory.items | where_exp: "item", "item.start_date" %} |
| 21 | + {% assign items_without_start_date = currentPositionCategory.items | where_exp: "item", "item.start_date == nil" %} |
| 22 | + |
| 23 | + {% assign max_index = 10 %} |
| 24 | + |
| 25 | + {% comment %} Sort the items by start date {% endcomment %} |
| 26 | + {% assign sorted_category_items = items_with_start_date | sort: "start_date" | reverse %} |
| 27 | + |
| 28 | + {% comment %} Add class for alumni members {% endcomment %} |
| 29 | + <div class="category-body{% if category contains 'Alumni' %} alumni{% endif %}"> |
| 30 | + {% for person in sorted_category_items %} |
| 31 | + <div class="person-container" data-person="{{ person.name }}"> |
| 32 | + |
| 33 | + {% comment %} Active Member person card {% endcomment %} |
| 34 | + {% if person.status == "Active Member" and person.image %} |
| 35 | + <div class="person-card"> |
| 36 | + <img src="{{ person.image }}" alt="{{ person.name }}" /> |
| 37 | + <div class="person-information"> |
| 38 | + <p class="title">{{ person.person_title }}</p> |
| 39 | + <p class="subtitle">{{ person.subtitle }}</p> |
| 40 | + {% if person.additional_links %} |
| 41 | + <div class="additional-links-container"> |
| 42 | + {% if person.additional_links.github %} |
| 43 | + <a class="link github" href="{{ person.additional_links.github }}" target="_blank"> |
| 44 | + <i class="fab fa-github"></i> |
| 45 | + </a> |
| 46 | + {% endif %} |
| 47 | + {% if person.additional_links.linkedin %} |
| 48 | + <a class="link linkedin" href="{{ person.additional_links.linkedin }}" target="_blank"> |
| 49 | + <i class="fab fa-linkedin"></i> |
| 50 | + </a> |
| 51 | + {% endif %} |
| 52 | + {% if person.additional_links.organization %} |
| 53 | + <a class="link organization" href="{{ person.additional_links.organization }}" target="_blank"> |
| 54 | + <i class="fas fa-users"></i> |
| 55 | + </a> |
| 56 | + {% endif %} |
| 57 | + </div> |
| 58 | + {% endif %} |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + {% comment %} Alumni person card {% endcomment %} |
| 62 | + {% elsif person.status == "Alumni" %} |
24 | 63 |
|
25 | | - {% assign academic_subtitle = "" %} |
| 64 | + {% assign academic_subtitle = "" %} |
26 | 65 |
|
27 | | - <!-- Isolate the PhD part of the professional_title --> |
28 | | - {% assign split_professional_title = person.professional_title | split: "," %} |
29 | | - |
30 | | - {% for i in (0..max_index) %} |
31 | | - {% assign current = split_professional_title[i] | strip %} |
| 66 | + <!-- Isolate the PhD part of the professional_title --> |
| 67 | + {% assign split_professional_title = person.professional_title | split: "," %} |
| 68 | + |
| 69 | + {% for i in (0..max_index) %} |
| 70 | + {% assign current = split_professional_title[i] | strip %} |
32 | 71 |
|
33 | | - {% if current contains "PhD" %} |
34 | | - {% assign next_index = i | plus: 1 %} |
35 | | - {% if next_index <= split_professional_title.size %} |
36 | | - {% assign academic_subtitle = current | append: split_professional_title[next_index] %} |
| 72 | + {% if current contains "PhD" %} |
| 73 | + {% assign next_index = i | plus: 1 %} |
| 74 | + {% if next_index <= split_professional_title.size %} |
| 75 | + {% assign academic_subtitle = current | append: split_professional_title[next_index] %} |
| 76 | + {% endif %} |
37 | 77 | {% endif %} |
38 | | - {% endif %} |
39 | | - {% endfor %} |
| 78 | + {% endfor %} |
40 | 79 |
|
41 | | - {% comment %} Use professional_title if academic_subtitle is not available {% endcomment %} |
42 | | - {% if academic_subtitle == "" %} |
43 | | - {% if person.professional_title != person.subtitle %} |
44 | | - {% assign academic_subtitle = person.professional_title %} |
| 80 | + {% comment %} Use professional_title if academic_subtitle is not available {% endcomment %} |
| 81 | + {% if academic_subtitle == "" %} |
| 82 | + {% if person.professional_title != person.subtitle %} |
| 83 | + {% assign academic_subtitle = person.professional_title %} |
| 84 | + {% endif %} |
45 | 85 | {% endif %} |
| 86 | + |
| 87 | + <div class="person-card"> |
| 88 | + <div class="person-information"> |
| 89 | + <p class="title">{{ person.person_title }} |
| 90 | + <span class="dates"> |
| 91 | + {% if person.start_date and person.end_date %} ({{ person.start_date | date: '%Y' }}-{{ person.end_date | date: '%Y' }}) {% endif %} |
| 92 | + </span> |
| 93 | + {% comment %} Form a subtitle line for alumni {% endcomment %} |
| 94 | + <span class="professional_title"> |
| 95 | + {% comment %} Use academic_title if available, otherwise try calculated title {% endcomment %} |
| 96 | + {% if person.academic_title %} |
| 97 | + {{ person.academic_title }} |
| 98 | + {% elsif academic_subtitle != "" %} |
| 99 | + {{ academic_subtitle }} |
| 100 | + {% else %} |
| 101 | + {{ person.subtitle }} |
| 102 | + {% endif %} |
| 103 | + |
| 104 | + {% comment %} Additional line for current_position if provided {% endcomment %} |
| 105 | + {% if person.current_position %} |
| 106 | + → |
| 107 | + <span class="current_position">{{ person.current_position }}</span> |
| 108 | + {% endif %} |
| 109 | + </span> |
| 110 | + </p> |
| 111 | + </div> |
| 112 | + </div> |
46 | 113 | {% endif %} |
| 114 | + </div> |
| 115 | + {% endfor %} |
| 116 | + {% for person in items_without_start_date %} |
| 117 | + <div class="person-container" data-person="{{ person.name }}"> |
47 | 118 |
|
48 | | - {% if person.image %} |
49 | | - <div class="person-card"> |
50 | | - <img src="{{ person.image }}" alt="{{ person.name }}" /> |
51 | | - <div class="person-information"> |
52 | | - <p class="title">{{ person.person_title }}</p> |
53 | | - |
54 | | - {% comment %} Use academic_title if available, otherwise try calculated title {% endcomment %} |
55 | | - {% if person.academic_title %} |
56 | | - <p class="professional_title">{{ person.academic_title }}</p> |
57 | | - {% elsif academic_subtitle != "" %} |
58 | | - <p class="professional_title">{{ academic_subtitle }}</p> |
59 | | - {% else %} |
60 | | - <p class="professional_title">{{ person.subtitle }}</p> |
61 | | - {% endif %} |
| 119 | + {% comment %} Active Member person card {% endcomment %} |
| 120 | + {% if person.status == "Active Member" and person.image %} |
| 121 | + <div class="person-card"> |
| 122 | + <img src="{{ person.image }}" alt="{{ person.name }}" /> |
| 123 | + <div class="person-information"> |
| 124 | + <p class="title">{{ person.person_title }}</p> |
| 125 | + <p class="subtitle">{{ person.subtitle }}</p> |
| 126 | + {% if person.additional_links %} |
| 127 | + <div class="additional-links-container"> |
| 128 | + {% if person.additional_links.github %} |
| 129 | + <a class="link github" href="{{ person.additional_links.github }}" target="_blank"> |
| 130 | + <i class="fab fa-github"></i> |
| 131 | + </a> |
| 132 | + {% endif %} |
| 133 | + {% if person.additional_links.linkedin %} |
| 134 | + <a class="link linkedin" href="{{ person.additional_links.linkedin }}" target="_blank"> |
| 135 | + <i class="fab fa-linkedin"></i> |
| 136 | + </a> |
| 137 | + {% endif %} |
| 138 | + {% if person.additional_links.organization %} |
| 139 | + <a class="link organization" href="{{ person.additional_links.organization }}" target="_blank"> |
| 140 | + <i class="fas fa-users"></i> |
| 141 | + </a> |
| 142 | + {% endif %} |
| 143 | + </div> |
| 144 | + {% endif %} |
| 145 | + </div> |
| 146 | + </div> |
| 147 | + {% comment %} Alumni person card {% endcomment %} |
| 148 | + {% elsif person.status == "Alumni" %} |
| 149 | + |
| 150 | + {% assign academic_subtitle = "" %} |
| 151 | + |
| 152 | + <!-- Isolate the PhD part of the professional_title --> |
| 153 | + {% assign split_professional_title = person.professional_title | split: "," %} |
| 154 | + |
| 155 | + {% for i in (0..max_index) %} |
| 156 | + {% assign current = split_professional_title[i] | strip %} |
62 | 157 |
|
63 | | - {% comment %} Additional line for current_position if provided {% endcomment %} |
64 | | - {% if person.status == "Alumni" and person.current_position %} |
65 | | - <p class="current_position">{{ person.current_position }}</p> |
| 158 | + {% if current contains "PhD" %} |
| 159 | + {% assign next_index = i | plus: 1 %} |
| 160 | + {% if next_index <= split_professional_title.size %} |
| 161 | + {% assign academic_subtitle = current | append: split_professional_title[next_index] %} |
| 162 | + {% endif %} |
66 | 163 | {% endif %} |
| 164 | + {% endfor %} |
67 | 165 |
|
68 | | - {% if person.additional_links %} |
69 | | - <div class="additional-links-container"> |
70 | | - {% if person.additional_links.github %} |
71 | | - <a class="link github" href="{{ person.additional_links.github }}" target="_blank"> |
72 | | - <i class="fab fa-github"></i> |
73 | | - </a> |
74 | | - {% endif %} |
75 | | - {% if person.additional_links.linkedin %} |
76 | | - <a class="link linkedin" href="{{ person.additional_links.linkedin }}" target="_blank"> |
77 | | - <i class="fab fa-linkedin"></i> |
78 | | - </a> |
79 | | - {% endif %} |
80 | | - {% if person.additional_links.organization %} |
81 | | - <a class="link organization" href="{{ person.additional_links.organization }}" target="_blank"> |
82 | | - <i class="fas fa-users"></i> |
83 | | - </a> |
84 | | - {% endif %} |
85 | | - </div> |
| 166 | + {% comment %} Use professional_title if academic_subtitle is not available {% endcomment %} |
| 167 | + {% if academic_subtitle == "" %} |
| 168 | + {% if person.professional_title != person.subtitle %} |
| 169 | + {% assign academic_subtitle = person.professional_title %} |
86 | 170 | {% endif %} |
| 171 | + {% endif %} |
| 172 | + |
| 173 | + <div class="person-card"> |
| 174 | + <div class="person-information"> |
| 175 | + <p class="title">{{ person.person_title }} |
| 176 | + <span class="dates"> |
| 177 | + {% if person.start_date and person.end_date %} ({{ person.start_date | date: '%Y' }}-{{ person.end_date | date: '%Y' }}) {% endif %} |
| 178 | + </span> |
| 179 | + {% comment %} Form a subtitle line for alumni {% endcomment %} |
| 180 | + <span class="professional_title"> |
| 181 | + {% comment %} Use academic_title if available, otherwise try calculated title {% endcomment %} |
| 182 | + {% if person.academic_title %} |
| 183 | + {{ person.academic_title }} |
| 184 | + {% elsif academic_subtitle != "" %} |
| 185 | + {{ academic_subtitle }} |
| 186 | + {% else %} |
| 187 | + {{ person.subtitle }} |
| 188 | + {% endif %} |
| 189 | + |
| 190 | + {% comment %} Additional line for current_position if provided {% endcomment %} |
| 191 | + {% if person.current_position %} |
| 192 | + → |
| 193 | + <span class="current_position">{{ person.current_position }}</span> |
| 194 | + {% endif %} |
| 195 | + </span> |
| 196 | + </p> |
| 197 | + </div> |
87 | 198 | </div> |
88 | | - </div> |
89 | 199 | {% endif %} |
90 | | - </div> |
| 200 | + </div> |
91 | 201 | {% endfor %} |
92 | 202 | </div> |
93 | 203 | </div> |
|
0 commit comments