[Move pane switch link rendering into TAL clinton@unknownlamer.org**20090428195619 Ignore-this: 47df3a90c28755b74af8b5b517e94637 ] hunk ./src/packages.lisp 33 - (:import-from :arnesi :when-bind) + (:import-from :arnesi :if-bind :when-bind :with-call/cc) hunk ./src/web-frontend.lisp 22 -(defvar *switch-key* nil) +(defclass bee-switch-link-action (standard-action) + ((target-component :initarg :target :accessor target-component :initform nil)) + (:metaclass c2mop:funcallable-standard-class)) hunk ./src/web-frontend.lisp 26 -(defmethod update-url ((c bee-frontend-pane) uri) - (when *switch-key* - (append-path-to-uri uri (format nil "pages/~(~A~)" *switch-key*))) - uri) +(defmethod compute-url ((action bee-switch-link-action) (pane bee-frontend-pane)) + (let ((url (call-next-method))) + (when-bind target (target-component action) + (append-path-to-uri url (format nil "pages/~(~A~)" (car target)))) + url)) hunk ./src/web-frontend.lisp 32 -(defun render-frontend-pane-switch-link (pane component selectedp) - (let ((*switch-key* (car component))) - ((render-frontend-pane-switch-link $component $value $selected) + + ${(symbol-name (car $value))} +