summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2023-09-26 12:59:10 -0400
committerSacha Chua <sacha@sachachua.com>2023-09-26 12:59:10 -0400
commit1e7f47df29053c2a197ee4a143f6ea198167b4fc (patch)
tree642f8daf5d39978ed0456b85327ed9338104b586
parent79a4998759f552f6fd2872f57860ff59cc9d6c07 (diff)
downloademacsconf-el-1e7f47df29053c2a197ee4a143f6ea198167b4fc.tar.xz
emacsconf-el-1e7f47df29053c2a197ee4a143f6ea198167b4fc.zip
Recognize multiple time constraints
-rw-r--r--emacsconf-publish.el87
-rw-r--r--emacsconf-schedule.el16
2 files changed, 55 insertions, 48 deletions
diff --git a/emacsconf-publish.el b/emacsconf-publish.el
index 3657012..a8f2495 100644
--- a/emacsconf-publish.el
+++ b/emacsconf-publish.el
@@ -492,49 +492,50 @@ resources."
(timestamp (org-timestamp-from-string (plist-get o :scheduled))))
(emacsconf-replace-plist-in-string
(append o
- (list :format
- (concat (or (plist-get o :video-time)
- (plist-get o :time))
- "-min talk"
- (if (plist-get o :q-and-a)
- (format " followed by %s Q&A%s"
- (plist-get o :q-and-a)
- (if (eq emacsconf-publishing-phase 'conference)
- (format " (%s)"
- (if (string-match "live" (plist-get o :q-and-a))
- (if (eq 'after (emacsconf-bbb-status o))
- "done"
- (format "<https://emacsconf.org/current/%s/room>" (plist-get o :slug)))
- (emacsconf-publish-webchat-link o)))
- ""))
- ""))
- :pad-info
- (if emacsconf-publish-include-pads
- (format "Etherpad: <https://pad.emacsconf.org/%s-%s> \n" emacsconf-year (plist-get o :slug))
- "")
- :irc-info
- (format "Discuss on IRC: [#%s](%s) \n" (plist-get o :channel)
- (plist-get o :webchat-url))
- :status-info
- (if (member emacsconf-publishing-phase '(cfp program schedule conference)) (format "Status: %s \n" (plist-get o :status-label)) "")
- :schedule-info
- (if (and (member emacsconf-publishing-phase '(schedule conference))
- (not (emacsconf-talk-all-done-p o))
- (not (string= (plist-get o :status) "CANCELLED")))
- (let ((start (org-timestamp-to-time (org-timestamp-split-range timestamp)))
- (end (org-timestamp-to-time (org-timestamp-split-range timestamp t))))
- (format
- "<div>Times in different timezones:</div><div class=\"times\" start=\"%s\" end=\"%s\"><div class=\"conf-time\">%s</div><div class=\"others\"><div>which is the same as:</div>%s</div></div><div><a href=\"/%s/watch/%s/\">Find out how to watch and participate</a></div>"
- (format-time-string "%Y-%m-%dT%H:%M:%SZ" start t)
- (format-time-string "%Y-%m-%dT%H:%M:%SZ" end t)
- (emacsconf-timezone-string o emacsconf-timezone)
- (string-join (emacsconf-timezone-strings
- o
- (seq-remove (lambda (zone) (string= emacsconf-timezone zone))
- emacsconf-timezones)) "<br />")
- emacsconf-year
- (plist-get (emacsconf-get-track (plist-get o :track)) :id)))
- "")))
+ (list
+ :format
+ (concat (or (plist-get o :video-time)
+ (plist-get o :time))
+ "-min talk"
+ (if (plist-get o :q-and-a)
+ (format " followed by %s Q&A%s"
+ (plist-get o :q-and-a)
+ (if (eq emacsconf-publishing-phase 'conference)
+ (format " (%s)"
+ (if (string-match "live" (plist-get o :q-and-a))
+ (if (eq 'after (emacsconf-bbb-status o))
+ "done"
+ (format "<https://emacsconf.org/current/%s/room>" (plist-get o :slug)))
+ (emacsconf-publish-webchat-link o)))
+ ""))
+ ""))
+ :pad-info
+ (if emacsconf-publish-include-pads
+ (format "Etherpad: <https://pad.emacsconf.org/%s-%s> \n" emacsconf-year (plist-get o :slug))
+ "")
+ :irc-info
+ (format "Discuss on IRC: [#%s](%s) \n" (plist-get o :channel)
+ (plist-get o :webchat-url))
+ :status-info
+ (if (member emacsconf-publishing-phase '(cfp program schedule conference)) (format "Status: %s \n" (plist-get o :status-label)) "")
+ :schedule-info
+ (if (and (member emacsconf-publishing-phase '(schedule conference))
+ (not (emacsconf-talk-all-done-p o))
+ (not (string= (plist-get o :status) "CANCELLED")))
+ (let ((start (org-timestamp-to-time (org-timestamp-split-range timestamp)))
+ (end (org-timestamp-to-time (org-timestamp-split-range timestamp t))))
+ (format
+ "<div>Times in different timezones:</div><div class=\"times\" start=\"%s\" end=\"%s\"><div class=\"conf-time\">%s</div><div class=\"others\"><div>which is the same as:</div>%s</div></div><div><a href=\"/%s/watch/%s/\">Find out how to watch and participate</a></div>"
+ (format-time-string "%Y-%m-%dT%H:%M:%SZ" start t)
+ (format-time-string "%Y-%m-%dT%H:%M:%SZ" end t)
+ (emacsconf-timezone-string o emacsconf-timezone)
+ (string-join (emacsconf-timezone-strings
+ o
+ (seq-remove (lambda (zone) (string= emacsconf-timezone zone))
+ emacsconf-timezones)) "<br />")
+ emacsconf-year
+ (plist-get (emacsconf-get-track (plist-get o :track)) :id)))
+ "")))
(concat
"[[!toc ]]
Format: ${format}
diff --git a/emacsconf-schedule.el b/emacsconf-schedule.el
index 644d818..885cada 100644
--- a/emacsconf-schedule.el
+++ b/emacsconf-schedule.el
@@ -642,11 +642,17 @@ Both start and end time are tested."
(defun emacsconf-schedule-get-time-constraint (o)
(unless (string-match "after the event" (or (plist-get o :q-and-a) ""))
(let ((avail (or (plist-get o :availability) ""))
- hours)
- (when (string-match "\\([<>]\\)=? *\\([0-9]+:[0-9]+\\) *EST" avail)
- (if (string= (match-string 1 avail) ">")
- (list (match-string 2 avail) nil)
- (list nil (match-string 2 avail)))))))
+ hours
+ start
+ (pos 0)
+ (result (list nil nil)))
+ (while (string-match "\\([<>]\\)=? *\\([0-9]+:[0-9]+\\) *EST" avail pos)
+ (setf (elt result (if (string= (match-string 1 avail) ">")
+ 0
+ 1))
+ (match-string 2 avail))
+ (setq pos (match-end 0)))
+ result)))
(defun emacsconf-schedule-validate-all-talks-present (sched &optional list)
(let* ((sched-slugs (mapcar (lambda (o) (plist-get o :slug))