routes.lisp 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ;;;; routes.lisp
  2. (in-package #:genie)
  3. ;;; "routes" goes here. Hacks and glory await!
  4. (defun generate-nav (main &optional sub)
  5. (declare (ignorable main sub))
  6. `((:heading "Add" :href ,(genurl 'add))
  7. (:title "Person" :href ,(genurl 'add/person))
  8. (:title "Death" :href ,(genurl 'add/death))
  9. (:title "Marriage" :href ,(genurl 'add/marriage))
  10. (:title "Divorce" :href ,(genurl 'add/divorce))
  11. (:heading "Edit" :href ,(genurl 'edit))
  12. (:title "Person" :href ,(genurl 'edit/person))
  13. (:title "Birth" :href ,(genurl 'edit/birth))
  14. (:title "Death" :href ,(genurl 'edit/death))
  15. (:title "Marriage" :href ,(genurl 'edit/marriage))
  16. (:title "Divorce" :href ,(genurl 'edit/divorce))
  17. (:heading "View" :href ,(genurl 'view))
  18. (:heading "Notes" :href ,(genurl 'notes))
  19. (:title "Add" :href ,(genurl 'notes/add))
  20. (:title "View" :href ,(genurl 'notes/view))
  21. (:title "Edit" :href ,(genurl 'notes/edit))
  22. (:heading "Records" :href ,(genurl 'records))
  23. (:title "Add" :href ,(genurl 'records/add))
  24. (:title "View" :href ,(genurl 'records/view))
  25. (:heading "Reports" :href ,(genurl 'reports))
  26. (:title "Add" :href ,(genurl 'reports/add))
  27. (:title "View" :href ,(genurl 'reports/view))
  28. (:title "Edit" :href ,(genurl 'reports/edit))
  29. (:title "Generate" :href ,(genurl 'reports/generate))))
  30. (define-route main ("")
  31. (main-page :nav (generate-nav :main)))
  32. (define-route add ("add")
  33. (main-page :nav (generate-nav :main)
  34. :title "Add"
  35. :content
  36. (with-html-output-to-string (out)
  37. (:dl
  38. (:dt (:a :href (str (genurl 'add/person)) "Add Person"))
  39. (:dd "Add a person to the genealogical database.")
  40. (:dt (:a :href (str (genurl 'add/death)) "Add Death"))
  41. (:dd "Add a death record to the genealogical database.")
  42. (:dt (:a :href (str (genurl 'add/marriage)) "Add Marriage"))
  43. (:dd "Add a marriage record to the genealogical database.")
  44. (:dt (:a :href (str (genurl 'add/divorce)) "Add Divorce"))
  45. (:dd "Add a divorce record to the genealogical database")))))
  46. (define-route add/person ("add/person"))
  47. (define-route add/person/post ("add/person" :method :post))
  48. (define-route add/marriage ("add/marriage"))
  49. (define-route add/marriage/post ("add/marriage" :method :post))
  50. (define-route add/divorce ("add/divorce"))
  51. (define-route add/divorce/edit ("add/divorce" :method :post))
  52. (define-route add/death ("add/death"))
  53. (define-route edit ("edit")
  54. (main-page :nav (generate-nav :main)
  55. :title "Edit"
  56. :content
  57. (with-html-output-to-string (out)
  58. (:dl
  59. (:dt (:a :href (str (genurl 'edit/person)) "Edit Person"))
  60. (:dd "Select and edit a person's record.")
  61. (:dt (:a :href (str (genurl 'edit/birth)) "Edit Birth"))
  62. (:dd "Select and edit a birth record.")
  63. (:dt (:a :href (str (genurl 'edit/death)) "Edit Death"))
  64. (:dd "Select and edit a death record.")
  65. (:dt (:a :href (str (genurl 'edit/marriage)) "Edit Marriage"))
  66. (:dd "Select and edit a marriage record.")
  67. (:dt (:a :href (str (genurl 'edit/divorce)) "Edit Divorce"))
  68. (:dd "Select and edit a divorce record.")))))
  69. (define-route edit/person ("edit/person"))
  70. (define-route edit/birth ("edit/birth"))
  71. (define-route edit/death ("edit/death"))
  72. (define-route edit/marriage ("edit/marriage"))
  73. (define-route edit/divorce ("edit/divorce"))
  74. (define-route view ("view")
  75. (main-page :title "View"
  76. :nav (generate-nav :main)
  77. :content
  78. (with-html-output-to-string (out)
  79. (:dl
  80. (:dt (:a :href (str (genurl 'view/person)) "View Person"))
  81. (:dd "Select and view person record.")
  82. (:dt (:a :href (str (genurl 'view/birth)) "View Birth"))
  83. (:dd "Select and view birth record.")
  84. (:dt (:a :href (str (genurl 'view/death)) "View Death"))
  85. (:dd "Select and view death record.")
  86. (:dt (:a :href (str (genurl 'view/marriage)) "View Marriage"))
  87. (:dd "Select and view marriage record.")
  88. (:dt (:a :href (str (genurl 'view/divorce)) "View Divorce"))
  89. (:dd "Select and view divorce record.")))))
  90. (define-route view/person ("view/person")
  91. (person-page :nav (generate-nav :main)))
  92. (define-route view/birth ("view/birth"))
  93. (define-route view/marriage ("view/marriage"))
  94. (define-route view/death ("view/death"))
  95. (define-route view/divorce ("view/divorce"))
  96. (define-route notes ("notes")
  97. (main-page :title "Notes Management"
  98. :nav (generate-nav :main)
  99. :content
  100. (with-html-output-to-string (output)
  101. (:dl
  102. (:dt (:a :href (str (genurl 'notes/add)) "Add Note"))
  103. (:dd "Add a research note.")
  104. (:dt (:a :href (str (genurl 'notes/view)) "View Notes"))
  105. (:dd "View research notes.")
  106. (:dt (:a :href (str (genurl 'notes/edit)) "Edit Note"))
  107. (:dd "Select and edit research notes.")))))
  108. (define-route notes/add ("notes/add"))
  109. (define-route notes/edit ("notes/edit"))
  110. (define-route notes/view ("notes/view"))
  111. (define-route records ("records")
  112. (main-page :title "Records Management"
  113. :nav (generate-nav :main)
  114. :content
  115. (with-html-output-to-string (output)
  116. (:dl
  117. (:dt (:a :href (str (genurl 'records/add)) "Add Record"))
  118. (:dd "Add a copy of a historical record/citation.")
  119. (:dt (:a :href (str (genurl 'records/view)) "View Records"))
  120. (:dd "View records/citations.")))))
  121. (define-route records/add ("records/add"))
  122. (define-route records/view ("records/view"))
  123. (define-route reports ("reports")
  124. (main-page :title "Reports"
  125. :nav (generate-nav :main)
  126. :content
  127. (with-html-output-to-string (output)
  128. (:dl
  129. (:dt (:a :href (str (genurl 'reports/add)) "Add Report"))
  130. (:dd "Add a report of one of the following types:"
  131. (:ul
  132. (:li "Family Tree")
  133. (:li "Ahnentafel")
  134. (:li "Biography")
  135. (:li "Complete genealogical report")))
  136. (:dt (:a :href (str (genurl 'reports/view)) "View Report"))
  137. (:dd "View report properties/report.")
  138. (:dt (:a :href (str (genurl 'reports/edit)) "Edit Report"))
  139. (:dd "Edit report properties/report content.")
  140. (:dt (:a :href (str (genurl 'reports/generate)) "Generate Report"))
  141. (:dd "Generate formatted report output.")))))
  142. (define-route reports/add ("reports/add"))
  143. (define-route reports/view ("reports/view"))
  144. (define-route reports/edit ("reports/edit"))
  145. (define-route reports/generate ("reports/generate"))
  146. (define-route search-page ("search"))
  147. (define-route search/advanced ("search/advanced"))