[Revived old web frontend code clinton@unknownlamer.org**20080103171546 * Ported from ucw_dev to ucw_ajax * Rewrote render methods to generate cleaner html with components marked with css-classes * Fixed all control flow issues * Wrote basic navigator component The code still needs cleaning up and merging of some repetetive patterns. ] { hunk ./src/web.lisp 5 -(defclass golf-application (modular-application - cookie-session-application-module - lame-web:lame-application-module) +(defclass golf-application (standard-application + cookie-session-application-mixin) hunk ./src/web.lisp 9 +;; Rendering Helpers + +(defmacro render-controls (&body controls) + `(<:ul :class "golf-controls" + ,@(mapcar (lambda (control) + `(<:li :class "control" + (bytes (stream) - (let ((byte-buffer (make-array - (file-length stream) - :element-type 'unsigned-byte))) - (read-sequence byte-buffer stream) - byte-buffer)) hunk ./src/web.lisp 117 - (with-slots (show date audio-file transcript) - editor - (setf (show-date show) (value date)) - ; (break "a-f: ~S, v: ~S" audio-file (value audio-file)) - (if (value audio-file) - (set-audio-file show (cdr (assoc "Content-Type" - (mime-part-headers (value audio-file)) - :test #'string=)) - (mime-part-body (value audio-file)))) - (setf (transcript show) (value transcript))) + (let ((show (or (radio-show editor) (make-instance 'radio-show)))) + (with-assoc (title date audio-file transcript) + (form-fields editor) + (setf (show-date show) (value date)) + (setf (show-title show) (value title)) + ;; (break "a-f: ~S, v: ~S" audio-file (value audio-file)) + (if (value audio-file) + (set-audio-file show (cdr (assoc "Content-Type" + (mime-part-headers (value audio-file)) + :test #'string=)) + (mime-part-body (value audio-file)))) + (setf (transcript show) (value transcript)))) hunk ./src/web.lisp 131 -(defmethod render ((editor show-editor)) - (with-slots (date audio-file transcript) - editor - (render date) - (render audio-file) - (render transcript) - (