]> git.plutz.net Git - busy/commitdiff
improved interface for ad selection
authorpaul <paul@plutz.net>
Thu, 31 May 2012 00:01:03 +0000 (00:01 +0000)
committerpaul <paul@plutz.net>
Thu, 31 May 2012 00:01:03 +0000 (00:01 +0000)
svn path=/trunk/; revision=46

Admin.css
Admin.page
write/projectmeta.cgi

index 043ed8831105bb0de0309b1daf9c798dc6097ca1..a5b6941d716dc12787e30ab1c017ceb055719b0b 100644 (file)
--- a/Admin.css
+++ b/Admin.css
@@ -45,6 +45,6 @@
   border-color: #AAF;
 }
 
-.value input {
+.value input[type=text] {
   width: 100%;
 }
index e78ce2341195de25c7cd928352523e45e12e6f8a..29d006a0fd67c2d20d714542b8072aefcd233bc5 100644 (file)
@@ -40,15 +40,11 @@ else
       <fieldset><legend>Advertisement</legend>
        <div class='key'><input type='radio' name='advertise' value='no' $(grep -q advertise=no $metafile && echo checked)>No Advertisement</div><br>
        <div class='key'><input type='radio' name='advertise' value='btcAd' $(grep -q advertise=btcAd $metafile && echo checked)>
-         <a href="http://bitcoinadvertisers.com">BitCoinAdvertisers.com</a></div>
+           <a target='_blank' href='http://bitcoinadvertisers.com'>BitCoinAdvertisers.com</a><br>Bitcoin Address:</div>
           <div class='value'>
-          Bitcoin Address: <input type='text' name='btcAdAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'><br>
-          Content: <select name=btcAdContent size=1>
-            <option value=1 $(grep -q 'btcAdContent=1' project.meta && echo selected)>All</option>
-            <option value=2 $(grep -q 'btcAdContent=2' project.meta && echo selected)>No Gambling</option>
-            <option value=3 $(grep -q 'btcAdContent=3' project.meta && echo selected)>No Erotic</option>
-            <option value=4 $(grep -q 'btcAdContent=4' project.meta && echo selected)>Neither</option>
-          </select>
+          <input type='text' name='btcAdAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'>
+         <input type='checkbox' name='btcAdGamble' value='yes' $(egrep -q 'btcAdContent=[13]' project.meta && echo checked)>Allow gambling ads
+         <input type='checkbox' name='btcAdErotic' value='yes' $(egrep -q 'btcAdContent=[12]' project.meta && echo checked)>Allow erotic ads
           </div><br>
       </fieldset>
       <input type='submit'>
index 436f31e391f3c71889f3ce0517bde98043295dd6..c2ee4427ff718ab95327b463260b87518bf0aeca 100755 (executable)
@@ -25,13 +25,18 @@ $ACL_ADMIN || exit 0
 
 if [ -n "${CONTENT_LENGTH}" -a "${CONTENT_LENGTH}" -gt 0 ]; then
 (head -c "${CONTENT_LENGTH}"; echo)|sed 's/&/\n/g' \
-  |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress|btcAdAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin)=yes|advertise=(btcAd|no)|btcAdContent=[1-4])$/{
+  |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress|btcAdAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin|btcAdGamble|btcAdErotic)=yes|advertise=(btcAd|no))$/{
             s:\+: :g;s:%:\\x:g;p}' \
   |while line="$(line)"; do
     eval "$(echo -e "$line" |sed -r 's:[\n\r'\'']::g;s:^([a-zA-Z0-9_+-]+)=(.*)$:\1='"'\2'"':;')"
   done
 fi
 
+[ "$btcAdGamble" = yes -a "$btcAdErotic" = yes ] && btcAdContent=1
+[ "$btcAdGamble" != yes -a "$btcAdErotic" = yes ] && btcAdContent=2
+[ "$btcAdGamble" = yes -a "$btcAdErotic" != yes ] && btcAdContent=3
+[ "$btcAdGamble" != yes -a "$btcAdErotic" != yes ] && btcAdContent=4
+
 echo "\
 name=$appName
 slogan=$appSlogan