[Initial frontend of dummy components and empty css clinton@unknownlamer.org**20081205233649] hunk ./beesknees.asd 13 + (:file "frontend" :depends-on ("packages")) addfile ./src/frontend.lisp hunk ./src/frontend.lisp 1 - +(in-package :beesknees.web) + +(defcomponent bee-window (standard-window-component) + () + (:default-initargs + :title "The Bee's Knees" + :stylesheet '("static/css/common.css"))) + +(defcomponent dummy-component () + ()) + +(defmethod render ((self dummy-component)) + (<:p (<:strong (<:format "(~A) " (class-name (class-of self)))) + (<:as-html "Nothing to see here. Move along."))) + +(defclass bee-widget (html-block-element-mixin) + () + (:documentation "Widget component that sets css-class to class-name by default")) + +(defmethod initialize-instance :after ((c bee-widget) + &rest keys) + (setf (html-element.css-class c) + (or (getf keys :css-class) + (string-downcase (symbol-name (class-name (class-of c))))))) + +(defcomponent composite-container (html-block-element-mixin container) + () + (:default-initargs :css-class "ucw-composite-container")) + +(defmethod render ((container composite-container)) + (mapc (arnesi:compose #'render #'cdr) (container.contents container))) + +(defcomponent bee-video (bee-widget dummy-component) + ()) + +(defcomponent bee-blog (bee-widget dummy-component) + ()) + +(defcomponent bee-home (bee-widget composite-container) + () + (:default-initargs + :contents `((video . ,(make-instance 'bee-video)) + (blog . ,(make-instance 'bee-blog))))) + +(defcomponent bee-about (bee-widget dummy-component) + ()) + +(defcomponent bee-contact (bee-widget dummy-component) + ()) + +(defcomponent bee-frontend-window (bee-window) + () + (:default-initargs + :stylesheet '("static/css/frontend.css") + :body (make-instance 'tabbed-pane + :css-class "bee-frontend-pane" + :current-component-key 'home + :contents + `((home . ,(make-instance 'bee-home)) + (about . ,(make-instance 'bee-about)) + (contact . ,(make-instance 'bee-contact)))))) hunk ./src/packages.lisp 2 - (:use :cl :ucw) + (:use :cl :ucw :ucw-core) hunk ./src/packages.lisp 7 + + ;; Windows + #:bee-window + #:bee-frontend-window + + ;; Components hunk ./src/packages.lisp 16 - (:use :cl :beesknees.web :ucw :org.unknownlamer.golgonooza.site-control) + (:use :cl :beesknees.web :ucw-core :ucw :org.unknownlamer.golgonooza.site-control) hunk ./src/site-control.lisp 13 - nil) + (defentry-point "^(index.ucw|)$" (:application (find-site-application site :frontend) + :class regexp-dispatcher) + () + (call 'bee-frontend-window))) hunk ./src/site-control.lisp 22 - (cons :frontned + (cons :frontend adddir ./static adddir ./static/css addfile ./static/css/common.css addfile ./static/css/frontend.css