Skip to content

Commit cac8671

Browse files
committed
update officers page and add committee heads
1 parent 9edc834 commit cac8671

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

ocfweb/docs/templates/docs/officers.html

+20
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ <h4>
8080
the OCF lab and other services. They are elected by the Board of
8181
Directors at the end of each semester.
8282
</p>
83+
{% if current_term.heads|length > 0 %}
84+
<h3>
85+
Committee Heads
86+
</h3>
87+
{% for committee in current_term.heads %}
88+
<h4>{{ committee.name }} Committee Heads</h4>
89+
<p>
90+
{% for head in committee.heads %}
91+
{% if head.end is None %}
92+
<strong>{{ head.name }}</strong> &lt;{{ head.uid }}&gt;
93+
{% if head.acting %} (acting) {% endif %}<br>
94+
{% endif %}
95+
{% endfor %}
96+
</p>
97+
{% endfor %}
98+
<p>
99+
Committee heads guide the work of the various committees that
100+
function within the OCF.
101+
</p>
102+
{% endif %}
83103
<h2>Previous officers</h2>
84104
<p>
85105
Terms began and ended during the ninth week of the semester until Fall

ocfweb/docs/views/officers.py

+28-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
from ocfweb import caching
1717

18-
_Term = namedtuple('_Term', ['name', 'gms', 'sms', 'dgms', 'dsms'])
18+
_Term = namedtuple('_Term', ['name', 'gms', 'sms', 'dgms', 'dsms', 'heads'])
19+
Committee = namedtuple('Committee', ['name', 'heads'])
1920

2021

2122
def Term(
@@ -24,12 +25,17 @@ def Term(
2425
sms: List[Any],
2526
dgms: Optional[List[Any]] = None,
2627
dsms: Optional[List[Any]] = None,
28+
heads: Optional[List[Tuple[str, List[Any]]]] = None,
2729
) -> _Term:
2830
gms = list(map(Officer.from_uid_or_info, gms))
2931
sms = list(map(Officer.from_uid_or_info, sms))
3032
dgms = list(map(Officer.from_uid_or_info, dgms or []))
3133
dsms = list(map(Officer.from_uid_or_info, dsms or []))
32-
return _Term(name, gms, sms, dgms, dsms)
34+
heads = [
35+
Committee(committee[0], list(map(Officer.from_uid_or_info, committee[1])))
36+
for committee in heads or []
37+
]
38+
return _Term(name, gms, sms, dgms, dsms, heads)
3339

3440

3541
class Officer(namedtuple('Officer', ['uid', 'name', 'start', 'end', 'acting'])):
@@ -237,7 +243,25 @@ def _bod_terms() -> List[Any]:
237243
dgms=['asai'], dsms=['ethanhs', 'cooperc'],
238244
),
239245
Term(
240-
'Fall 2019', gms=['cooperc', 'php'], sms=['ethanhs', 'fydai'],
246+
'Fall 2019',
247+
gms=['cooperc', 'php'],
248+
sms=[
249+
('ethanhs', date(2019, 5, 18), date(2018, 11, 18)),
250+
'fydai',
251+
],
252+
),
253+
Term(
254+
'Spring 2020',
255+
gms=['dphan', 'bernardzhao'],
256+
sms=['cooperc', 'jaw'],
257+
heads=[
258+
('University Affairs', ['dphan', 'bernardzhao']),
259+
('Internal', ['php', 'kmo']),
260+
('Industry and Alumni Relations', ['asai', 'rachy']),
261+
('Finance', ['ncberberi', 'nint']),
262+
('Communication', ['rachy']),
263+
('DeCal', ['exiang', 'bencuan', 'kmo']),
264+
],
241265
),
242266
]
243267

@@ -250,6 +274,6 @@ def officers(doc: Any, request: HttpRequest) -> HttpResponse:
250274
{
251275
'title': doc.title,
252276
'current_term': terms[-1],
253-
'previous_terms': reversed(terms[:-1]),
277+
'previous_terms': terms[-2::-1],
254278
},
255279
)

0 commit comments

Comments
 (0)