From: paul Date: Sun, 7 Aug 2011 02:13:48 +0000 (+0000) Subject: implemented intro display/editing of home section X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=766fa0c3db0db95dff75858caeab75e7fa3d1ef0;p=busy implemented intro display/editing of home section svn path=/trunk/; revision=4 --- diff --git a/Home.css b/Home.css index 0da58f5..2e3926b 100644 --- a/Home.css +++ b/Home.css @@ -16,10 +16,62 @@ div#INTRO { float: top; - margin: 2em 25% 1em 20%; - padding: 1em .5em .5em .5em; + margin: .5em; + padding: 0em .5em .5em .5em; background-color: #F7F7F7; border-style: solid dashed dashed dashed; border-width: 1px; border-color: #AAF; } + +#introtext h1 { + text-align: center; + font: normal bold 2em sans-serif; + margin: 0em 0em 0em 0em; + border-style: none none solid none; + border-width: 1px; +} +#introtext h1 + h2{ + margin: .5em 0em .3em 0em; +} +#introtext h2 { + text-align: left; + font: normal bold 1.5em sans-serif; + margin: .3em 0em .3em 0em; + border-style: none none solid none; + border-width: 1px; border-color: #AAF; +} +#introtext h2 + p { margin: 0em; } +#introtext h3 { + text-align: left; + font-size: 1.2em; + margin: .6em 0em .3em 0em; +} +#introtext h3 + p { margin: 0em; } +#introtext h4 { + text-align: left; + font-size: 1em; + margin: .6em 0em .3em 0em; +} +#introtext h4 + p { margin: 0em; } +#introtext p { + margin: .6em 0em; +} +#introtext ul { + text-indent: 0em; + margin: .3em 0em; + padding: 0em 4ex; +} +#introtext ul ol {font-size: .9em; margin: 0em;} +#introtext ol { + text-indent: 0em; + margin: .3em 0em; + padding: 0em 4ex; +} +#introtext ol ul {font-size: .9em; margin: 0em;} +#introtext pre { + background-color: #EEE; + padding: .5em; + border-style: solid; border-width: 1px; + border-color: #AAF; +} diff --git a/Home.page b/Home.page index 8815d1c..6eef229 100644 --- a/Home.page +++ b/Home.page @@ -3,12 +3,32 @@ cat < - -
+
+
+
+ $([ -r "Home/intro" ] && _wiki "Home/intro") + $($ADM && echo "
Edit" ) +
+HomeEND +$ADM && cat <
+HomeEND +cat < + + $(stat -c '' Home/<0000000000-9999999999>-<000-999>.news && for each in $(ls -c News/<0000000000-9999999999>-<000-999>); do + echo '
' + _wiki "$each" + echo '
' + done) +
+ - -
-
HomeEND diff --git a/Wiki.css b/Wiki.css index b0a69b9..7d760ef 100644 --- a/Wiki.css +++ b/Wiki.css @@ -123,6 +123,12 @@ padding: 0em 4ex; } .wiki ol ul {font-size: .9em; margin: 0em;} +.wiki pre { + background-color: #EEE; + padding: .5em; + border-style: solid; border-width: 1px; + border-color: #AAF; +} .article { float: left; diff --git a/busy.css b/busy.css index 693361a..a980fc1 100644 --- a/busy.css +++ b/busy.css @@ -144,6 +144,7 @@ a.function:hover { form { width: 100%; } form textarea { width: 99%; } +form input { max-width: 99%; } div.screen { position: fixed; diff --git a/index.cgi b/index.cgi index e794d13..4f3a10f 100755 --- a/index.cgi +++ b/index.cgi @@ -74,7 +74,7 @@ $( $LOGIN || echo '
Home Wiki Code - Issues + Tasks
$(if [ -r "./${page}.page" ]; then . "./${page}.page" diff --git a/write/introedit.cgi b/write/introedit.cgi new file mode 100755 index 0000000..4bb507f --- /dev/null +++ b/write/introedit.cgi @@ -0,0 +1,31 @@ +#!/bin/zsh +# Copyright 2011 Paul Haensch +# This file is part of Busy +# +# Busy is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Busy is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Busy. If not, see . + +if [ -n "${CONTENT_LENGTH}" -a "${CONTENT_LENGTH}" -gt 0 ]; then +(head -c "${CONTENT_LENGTH}"; echo)|sed 's/&/\n/g' |while read line; do + if (echo "${line}" | egrep -xq 'intro=.+'); then + intro="$(cut -d= -f2- <<<"${line}" |sed 's/+/ /g;s/%/\\x/g')" + intro=$(echo -e "${intro}" |sed 's/\t/ /g;s/\r//g;s/\\/\\\\/g') + elif (echo "${line}" | egrep -xq 'cancel=.+'); then + cancel=true + fi +done +fi + +[ -z "$cancel" ] && grep -qx "${REMOTE_USER}" ../auth/admin.user && echo -e "${intro}" >"../Home/intro" + +echo -n "Location: http://${HTTP_HOST}/?p=Home\n\n"