From 43e7c60df0632fd383306a2d3c6dc8c4213d4b9d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 13 Oct 2018 12:19:41 +0200 Subject: [PATCH] changed project layout --- .gitmodules | 3 ++ {static => cards}/cards.css | 0 {templates => cards}/cards.html.sh | 0 {pages => cards}/cards.sh | 0 {static => cards}/categories.css | 0 {templates => cards}/categories.html.sh | 0 {pages => cards}/categories.sh | 0 {actions => cards}/edit_card.sh | 0 .../edit_card.template.sh | 0 {actions => cards}/edit_categories.sh | 0 {actions => cards}/export_vcard.sh | 0 {actions => cards}/filter_card.sh | 0 {actions => cards}/new_card.sh | 0 {templates => cards}/text_cards.sh | 0 {templates => cards}/text_categories.sh | 0 {actions => cards}/update_card.sh | 0 {actions => cards}/update_categories.sh | 0 {templates => cards}/view_card.sh | 0 cgilite | 1 + static/common.css => common.css | 0 {templates => courses}/course_print.sh | 0 {static => courses}/courses.css | 0 {templates => courses}/courses.html.sh | 0 {pages => courses}/courses.sh | 0 {actions => courses}/edit_course.sh | 0 .../edit_course.template.sh | 0 {actions => courses}/export_ical.sh | 0 {actions => courses}/generate_courselist.sh | 0 {actions => courses}/new_course.sh | 0 {templates => courses}/text_courses.sh | 0 {actions => courses}/update_course.sh | 0 {templates => courses}/view_course.sh | 0 {static => email}/email.css | 0 {templates => email}/email.html.sh | 0 {pages => email}/email.sh | 0 templates/frame.html.sh => frame.html.sh | 0 index.cgi | 31 ++++++++++++++++++ .../edit_prescription.sh | 0 .../new_prescription.sh | 0 {static => prescriptions}/prescriptions.css | 0 .../prescriptions.html.sh | 0 {pages => prescriptions}/prescriptions.sh | 0 .../text_prescriptions.sh | 0 .../update_prescription.sh | 0 .../view_prescription.sh | 0 templates/text_frame.sh => text_frame.sh | 0 {templates => therapy}/text_therapy.sh | 0 {static => therapy}/therapy.css | 0 {templates => therapy}/therapy.html.sh | 0 {pages => therapy}/therapy.sh | 0 {static => therapy}/therapy_background.png | Bin {static => therapy}/therapy_background.xcf | Bin {static => therapy}/therapy_draw.js | 0 {actions => therapy}/update_therapy.sh | 0 ...update_bookmarks.sh => update_bookmarks.sh | 0 55 files changed, 35 insertions(+) rename {static => cards}/cards.css (100%) rename {templates => cards}/cards.html.sh (100%) rename {pages => cards}/cards.sh (100%) rename {static => cards}/categories.css (100%) rename {templates => cards}/categories.html.sh (100%) rename {pages => cards}/categories.sh (100%) rename {actions => cards}/edit_card.sh (100%) rename templates/edit_card.sh => cards/edit_card.template.sh (100%) rename {actions => cards}/edit_categories.sh (100%) rename {actions => cards}/export_vcard.sh (100%) rename {actions => cards}/filter_card.sh (100%) rename {actions => cards}/new_card.sh (100%) rename {templates => cards}/text_cards.sh (100%) rename {templates => cards}/text_categories.sh (100%) rename {actions => cards}/update_card.sh (100%) rename {actions => cards}/update_categories.sh (100%) rename {templates => cards}/view_card.sh (100%) create mode 160000 cgilite rename static/common.css => common.css (100%) rename {templates => courses}/course_print.sh (100%) rename {static => courses}/courses.css (100%) rename {templates => courses}/courses.html.sh (100%) rename {pages => courses}/courses.sh (100%) rename {actions => courses}/edit_course.sh (100%) rename templates/edit_course.sh => courses/edit_course.template.sh (100%) rename {actions => courses}/export_ical.sh (100%) rename {actions => courses}/generate_courselist.sh (100%) rename {actions => courses}/new_course.sh (100%) rename {templates => courses}/text_courses.sh (100%) rename {actions => courses}/update_course.sh (100%) rename {templates => courses}/view_course.sh (100%) rename {static => email}/email.css (100%) rename {templates => email}/email.html.sh (100%) rename {pages => email}/email.sh (100%) rename templates/frame.html.sh => frame.html.sh (100%) create mode 100755 index.cgi rename {templates => prescriptions}/edit_prescription.sh (100%) rename {actions => prescriptions}/new_prescription.sh (100%) rename {static => prescriptions}/prescriptions.css (100%) rename {templates => prescriptions}/prescriptions.html.sh (100%) rename {pages => prescriptions}/prescriptions.sh (100%) rename {templates => prescriptions}/text_prescriptions.sh (100%) rename {actions => prescriptions}/update_prescription.sh (100%) rename {templates => prescriptions}/view_prescription.sh (100%) rename templates/text_frame.sh => text_frame.sh (100%) rename {templates => therapy}/text_therapy.sh (100%) rename {static => therapy}/therapy.css (100%) rename {templates => therapy}/therapy.html.sh (100%) rename {pages => therapy}/therapy.sh (100%) rename {static => therapy}/therapy_background.png (100%) rename {static => therapy}/therapy_background.xcf (100%) rename {static => therapy}/therapy_draw.js (100%) rename {actions => therapy}/update_therapy.sh (100%) rename actions/update_bookmarks.sh => update_bookmarks.sh (100%) diff --git a/.gitmodules b/.gitmodules index fb39709..4dba977 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "shcgi"] path = shcgi url = http://git.plutz.net/git/shcgi +[submodule "cgilite"] + path = cgilite + url = http://git.plutz.net/git/cgilite diff --git a/static/cards.css b/cards/cards.css similarity index 100% rename from static/cards.css rename to cards/cards.css diff --git a/templates/cards.html.sh b/cards/cards.html.sh similarity index 100% rename from templates/cards.html.sh rename to cards/cards.html.sh diff --git a/pages/cards.sh b/cards/cards.sh similarity index 100% rename from pages/cards.sh rename to cards/cards.sh diff --git a/static/categories.css b/cards/categories.css similarity index 100% rename from static/categories.css rename to cards/categories.css diff --git a/templates/categories.html.sh b/cards/categories.html.sh similarity index 100% rename from templates/categories.html.sh rename to cards/categories.html.sh diff --git a/pages/categories.sh b/cards/categories.sh similarity index 100% rename from pages/categories.sh rename to cards/categories.sh diff --git a/actions/edit_card.sh b/cards/edit_card.sh similarity index 100% rename from actions/edit_card.sh rename to cards/edit_card.sh diff --git a/templates/edit_card.sh b/cards/edit_card.template.sh similarity index 100% rename from templates/edit_card.sh rename to cards/edit_card.template.sh diff --git a/actions/edit_categories.sh b/cards/edit_categories.sh similarity index 100% rename from actions/edit_categories.sh rename to cards/edit_categories.sh diff --git a/actions/export_vcard.sh b/cards/export_vcard.sh similarity index 100% rename from actions/export_vcard.sh rename to cards/export_vcard.sh diff --git a/actions/filter_card.sh b/cards/filter_card.sh similarity index 100% rename from actions/filter_card.sh rename to cards/filter_card.sh diff --git a/actions/new_card.sh b/cards/new_card.sh similarity index 100% rename from actions/new_card.sh rename to cards/new_card.sh diff --git a/templates/text_cards.sh b/cards/text_cards.sh similarity index 100% rename from templates/text_cards.sh rename to cards/text_cards.sh diff --git a/templates/text_categories.sh b/cards/text_categories.sh similarity index 100% rename from templates/text_categories.sh rename to cards/text_categories.sh diff --git a/actions/update_card.sh b/cards/update_card.sh similarity index 100% rename from actions/update_card.sh rename to cards/update_card.sh diff --git a/actions/update_categories.sh b/cards/update_categories.sh similarity index 100% rename from actions/update_categories.sh rename to cards/update_categories.sh diff --git a/templates/view_card.sh b/cards/view_card.sh similarity index 100% rename from templates/view_card.sh rename to cards/view_card.sh diff --git a/cgilite b/cgilite new file mode 160000 index 0000000..3a49d64 --- /dev/null +++ b/cgilite @@ -0,0 +1 @@ +Subproject commit 3a49d642c02f8577096cfd31a89cb07714a95215 diff --git a/static/common.css b/common.css similarity index 100% rename from static/common.css rename to common.css diff --git a/templates/course_print.sh b/courses/course_print.sh similarity index 100% rename from templates/course_print.sh rename to courses/course_print.sh diff --git a/static/courses.css b/courses/courses.css similarity index 100% rename from static/courses.css rename to courses/courses.css diff --git a/templates/courses.html.sh b/courses/courses.html.sh similarity index 100% rename from templates/courses.html.sh rename to courses/courses.html.sh diff --git a/pages/courses.sh b/courses/courses.sh similarity index 100% rename from pages/courses.sh rename to courses/courses.sh diff --git a/actions/edit_course.sh b/courses/edit_course.sh similarity index 100% rename from actions/edit_course.sh rename to courses/edit_course.sh diff --git a/templates/edit_course.sh b/courses/edit_course.template.sh similarity index 100% rename from templates/edit_course.sh rename to courses/edit_course.template.sh diff --git a/actions/export_ical.sh b/courses/export_ical.sh similarity index 100% rename from actions/export_ical.sh rename to courses/export_ical.sh diff --git a/actions/generate_courselist.sh b/courses/generate_courselist.sh similarity index 100% rename from actions/generate_courselist.sh rename to courses/generate_courselist.sh diff --git a/actions/new_course.sh b/courses/new_course.sh similarity index 100% rename from actions/new_course.sh rename to courses/new_course.sh diff --git a/templates/text_courses.sh b/courses/text_courses.sh similarity index 100% rename from templates/text_courses.sh rename to courses/text_courses.sh diff --git a/actions/update_course.sh b/courses/update_course.sh similarity index 100% rename from actions/update_course.sh rename to courses/update_course.sh diff --git a/templates/view_course.sh b/courses/view_course.sh similarity index 100% rename from templates/view_course.sh rename to courses/view_course.sh diff --git a/static/email.css b/email/email.css similarity index 100% rename from static/email.css rename to email/email.css diff --git a/templates/email.html.sh b/email/email.html.sh similarity index 100% rename from templates/email.html.sh rename to email/email.html.sh diff --git a/pages/email.sh b/email/email.sh similarity index 100% rename from pages/email.sh rename to email/email.sh diff --git a/templates/frame.html.sh b/frame.html.sh similarity index 100% rename from templates/frame.html.sh rename to frame.html.sh diff --git a/index.cgi b/index.cgi new file mode 100755 index 0000000..e0bf125 --- /dev/null +++ b/index.cgi @@ -0,0 +1,31 @@ +#!/bin/sh + +for n in "$@"; do case ${n%%=*} in + data) _DATA="${n#data=}";; + exec) _exec="${n#exec=}";; + noerr) exec 2>&-;; +esac; done + +[ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}" +[ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}" + +. "$_EXEC/cgilite/cgilite.sh" + +FILTER="$(GET filter)" +ORDER="$(GET o |grep -m1 -axE 'firstname|lastname|bdate' || printf firstname)" +# LISTSIZE="$(COOKIE pagesize |grep -m1 -axE '[1-9][0-9]*' || printf 50)" +ITEM="$(PATH "${PATH_INFO#/}")" +ACTION="$(GET a)" + +if [ -d "${_EXEC}/${ITEM%%/*}/main.cgi" ] + . "${_EXEC}/${ITEM%%/*}/main.cgi" +elif [ "$ITEM" = "/style.css" ]; then + . "$_EXEC/cgilite/file.sh" + [ -r "$_DATA/$ITEM" ] && FILE "$_DATA/$ITEM" \ + || FILE "$_EXEC/style.css" +elif [ -d "${_EXEC}/${ITEM%%/*}" -a ! -x "${_EXEC}/$ITEM" ] + . "$_EXEC/cgilite/file.sh" + FILE "${_EXEC}/$ITEM" +else + printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n' +fi diff --git a/templates/edit_prescription.sh b/prescriptions/edit_prescription.sh similarity index 100% rename from templates/edit_prescription.sh rename to prescriptions/edit_prescription.sh diff --git a/actions/new_prescription.sh b/prescriptions/new_prescription.sh similarity index 100% rename from actions/new_prescription.sh rename to prescriptions/new_prescription.sh diff --git a/static/prescriptions.css b/prescriptions/prescriptions.css similarity index 100% rename from static/prescriptions.css rename to prescriptions/prescriptions.css diff --git a/templates/prescriptions.html.sh b/prescriptions/prescriptions.html.sh similarity index 100% rename from templates/prescriptions.html.sh rename to prescriptions/prescriptions.html.sh diff --git a/pages/prescriptions.sh b/prescriptions/prescriptions.sh similarity index 100% rename from pages/prescriptions.sh rename to prescriptions/prescriptions.sh diff --git a/templates/text_prescriptions.sh b/prescriptions/text_prescriptions.sh similarity index 100% rename from templates/text_prescriptions.sh rename to prescriptions/text_prescriptions.sh diff --git a/actions/update_prescription.sh b/prescriptions/update_prescription.sh similarity index 100% rename from actions/update_prescription.sh rename to prescriptions/update_prescription.sh diff --git a/templates/view_prescription.sh b/prescriptions/view_prescription.sh similarity index 100% rename from templates/view_prescription.sh rename to prescriptions/view_prescription.sh diff --git a/templates/text_frame.sh b/text_frame.sh similarity index 100% rename from templates/text_frame.sh rename to text_frame.sh diff --git a/templates/text_therapy.sh b/therapy/text_therapy.sh similarity index 100% rename from templates/text_therapy.sh rename to therapy/text_therapy.sh diff --git a/static/therapy.css b/therapy/therapy.css similarity index 100% rename from static/therapy.css rename to therapy/therapy.css diff --git a/templates/therapy.html.sh b/therapy/therapy.html.sh similarity index 100% rename from templates/therapy.html.sh rename to therapy/therapy.html.sh diff --git a/pages/therapy.sh b/therapy/therapy.sh similarity index 100% rename from pages/therapy.sh rename to therapy/therapy.sh diff --git a/static/therapy_background.png b/therapy/therapy_background.png similarity index 100% rename from static/therapy_background.png rename to therapy/therapy_background.png diff --git a/static/therapy_background.xcf b/therapy/therapy_background.xcf similarity index 100% rename from static/therapy_background.xcf rename to therapy/therapy_background.xcf diff --git a/static/therapy_draw.js b/therapy/therapy_draw.js similarity index 100% rename from static/therapy_draw.js rename to therapy/therapy_draw.js diff --git a/actions/update_therapy.sh b/therapy/update_therapy.sh similarity index 100% rename from actions/update_therapy.sh rename to therapy/update_therapy.sh diff --git a/actions/update_bookmarks.sh b/update_bookmarks.sh similarity index 100% rename from actions/update_bookmarks.sh rename to update_bookmarks.sh -- 2.39.2