]> git.plutz.net Git - busy/commitdiff
started Admin interface, integrated flattr
authorpaul <paul@plutz.net>
Mon, 26 Mar 2012 20:17:05 +0000 (20:17 +0000)
committerpaul <paul@plutz.net>
Mon, 26 Mar 2012 20:17:05 +0000 (20:17 +0000)
svn path=/trunk/; revision=35

Admin.css [new file with mode: 0644]
Admin.page [new file with mode: 0644]
Error.page
Home.page
project.meta

diff --git a/Admin.css b/Admin.css
new file mode 100644 (file)
index 0000000..043ed88
--- /dev/null
+++ b/Admin.css
@@ -0,0 +1,50 @@
+/* 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/>.*/
+
+.section {
+  margin: .5em;
+  padding: 0em .5em .5em .5em;
+  background-color: #F7F7F7;
+  border-style: solid solid solid solid;
+  border-width: 1px;
+  border-color: #AAF;
+}
+.section h1 {
+  text-align: left;
+  font: normal bold 1.4em sans-serif;
+  margin: .3em 0em .4em 0em;
+  border-style: none none solid none;
+  border-width: 1px; border-color: #AAF;
+}
+
+.key{
+  display: inline-block;
+  width: 30%;
+  border-style: none none dotted none;
+  border-width: 1px;
+  border-color: #AAF;
+}
+.value{
+  display: inline-block;
+  min-width: 40%;
+  border-style: none;
+  border-width: 1px;
+  border-color: #AAF;
+}
+
+.value input {
+  width: 100%;
+}
diff --git a/Admin.page b/Admin.page
new file mode 100644 (file)
index 0000000..c3ec24e
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/zsh
+
+metafile=project.meta
+userlist="$(sed -rn 's|^([a-zA-Z0-9_+-]):.+$|\1|p' auth/htpasswd)"
+
+if [ "$ACL_ADMIN" = "false" ]; then
+  reason=noaccess
+  . "./Error.page"
+else
+
+  echo "
+  <div id='LEFT'></div>
+  <div id='MAIN'>
+    <div class='section'><form method='post' accept-charset='utf-8' action='write/$($LOGIN && echo user_)projectadmin.cgi'>
+      <h1>General</h1>
+
+      <fieldset><legend>Title Display</legend>
+      <div class='key'>Project Name</div>
+        <div class='value'><input type='text' name='appName' value='$(sed -rn 's:^name=(.*)$:\1:p' "$metafile")'></div><br>
+      <div class='key'>Project Slogan</div>
+        <div class='value'><input type='text' name='appSlogan' value='$(sed -rn 's:^slogan=(.*)$:\1:p' "$metafile")'></div><br>
+      </fieldset>
+
+      <fieldset><legend>Code Browser</legend>
+      <div class='key'><input type='radio' name='repoType' value='svn' $(grep -q repoType=svn $metafile && echo checked)>SVN Repository</div>
+        <div class='value'><input type='text' name='svnRepo' value='$(sed -rn 's:^svnRepo=(.*)$:\1:p' "$metafile")'></div><br>
+      <div class='key'><input disabled type='radio' name='repoType' value='git' $(grep -q repoType=git $metafile && echo checked)>GIT Repository</div>
+        <div class='value'><input disabled type='text' name='gitRepo' value='$(sed -rn 's:^gitRepo=(.*)$:\1:p' "$metafile")'></div><br>
+      </fieldset>
+
+      <fieldset><legend>Donations</legend>
+       <div class='key'><input type='checkbox' name='useFlattr' value='yes' $(grep -q useFlattr=yes $metafile && echo checked)>Flattr \"Thing\" URL</div>
+          <div class='value'><input type='text' name='flattrThingURL' value='$(sed -rn 's:^flattrThingURL=(.*)$:\1:p' "$metafile")'></div><br>
+       <div class='key'><input type='checkbox' name='useBitcoin' value='yes' $(grep -q useBitcoin=yes $metafile && echo checked)>Bitcoin Address</div>
+          <div class='value'><input type='text' name='btcAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'></div><br>
+       <div class='key'><input type='checkbox' name='usePaypal' value='yes' $(grep -q usePaypal=yes $metafile && echo checked)>Paypal Address</div>
+          <div class='value'><input type='text' name='paypalAddress' value='$(sed -rn 's:^paypalAddress=(.*)$:\1:p' "$metafile")'></div><br>
+      </fieldset>
+    </form></div>
+
+  </div>
+  <div id='RIGHT'></div>
+  "
+fi
index 519dfbb1b26a9e6a5bbcfba1c0ca305e79f45a43..98538b9b480dedcbf906b023ef963af273359c11 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with Busy.  If not, see <http://www.gnu.org/licenses/>.
  
-reason=$(egrep -o '(^|&)r=.+(&|$)' <<<"${QUERY_STRING}" |sed 's,&,,g;s,r=,,')
+[ -z "$reason" ] && reason=$(egrep -o '(^|&)r=.+(&|$)' <<<"${QUERY_STRING}" |sed 's,&,,g;s,r=,,')
 [ -z "$reason" ] && reason="other"
 
-echo '<h2>Error</h2>'
+echo "
+<div id='MAIN'>
+<h2>Error</h2>
+"
 case "${reason}" in
   tooSmall) echo 'You need to select a file for uploading.'
     ;;
@@ -33,3 +36,4 @@ case "${reason}" in
   *) echo 'Unknown generic fuckup :-('
     ;;
 esac
+echo "</div>"
index 88dd0d53caa19a806ba4109b7632e362df6d698e..01d5b1b3336c3777c15fb34bea45957c80a0d8fc 100644 (file)
--- a/Home.page
+++ b/Home.page
@@ -2,10 +2,6 @@
 search="$(egrep -o '(^|&)(s=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?s=::;s:\+: :g;s:%:\\x:g')"
 search="$(echo -e "${search}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)"
 
-[ -z "$ACL_EDITINTRO" ] && ACL_EDITINTRO=false
-[ -z "$ACL_ADDNEWS" ] && ACL_ADDNEWS=false
-[ -z "$ACL_EDITNEWS" ] && ACL_EDITNEWS=false
-
 cat <<WikiEND
   <div id="LEFT">
     <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
index 415c0ec2700dafed62562ac8db585f5872a9e374..533c9b44169d4fab8acf94321ed8a58d996fa110 100644 (file)
@@ -1,3 +1,6 @@
 name=Busy
 slogan=Letting You do the Work.
-repo=http://svn.plutz.net/busy
+repoType=svn
+svnRepo=http://svn.plutz.net/busy
+useFlattr=yes
+flattrThingURL=http://flattr.com/thing/599434/Busy-Software-Project-Management