]> git.plutz.net Git - busy/commitdiff
implemented intro display/editing of home section
authorpaul <paul@plutz.net>
Sun, 7 Aug 2011 02:13:48 +0000 (02:13 +0000)
committerpaul <paul@plutz.net>
Sun, 7 Aug 2011 02:13:48 +0000 (02:13 +0000)
svn path=/trunk/; revision=4

Home.css
Home.page
Wiki.css
busy.css
index.cgi
write/introedit.cgi [new file with mode: 0755]

index 0da58f5357d239c61667a7dbcc848672694cae57..2e3926b3a864c2c500740808bc21ed3df1918f68 100644 (file)
--- a/Home.css
+++ b/Home.css
 
 div#INTRO {
   float: top;
 
 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;
 }
   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;
+}
index 8815d1ccedeb3614586089ea41a41979111f56c4..6eef2296997a2da50fe28ff1b6bbfa623314fc89 100644 (file)
--- a/Home.page
+++ b/Home.page
@@ -3,12 +3,32 @@
 cat <<HomeEND
   <div id="LEFT">
   </div>
 cat <<HomeEND
   <div id="LEFT">
   </div>
-  <div id="RIGHT">
-  </div>
 
 
-  <div id="INTRO">
+  <div id="MAIN">
+    <div id="INTRO">
+      <div id="introtext">
+      $([ -r "Home/intro" ] && _wiki "Home/intro")
+      $($ADM && echo "<hr><a class='function' href='#' onclick='javascript:hide_screen(\"introtext\");show_screen(\"introedit\");'>Edit</a>" )
+      </div>
+HomeEND
+$ADM && cat <<HomeEND
+      <div id="introedit" style="display: none;">
+        <form action="/write/introedit.cgi" method="post" accept-charset="UTF-8">
+          <textarea name="intro" rows="10">$([ -r "Home/intro" ] && cat Home/intro)</textarea><br>
+          <input type="submit">
+          <a class="function" href="#" onclick="javascript:hide_screen('introedit');show_screen('introtext');">Cancel</a>
+        </form>
+      </div>
+HomeEND
+cat <<HomeEND
+    </div>
+  
+    $(stat -c '' Home/<0000000000-9999999999>-<000-999>.news && for each in $(ls -c News/<0000000000-9999999999>-<000-999>); do
+      echo '<div id="NEWS">'
+      _wiki "$each"
+      echo '</div>'
+    done)
+  </div>
+  <div id="RIGHT">
   </div>
   </div>
-
-  <div class="News">
-  <div>
 HomeEND
 HomeEND
index b0a69b9cd18ab2df51bfc4ac9b94112f6e6376bb..7d760ef8c7d05ffff2f584ad6a129c9751f508af 100644 (file)
--- a/Wiki.css
+++ b/Wiki.css
   padding: 0em 4ex;
 }
 .wiki ol ul {font-size: .9em; margin: 0em;}
   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;
 
 .article {
   float: left;
index 693361af411ccb7671321905defb3218b718c5d6..a980fc1b37fe45ed52dee54c99abdc5f7612b73b 100644 (file)
--- a/busy.css
+++ b/busy.css
@@ -144,6 +144,7 @@ a.function:hover {
 
 form { width: 100%; }
 form textarea { width: 99%; }
 
 form { width: 100%; }
 form textarea { width: 99%; }
+form input { max-width: 99%; }
 
 div.screen {
   position: fixed;
 
 div.screen {
   position: fixed;
index e794d138f3ca905b0d1429ebfd5c2ab1fe62aac8..4f3a10f47c36510a8c649abc4028e8c630f6b9d2 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -74,7 +74,7 @@ $( $LOGIN || echo '<form action="/login.cgi?'${QUERY_STRING:gs/&/&amp;/}'" metho
       <a href='/?p=Home'>Home</a>
       <a href='/?p=Wiki'>Wiki</a>
       <a href='/?p=Code'>Code</a>
       <a href='/?p=Home'>Home</a>
       <a href='/?p=Wiki'>Wiki</a>
       <a href='/?p=Code'>Code</a>
-      <a href='/?p=Issues'>Issues</a>
+      <a href='/?p=Tasks'>Tasks</a>
     </div>
       $(if [ -r "./${page}.page" ]; then
        . "./${page}.page"
     </div>
       $(if [ -r "./${page}.page" ]; then
        . "./${page}.page"
diff --git a/write/introedit.cgi b/write/introedit.cgi
new file mode 100755 (executable)
index 0000000..4bb507f
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+
+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"