From: Paul Hänsch Date: Sat, 13 Oct 2018 10:19:41 +0000 (+0200) Subject: changed project layout X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=43e7c60df0632fd383306a2d3c6dc8c4213d4b9d;p=confetti changed project layout --- 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