routes.lisp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 "Notes" :href ,(genurl 'notes))
  12. (:title "Add" :href ,(genurl 'notes/add))
  13. (:title "View" :href ,(genurl 'notes/view))
  14. (:title "Edit" :href ,(genurl 'notes/edit))
  15. (:heading "Records" :href ,(genurl 'records))
  16. (:title "Add" :href ,(genurl 'records/add))
  17. (:title "View" :href ,(genurl 'records/view))
  18. (:heading "Reports" :href ,(genurl 'reports))
  19. (:title "Add" :href ,(genurl 'reports/add))
  20. (:title "View" :href ,(genurl 'reports/view))
  21. (:title "Edit" :href ,(genurl 'reports/edit))
  22. (:title "Generate" :href ,(genurl 'reports/generate))))
  23. (define-route main ("")
  24. (main-page :nav (generate-nav :main)))
  25. (define-route add ("add")
  26. (main-page :nav (generate-nav :main)
  27. :title "Add"
  28. :content
  29. (with-html-output-to-string (out)
  30. (:dl
  31. (:dt (:a :href (str (genurl 'add/person)) "Add Person"))
  32. (:dd "Add a person to the genealogical database.")
  33. (:dt (:a :href (str (genurl 'add/death)) "Add Death"))
  34. (:dd "Add a death record to the genealogical database.")
  35. (:dt (:a :href (str (genurl 'add/marriage)) "Add Marriage"))
  36. (:dd "Add a marriage record to the genealogical database.")
  37. (:dt (:a :href (str (genurl 'add/divorce)) "Add Divorce"))
  38. (:dd "Add a divorce record to the genealogical database")))))
  39. (define-route add/person ("add/person"))
  40. (define-route add/person/post ("add/person" :method :post))
  41. (define-route add/marriage ("add/marriage"))
  42. (define-route add/divorce ("add/divorce"))
  43. (define-route add/death ("add/death"))
  44. (define-route notes ("notes")
  45. (main-page :title "Notes Management"
  46. :nav (generate-nav :main)
  47. :content
  48. (with-html-output-to-string (output)
  49. (:dl
  50. (:dt (:a :href (str (genurl 'notes/add)) "Add Note"))
  51. (:dd "Add a research note.")
  52. (:dt (:a :href (str (genurl 'notes/view)) "View Notes"))
  53. (:dd "View research notes.")
  54. (:dt (:a :href (str (genurl 'notes/edit)) "Edit Note"))
  55. (:dd "Select and edit research notes.")))))
  56. (define-route notes/add ("notes/add"))
  57. (define-route notes/edit ("notes/edit"))
  58. (define-route notes/view ("notes/view"))
  59. (define-route records ("records")
  60. (main-page :title "Records Management"
  61. :nav (generate-nav :main)
  62. :content
  63. (with-html-output-to-string (output)
  64. (:dl
  65. (:dt (:a :href (str (genurl 'records/add)) "Add Record"))
  66. (:dd "Add a copy of a historical record/citation.")
  67. (:dt (:a :href (str (genurl 'records/view)) "View Records"))
  68. (:dd "View records/citations.")))))
  69. (define-route records/add ("records/add"))
  70. (define-route records/view ("records/view"))
  71. (define-route reports ("reports")
  72. (main-page :title "Reports"
  73. :nav (generate-nav :main)
  74. :content
  75. (with-html-output-to-string (output)
  76. (:dl
  77. (:dt (:a :href (str (genurl 'reports/add)) "Add Report"))
  78. (:dd "Add a report of one of the following types:"
  79. (:ul
  80. (:li "Family Tree")
  81. (:li "Ahnentafel")
  82. (:li "Biography")
  83. (:li "Complete genealogical report")))
  84. (:dt (:a :href (str (genurl 'reports/view)) "View Report"))
  85. (:dd "View report properties/report.")
  86. (:dt (:a :href (str (genurl 'reports/edit)) "Edit Report"))
  87. (:dd "Edit report properties/report content.")
  88. (:dt (:a :href (str (genurl 'reports/generate)) "Generate Report"))
  89. (:dd "Generate formatted report output.")))))
  90. (define-route reports/add ("reports/add"))
  91. (define-route reports/view ("reports/view"))
  92. (define-route reports/edit ("reports/edit"))
  93. (define-route reports/generate ("reports/generate"))
  94. (define-route search-page ("search"))
  95. (define-route search/advanced ("search/advanced"))