[Move background rendering into bee-frontend-pane clinton@unknownlamer.org**20090409200842 Ignore-this: db81cb54154d4dc72a174a0a09c09793 * Remove bee-stylable-page * Use symbols in beesknees.web package instead of keywords for page names in the database ] addfile ./misc/page-style-conversion.lisp hunk ./misc/page-style-conversion.lisp 1 +(defun convert-page-styles () + (let ((keyword-package (find-package :keyword))) + (mapcar (lambda (page) + (when (eq (symbol-package (beesknees.web::page-name page)) + keyword-package) + (setf (beesknees.web::page-name page) + (intern (symbol-name (beesknees.web::page-name page)) + :beesknees.web)))) + (elephant:get-instances-by-class 'beesknees.web::bee-page-style)))) hunk ./src/frontend-weblog.lisp 26 -(defcomponent bee-paged-blog (bee-stylable-page - golgonooza:query-paged-view-mixin bee-blog) +(defcomponent bee-paged-blog (golgonooza:query-paged-view-mixin bee-blog) hunk ./src/web-frontend.lisp 3 -(defclass bee-stylable-page () - ((name :initarg :name :accessor page-name) - (%style :initform nil))) - -(defmethod initialize-instance :after ((p bee-stylable-page) - &key name &allow-other-keys) - (setf (slot-value p '%style) (get-instance-by-value 'bee-page-style - 'name name))) - -(defmethod render :before ((page bee-stylable-page)) - (with-slots (%style) page - (<:style - (<:as-is (format nil - "body { background: white url(\"~A\") no-repeat fixed 50% 50%; }" - (format nil "/static/img/backgrounds/~A" - (arnesi:escape-as-uri (page-background %style)))))))) - -(defcomponent bee-frontend-page (bee-page-component bee-stylable-page) +(defcomponent bee-frontend-page (bee-page-component) hunk ./src/web-frontend.lisp 6 -(defcomponent bee-home (bee-widget composite-container bee-stylable-page) +(defcomponent bee-home (bee-widget composite-container) hunk ./src/web-frontend.lisp 12 -(defcomponent bee-videos (bee-widget bee-stylable-page) +(defcomponent bee-videos (bee-widget) hunk ./src/web-frontend.lisp 48 +(defmethod render-pane-contents :before ((pane bee-frontend-pane)) + (when-bind style (elephant:get-instance-by-value + 'bee-page-style 'name (container.current-component-key pane)) + (<:style + (<:as-is (format nil + "body { background: white url(\"~A\") no-repeat fixed 50% 50%; }" + (format nil "/static/img/backgrounds/~A" + (arnesi:escape-as-uri (page-background style)))))))) +