Changeset 330
- Timestamp:
- 06/15/09 03:05:14 (3 years ago)
- Files:
-
- 1 modified
-
trunk/sandbox/jhb/webwallet/cgi/wallet.cgi (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/sandbox/jhb/webwallet/cgi/wallet.cgi
r329 r330 33 33 print "\r" 34 34 if self.mimetype == 'text/html': 35 print '<html><body><small>%s</small>' % (baseserver+baseurl) 35 36 print '<br/>\n'.join(self.output) 37 print '</body></html>' 36 38 else: 37 39 print '\n'.join(self.output) … … 86 88 entry = """ 87 89 <p>%(amount)s <b href='%(isl)s'>%(cid)ss</b><br/> 90 <small> 88 91 <a href='%(baseurl)s?action=spend¤cyId=%(cid)s'>Pay</a> 89 92 <a href='%(baseurl)s?action=freshenup¤cyId=%(cid)s'>Refresh</a> … … 91 94 <a href='%(baseurl)s?action=redeem¤cyId=%(cid)s'>Redeem</a> 92 95 <a href='%(baseurl)s?action=delcurrency¤cyId=%(cid)s'>Remove</a> 96 </small> 93 97 </p> 94 98 """ % dict(amount=amount, … … 99 103 items = '\n'.join(items) 100 104 html = """ 101 <html><body>102 105 <h2>Wallet content</h2> 103 106 %s 104 107 ----<br/> 105 <a href='%s?action=addcurrency'>Add a currency</a> 106 </body></html> 108 <small><a href='%s?action=addcurrency'>Add a currency</a></small> 107 109 """ % (items,baseurl) 108 110 self.out(html) … … 121 123 def displayAddCurrency(self): 122 124 html=""" 123 <html><body>124 125 <h2>Add a currency</h2> 125 126 <form action='%s' method='post'> … … 129 130 <input type='hidden' name='action' value='addcurrency'/> 130 131 </form> 131 </body></html>132 132 """ % baseurl 133 133 self.out(html) … … 141 141 cdd,amount = self.getCurrency(currencyId) 142 142 html=""" 143 <html><body>144 143 <h2>Remove %s</h2> 145 144 <form action='%s' method='post'> … … 153 152 <input type='hidden' name='currencyId' value='%s'/> 154 153 </form> 155 </body></html>156 154 """ % (currencyId,baseurl,currencyId,amount,currencyId,baseurl,currencyId) 157 155 self.out(html) … … 179 177 currencyId = self.form.getfirst('currencyId','coin') 180 178 html=""" 181 <html><body>182 179 <h2>Get new coins</h2> 183 180 <form action='%s' method='post'> … … 190 187 <input type='hidden' name='currencyId' value='%s'/> 191 188 </form> 192 </body></html>193 194 189 """ % (baseurl,currencyId,currencyId) 195 190 self.out(html) … … 210 205 currencyId = self.form.getfirst('currencyId','coin') 211 206 html=""" 212 <html><body>213 207 <h2>Redeem coins</h2> 214 208 <form action='%s' method='post'> … … 221 215 <input type='hidden' name='currencyId' value='%s'/> 222 216 </form> 223 </body></html>224 217 225 218 """ % (baseurl,currencyId,currencyId) … … 232 225 reference = self.form.getfirst('reference') 233 226 url = self.form.getfirst('url') 234 url = 'http://%s' % url 227 if not url.startswith('http://'): 228 url = 'http://%s' % url 235 229 cid = self.form.getfirst('currencyId') 236 230 transport = transports.HTTPTransport(url) … … 243 237 currencyId = self.form.getfirst('currencyId','coin') 244 238 html=""" 245 <html><body>246 239 <h2>Pay someone</h2> 247 240 <form action='%s' method='post'> 248 241 Recipient<br/> 249 <input type='text' name='url' value=' 192.168.1.66:9091' /><br>242 <input type='text' name='url' value='http://192.168.1.66:9091' /><br> 250 243 How many <b>%ss</b><br> 251 244 <input type='number' name='amount' value='1' /><br> … … 257 250 <input type='hidden' name='currencyId' value='%s'/> 258 251 </form> 259 </body></html>260 261 252 """ % (baseurl,currencyId,currencyId) 262 253 self.out(html)
