diff --git a/miniconf/load_site_data.py b/miniconf/load_site_data.py index 40a91ee..a3c435b 100644 --- a/miniconf/load_site_data.py +++ b/miniconf/load_site_data.py @@ -650,6 +650,23 @@ def parse_session_time(session_time_str: str) -> datetime: def build_tutorials(raw_tutorials: List[Dict[str, Any]]) -> List[Tutorial]: + def build_tutorial_blocks(t: Dict[str, Any]) -> List[SessionInfo]: + blocks = compute_schedule_blocks(t["sessions"]) + result = [] + for i, block in enumerate(blocks): + min_start = min([t["start_time"] for t in block]) + max_end = max([t["end_time"] for t in block]) + + result.append( + SessionInfo( + session_name=f"T-Live Session {i+1}", + start_time=min_start, + end_time=max_end, + link="", + ) + ) + return result + return [ Tutorial( id=item["UID"], @@ -666,11 +683,13 @@ def build_tutorials(raw_tutorials: List[Dict[str, Any]]) -> List[Tutorial]: session_name=session.get("name"), start_time=session.get("start_time"), end_time=session.get("end_time"), + hosts=session.get("hosts", ""), livestream_id=session.get("livestream_id"), zoom_link=session.get("zoom_link"), ) for session in item.get("sessions") ], + blocks=build_tutorial_blocks(item), virtual_format_description=item["info"], ) for item in raw_tutorials diff --git a/miniconf/site_data.py b/miniconf/site_data.py index 8eed0d1..7887f42 100644 --- a/miniconf/site_data.py +++ b/miniconf/site_data.py @@ -23,12 +23,12 @@ def time_string(self) -> str: @property def start_time_string(self) -> str: start_time = self.start_time.astimezone(pytz.utc) - return start_time.strftime("%Y-%m-%dT%H:%M:%S UTC") + return start_time.strftime("%Y-%m-%dT%H:%M:%S") @property def end_time_string(self) -> str: end_time = self.end_time.astimezone(pytz.utc) - return end_time.strftime("%Y-%m-%dT%H:%M:%S UTC") + return end_time.strftime("%Y-%m-%dT%H:%M:%S") @property def session(self) -> str: @@ -44,11 +44,14 @@ def session(self) -> str: if self.session_name.startswith("S-"): # social event sessions return f"{self.session_name[2:]}: {start_date}" + if self.session_name.startswith("T-"): + # workshop sessions + return f"{self.session_name[2:]}: {start_date}" if self.session_name.startswith("W-"): # workshop sessions return f"{self.session_name[2:]}: {start_date}" if self.session_name.endswith("z") or self.session_name.endswith("g"): - # workshop sessions + # paper sessions return f"{self.session_name[:-1]}: {start_date}" return f"Session {self.session_name}: {start_date}" @@ -156,28 +159,38 @@ class TutorialSessionInfo: session_name: str start_time: datetime end_time: datetime + hosts: str livestream_id: str zoom_link: str @property def time_string(self) -> str: - return "({}-{} GMT)".format( - self.start_time.strftime("%H:%M"), self.end_time.strftime("%H:%M") - ) + start = self.start_time.astimezone(pytz.utc) + end = self.end_time.astimezone(pytz.utc) + return "({}-{} UTC)".format(start.strftime("%H:%M"), end.strftime("%H:%M")) @property def start_time_string(self) -> str: - return self.start_time.strftime("%Y-%m-%dT%H:%M:%S") + start_time = self.start_time.astimezone(pytz.utc) + return start_time.strftime("%Y-%m-%dT%H:%M:%S") @property def end_time_string(self) -> str: - return self.end_time.strftime("%Y-%m-%dT%H:%M:%S") + end_time = self.end_time.astimezone(pytz.utc) + return end_time.strftime("%Y-%m-%dT%H:%M:%S") @property def session(self) -> str: - start_date = f'{self.start_time.strftime("%b")} {self.start_time.day}' + start = self.start_time.astimezone(pytz.utc) + start_date = f'{start.strftime("%b")} {start.day}' return f"{self.session_name}: {start_date}" + @property + def day(self) -> str: + start = self.start_time.astimezone(pytz.utc) + start_date = f'{start.strftime("%b")} {start.day}' + return start_date + @dataclass(frozen=True) class Tutorial: @@ -191,6 +204,7 @@ class Tutorial: prerecorded: Optional[str] rocketchat_channel: str sessions: List[TutorialSessionInfo] + blocks: List[SessionInfo] virtual_format_description: str diff --git a/sitedata/tutorials.yml b/sitedata/tutorials.yml index 1a3f84a..164b660 100644 --- a/sitedata/tutorials.yml +++ b/sitedata/tutorials.yml @@ -24,22 +24,27 @@ - name: Part 1 start_time: 2020-11-19 15:00:00+00:00 end_time: 2020-11-19 16:30:00+00:00 + hosts: Eric Wallace, Matt Gardner and Sameer Singh livestream_id: 42 - name: QA 1 start_time: 2020-11-19 16:30:00+00:00 end_time: 2020-11-19 17:00:00+00:00 + hosts: livestream_id: 42 - name: BREAK start_time: 2020-11-19 17:00:00+00:00 end_time: 2020-11-19 17:30:00+00:00 + hosts: livestream_id: 42 - name: Part 2 start_time: 2020-11-19 17:30:00+00:00 end_time: 2020-11-19 19:00:00+00:00 + hosts: livestream_id: 42 - name: QA 2 start_time: 2020-11-19 19:00:00+00:00 end_time: 2020-11-19 19:30:00+00:00 + hosts: livestream_id: 42 website: https://www.ericswallace.com/interpretability - UID: T2 @@ -60,10 +65,12 @@ - name: Q&A start_time: 2020-11-19 09:00:00+00:00 end_time: 2020-11-19 10:00:00+00:00 + hosts: Preslav Nakov and Giovanni Da San Martino livestream_id: 42 - name: Q&A start_time: 2020-11-19 16:00:00+00:00 end_time: 2020-11-19 17:00:00+00:00 + hosts: livestream_id: 42 website: https://propaganda.qcri.org/emnlp20-tutorial - UID: T3 @@ -89,10 +96,13 @@ - name: Q&A start_time: 2020-11-19 17:00:00+00:00 end_time: 2020-11-19 18:00:00+00:00 + hosts: Gabriel Ilharco, Cesar Ilharco, Iulia Turc, Tim Dettmers, Felipe Ferreira, + Kenton Lee livestream_id: 42 - name: Q&A start_time: 2020-11-20 00:00:00+00:00 end_time: 2020-11-20 01:00:00+00:00 + hosts: livestream_id: 42 - UID: T4 title: Machine Reasoning for Knowledgeable, Explainable and Inferable Models @@ -119,10 +129,12 @@ - name: Q&A start_time: 2020-11-19 09:00:00+00:00 end_time: 2020-11-19 10:00:00+00:00 + hosts: Nan Duan, Duyu Tang and Ming Zhou livestream_id: 42 - name: Q&A start_time: 2020-11-20 01:00:00+00:00 end_time: 2020-11-20 02:00:00+00:00 + hosts: livestream_id: 42 - UID: T5 title: Representation, Learning and Reasoning on Spatial Language for Down-stream @@ -140,10 +152,12 @@ - name: Q&A start_time: 2020-11-20 17:00:00+00:00 end_time: 2020-11-20 18:00:00+00:00 + hosts: Parisa Kordjamshidi, James Pustejovsky and Marie-Francine Moens livestream_id: 42 - name: Q&A start_time: 2020-11-21 00:00:00+00:00 end_time: 2020-11-21 01:00:00+00:00 + hosts: livestream_id: 42 website: ' https://spatial-language-tutorial.github.io ' - UID: T6 @@ -162,10 +176,12 @@ - name: Q&A start_time: 2020-11-20 18:00:00+00:00 end_time: 2020-11-20 19:00:00+00:00 + hosts: Liang Huang, Colin Cherry, Mingbo Ma, Naveen Arivazhagan and Zhongjun He livestream_id: 42 - name: Q&A start_time: 2020-11-21 01:00:00+00:00 end_time: 2020-11-21 02:00:00+00:00 + hosts: livestream_id: 42 - UID: T7 title: The Amazing World of Neural Language Generation @@ -193,8 +209,10 @@ - name: Q&A start_time: 2020-11-20 19:00:00+00:00 end_time: 2020-11-20 20:00:00+00:00 + hosts: Yangfeng Ji, Antoine Bosselut, Thomas Wolf and Asli Celikyilmaz livestream_id: 42 - name: Q&A start_time: 2020-11-21 01:00:00+00:00 end_time: 2020-11-21 02:00:00+00:00 + hosts: livestream_id: 42 diff --git a/static/js/time-extend.js b/static/js/time-extend.js index fe98d1d..63645ad 100644 --- a/static/js/time-extend.js +++ b/static/js/time-extend.js @@ -6,8 +6,8 @@ add_local_tz = (selector) => { const t = $(this).text(); const res = regex_time.exec(t); if (res) { - const start_time = moment.utc(`2020-07-05 ${res[1]}`); - const end_time = moment.utc(`2020-07-05 ${res[2]}`); + const start_time = moment.utc(`2020-10-16 ${res[1]}`); + const end_time = moment.utc(`2020-10-20 ${res[2]}`); const local_start = start_time.tz(guess_tz); const local_start_and_tz = start_time.format("HH:mm"); const local_end = end_time.tz(guess_tz); @@ -33,7 +33,7 @@ add_local_tz = (selector) => { start_dd_str = `(${start_dd}d)`; } $(this).text( - `(${res[1]}-${res[2]} ${res[3]} / ${local_start_and_tz}${start_dd_str}-${local_end_and_tz}${end_dd_str})` + `${res[1]}-${res[2]} ${res[3]} / ${local_start_and_tz}${start_dd_str}-${local_end_and_tz}${end_dd_str}` ); } }); diff --git a/templates/components.html b/templates/components.html index 0368b6a..1d68bb8 100644 --- a/templates/components.html +++ b/templates/components.html @@ -321,10 +321,9 @@
{{tutorial.abstract|safe}}
-Time | +Event | +Hosts | +
---|---|---|
+ {{event.day}}, {{event.time_string}} + | +{{event.session_name}} | +{{event.hosts}} | +