瀏覽代碼

Added view-person templates

Samuel W. Flint 9 年之前
父節點
當前提交
69d0ea3f6f
共有 3 個文件被更改,包括 75 次插入2 次删除
  1. 2 1
      routes.lisp
  2. 2 1
      templates.lisp
  3. 71 0
      view-person.httmpl

+ 2 - 1
routes.lisp

@@ -94,7 +94,8 @@
                 (:dd "Select and view marriage record.")
                 (:dt (:a :href (str (genurl 'view/divorce)) "View Divorce"))
                 (:dd "Select and view divorce record.")))))
-(define-route view/person ("view/person"))
+(define-route view/person ("view/person")
+  (person-page :nav (generate-nav :main)))
 (define-route view/birth ("view/birth"))
 (define-route view/marriage ("view/marriage"))
 (define-route view/death ("view/death"))

+ 2 - 1
templates.lisp

@@ -10,7 +10,7 @@
          (docstring (if docstring
                         docstring
                         (format nil "Template caller for ~a, as ~a" old-name name)))
-         (input (merge-pathnames input (asdf:system-source-directory '#:museum-system))))
+         (input (merge-pathnames input (asdf:system-source-directory '#:genie))))
     `(defun ,name (&rest args)
        ,docstring
        (with-output-to-string (*standard-output*)
@@ -121,3 +121,4 @@
     :margin-bottom "5px")))
 
 (define-html-template main-page "mainpage.httmpl")
+(define-html-template person-page "view-person.httmpl")

+ 71 - 0
view-person.httmpl

@@ -0,0 +1,71 @@
+<html>
+    <head>
+        <title><!-- TMPL_VAR name --></title>
+        <link rel='StyleSheet' href='/main.css' />
+        <script src='/main.js'></script>
+    </head>
+    <body>
+        <div class='nav'>
+            <ul>
+                <!-- TMPL_LOOP nav -->
+                <!-- TMPL_IF heading -->
+                <!-- TMPL_IF href -->
+                <h2><a href='<!-- TMPL_VAR href -->'><!-- TMPL_VAR heading --></a></h2>
+                <!-- TMPL_ELSE -->
+                <h2><!-- TMPL_VAR heading --></h2>
+                <!-- /TMPL_IF -->
+                <!-- TMPL_ELSE -->
+                <li><a href='<!-- TMPL_VAR href -->'><!-- TMPL_VAR title --></a></li>
+                <!-- /TMPL_IF -->
+                <!-- /TMPL_LOOP -->
+                <hr />
+                <form action='search'
+                      method='post'>
+                    <input type='text'
+                           name='terms' />
+                    <input type='hidden'
+                           name='page'
+                           value='1' />
+                    <input type='submit'
+                           value='Search' />
+                </form>
+                <li><a href='search/advanced'>Advanced Search</a></li>
+                <hr />
+                <li><a href='/'>Main</a></li>
+                <li><a href='/help'>Help</a></li>
+                <li><a href='/logout'>Logout</a></li>
+            </ul>
+        </div>
+        <div class='main-content'>
+            <h1><!-- TMPL_VAR name --></h1>
+            <h3><!-- TMPL_VAR birth-date --> &mdash; <!-- death-date --></h3>
+            <br />
+            <h3>Parents:</h3>
+            <ul>
+                <li>Father: <!-- TMPL_VAR father --></li>
+                <li>Mother: <!-- TMPL_VAR mother --></li>
+            </ul>
+            <br />
+            <h3>Marriage Records:</h3>
+            <table border="1">
+                <tr>
+                    <td>&nbsp;</td>
+                    <th>With:</th>
+                    <th>Wedding Date:</th>
+                    <th>End Date:</th>
+                    <th>Divorced?:</th>
+            </table>
+            <br />
+            <h3>Children:</h3>
+            <table border="1">
+                <tr>
+                    <td>&nbsp;</td>
+                    <th>Name:</th>
+                    <th>Birthdate:</th>
+                    <th>Death date:</th>
+                    <th>Other Parent:</th>
+                </tr>
+            </table>
+        </div>
+    </body>
+</html>