]> git.plutz.net Git - busy/blob - Admin.page
improved interface for ad selection
[busy] / Admin.page
1 #!/bin/zsh
2
3 metafile=project.meta
4 userlist="$(sed -rn 's|^([a-zA-Z0-9_+-]):.+$|\1|p' auth/htpasswd)"
5
6 if [ "$ACL_ADMIN" = "false" ]; then
7   reason=noaccess
8   . "./Error.page"
9 else
10
11   echo "
12   <div id='LEFT'></div>
13   <div id='MAIN'>
14     <div class='section'><form method='post' accept-charset='utf-8' action='write/$($LOGIN && echo user_)projectmeta.cgi'>
15       <h1>General</h1>
16
17       <fieldset><legend>Title Display</legend>
18       <div class='key'>Project Name</div>
19         <div class='value'><input type='text' name='appName' value='$(sed -rn 's:^name=(.*)$:\1:p' "$metafile")'></div><br>
20       <div class='key'>Project Slogan</div>
21         <div class='value'><input type='text' name='appSlogan' value='$(sed -rn 's:^slogan=(.*)$:\1:p' "$metafile")'></div><br>
22       </fieldset>
23
24       <fieldset><legend>Code Browser</legend>
25       <div class='key'><input type='radio' name='repoType' value='svn' $(grep -q repoType=svn $metafile && echo checked)>SVN Repository</div>
26         <div class='value'><input type='text' name='svnRepo' value='$(sed -rn 's:^svnRepo=(.*)$:\1:p' "$metafile")'></div><br>
27       <div class='key'><input type='radio' name='repoType' value='git' $(grep -q repoType=git $metafile && echo checked)>GIT Repository</div>
28         <div class='value'><input type='text' name='gitRepo' value='$(sed -rn 's:^gitRepo=(.*)$:\1:p' "$metafile")'></div><br>
29       </fieldset>
30
31       <fieldset><legend>Donations</legend>
32         <div class='key'><input type='checkbox' name='useFlattr' value='yes' $(grep -q useFlattr=yes $metafile && echo checked)>Flattr \"Thing\" URL</div>
33           <div class='value'><input type='text' name='flattrThingURL' value='$(sed -rn 's:^flattrThingURL=(.*)$:\1:p' "$metafile")'></div><br>
34         <div class='key'><input type='checkbox' name='useBitcoin' value='yes' $(grep -q useBitcoin=yes $metafile && echo checked)>Bitcoin Address</div>
35           <div class='value'><input type='text' name='btcAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'></div><br>
36         <div class='key'><input type='checkbox' name='usePaypal' value='yes' $(grep -q usePaypal=yes $metafile && echo checked)>Paypal Address</div>
37           <div class='value'><input type='text' name='paypalAddress' value='$(sed -rn 's:^paypalAddress=(.*)$:\1:p' "$metafile")'></div><br>
38       </fieldset>
39
40       <fieldset><legend>Advertisement</legend>
41         <div class='key'><input type='radio' name='advertise' value='no' $(grep -q advertise=no $metafile && echo checked)>No Advertisement</div><br>
42         <div class='key'><input type='radio' name='advertise' value='btcAd' $(grep -q advertise=btcAd $metafile && echo checked)>
43             <a target='_blank' href='http://bitcoinadvertisers.com'>BitCoinAdvertisers.com</a><br>Bitcoin Address:</div>
44           <div class='value'>
45           <input type='text' name='btcAdAddress' value='$(sed -rn 's:^btcAddress=(.*)$:\1:p' "$metafile")'>
46           <input type='checkbox' name='btcAdGamble' value='yes' $(egrep -q 'btcAdContent=[13]' project.meta && echo checked)>Allow gambling ads
47           <input type='checkbox' name='btcAdErotic' value='yes' $(egrep -q 'btcAdContent=[12]' project.meta && echo checked)>Allow erotic ads
48           </div><br>
49       </fieldset>
50       <input type='submit'>
51     </form></div>
52
53   </div>
54   <div id='RIGHT'></div>
55   "
56 fi