diff --git a/templates/projects/clog-panel/README.md b/templates/projects/clog-panel/README.md new file mode 100644 index 0000000..884a69e --- /dev/null +++ b/templates/projects/clog-panel/README.md @@ -0,0 +1,8 @@ +# New CLOG Web project +### _Your Name _ + +This is a project to do ... something. + +## License + +Specify license here diff --git a/templates/projects/clog-panel/main.clog.lt b/templates/projects/clog-panel/main.clog.lt new file mode 100644 index 0000000..926e843 --- /dev/null +++ b/templates/projects/clog-panel/main.clog.lt @@ -0,0 +1 @@ +
Hello World
\ No newline at end of file diff --git a/templates/projects/clog-panel/main.lisp.lt b/templates/projects/clog-panel/main.lisp.lt new file mode 100644 index 0000000..33f35c5 --- /dev/null +++ b/templates/projects/clog-panel/main.lisp.lt @@ -0,0 +1,24 @@ +(in-package :<%= (@ sys-name) %>) +(defclass main-panel (clog:clog-panel) + ((next-button :reader next-button) + (main-container :reader main-container))) +(defun create-main-panel + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
Hello World
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'main-panel))) + (setf (slot-value panel 'next-button) + (attach-as-child clog-obj "CLOGB3869692797" :clog-type + 'clog:clog-button :new-id t)) + (setf (slot-value panel 'main-container) + (attach-as-child clog-obj "CLOGB3869692796" :clog-type + 'clog:clog-div :new-id t)) + (clog:set-on-click (next-button panel) + (lambda (target) + (declare (ignorable target)) + (replace-element panel (create-next-panel panel)))) + panel)) diff --git a/templates/projects/clog-panel/next.clog.lt b/templates/projects/clog-panel/next.clog.lt new file mode 100644 index 0000000..0b3837a --- /dev/null +++ b/templates/projects/clog-panel/next.clog.lt @@ -0,0 +1 @@ +
Next Panel
\ No newline at end of file diff --git a/templates/projects/clog-panel/next.lisp.lt b/templates/projects/clog-panel/next.lisp.lt new file mode 100644 index 0000000..9baa4fa --- /dev/null +++ b/templates/projects/clog-panel/next.lisp.lt @@ -0,0 +1,24 @@ +(in-package :<%= (@ sys-name) %>) +(defclass next-panel (clog:clog-panel) + ((next-button :reader next-button) + (next-container :reader next-container))) +(defun create-next-panel + (clog-obj &key (hidden nil) (class nil) (html-id nil) (auto-place t)) + (let ((panel + (change-class + (clog:create-div clog-obj :content + "
Next Panel
" + :hidden hidden :class class :html-id html-id + :auto-place auto-place) + 'next-panel))) + (setf (slot-value panel 'next-button) + (attach-as-child clog-obj "CLOGB3869692808" :clog-type + 'clog:clog-button :new-id t)) + (setf (slot-value panel 'next-container) + (attach-as-child clog-obj "CLOGB38696928071" :clog-type + 'clog:clog-div :new-id t)) + (clog:set-on-click (next-button panel) + (lambda (target) + (declare (ignorable target)) + (replace-element panel (create-main-panel panel)))) + panel)) diff --git a/templates/projects/clog-panel/tmpl.asd.lt b/templates/projects/clog-panel/tmpl.asd.lt new file mode 100644 index 0000000..960c4e2 --- /dev/null +++ b/templates/projects/clog-panel/tmpl.asd.lt @@ -0,0 +1,17 @@ +(asdf:defsystem #:<%= (@ sys-name) %> + :description "New CLOG System" + :author "some@one.com" + :license "BSD" + :version "0.0.0" + :serial t + :entry-point "<%= (@ sys-name) %>:start-app" + :depends-on (#:clog) ; add clog plugins here as #:plugin for run time + :components ((:file "<%= (@ sys-name) %>") + (:file "main") + (:file "next"))) + +(asdf:defsystem #:<%= (@ sys-name) %>/tools + :defsystem-depends-on (:clog) + :depends-on (#:<%= (@ sys-name) %> #:clog/tools) ; add clog plugins here as #:plugin/tools for design time + :components ((:clog-file "main") + (:clog-file "next"))) diff --git a/templates/projects/clog-panel/tmpl.lisp.lt b/templates/projects/clog-panel/tmpl.lisp.lt new file mode 100644 index 0000000..ec37108 --- /dev/null +++ b/templates/projects/clog-panel/tmpl.lisp.lt @@ -0,0 +1,20 @@ +(defpackage #:<%= (@ sys-name) %> + (:use #:cl #:clog #:clog-web) + (:export start-app)) + +(in-package :<%= (@ sys-name) %>) + +(defun on-new-window (body) + ;; Add the clog-web look and feel + (clog-web-initialize body) + ;; Use the panel-box-layout to center horizontally + ;; and vertically our div on the screen. + (let* ((layout (create-panel-box-layout body))) + (center-children (center-panel layout)) + (create-main-panel (center-panel layout)))) + +(defun start-app () + (initialize 'on-new-window + :static-root (merge-pathnames "./www/" + (asdf:system-source-directory :<%= (@ sys-name) %>))) + (open-browser)) diff --git a/tools/clog-builder-settings.lisp b/tools/clog-builder-settings.lisp index dc3bf54..28fc752 100644 --- a/tools/clog-builder-settings.lisp +++ b/tools/clog-builder-settings.lisp @@ -2268,6 +2268,11 @@ (defparameter *supported-templates* (list + '(:name "New Builder Panel Project" + :code "nbp" + :type :system + :www "templates/www/" + :loc "templates/projects/clog-panel/") '(:name "New CLOG Basic HTML Project" :code "ncp" :type :system