moar prettiness
This commit is contained in:
parent
c92b5cdb68
commit
8b50c49a57
2 changed files with 17 additions and 7 deletions
23
mysecrets.py
23
mysecrets.py
|
@ -7,7 +7,7 @@ from web import form
|
|||
from urllib import urlopen
|
||||
from urlparse import urlparse
|
||||
from contextlib import closing
|
||||
|
||||
import time
|
||||
|
||||
db = web.database(dbn='mysql', user='mysecrets', pw='horsebatteries',
|
||||
db='mysecrets')
|
||||
|
@ -100,13 +100,15 @@ class index:
|
|||
body = "id: " + i.id + " deleted."
|
||||
|
||||
if not result:
|
||||
body = "id: " + i.id + " not deleted."
|
||||
|
||||
body = "id: " + i.id + " not deleted."
|
||||
|
||||
return render.page('Deleted ' + i.id, body)
|
||||
|
||||
|
||||
if method == 'new':
|
||||
|
||||
start = time.time()
|
||||
|
||||
i = web.input()
|
||||
|
||||
f = create()
|
||||
|
@ -140,9 +142,12 @@ class index:
|
|||
body.append('<tr><td><label for="password">Password</label></td>')
|
||||
body.append('<td><input id="password" type="text" name="password" \
|
||||
value="'+generated+'"/></td></tr>')
|
||||
body.append('<tr><td><input type="submit" name="submit" id="submit" /></td></tr>')
|
||||
body.append('<tr><td style="text-align:center;"><input type="submit" \
|
||||
name="submit" id="submit" value="Store Secret" /></td></tr>')
|
||||
body.append('</table></form>')
|
||||
|
||||
body.append('<p>Rendered in '+str(round(time.time()-start,3))+' seconds</p>')
|
||||
|
||||
return render.page(domain,'\n'.join(body))
|
||||
|
||||
|
||||
|
@ -177,16 +182,20 @@ class index:
|
|||
s.innerHTML='\
|
||||
.myS{\
|
||||
font-family:Georgia;\
|
||||
color:#000;\
|
||||
color:#3C3C3C;\
|
||||
text-align:center;\
|
||||
text-size:14px;\
|
||||
}\
|
||||
.myS iframe {\
|
||||
border: none;\
|
||||
}\
|
||||
.myS p {\
|
||||
color:#3C3C3C;\
|
||||
padding:10px;\
|
||||
}\
|
||||
.myS a {\
|
||||
text-decoration:none;\
|
||||
color:#00F;\
|
||||
color:#3C3C3C;\
|
||||
}\
|
||||
.myS a:hover{\
|
||||
text-decoration:underline;\
|
||||
|
@ -229,7 +238,7 @@ class index:
|
|||
e=document.createElement('p');
|
||||
e.className+='myS';
|
||||
e.onclick=function(){cleanHouse();};
|
||||
e.innerHTML='<a class="close">Close</a>';
|
||||
e.innerHTML='<a class="myS close">Close</a>';
|
||||
i.appendChild(e);
|
||||
|
||||
})();'''
|
||||
|
|
|
@ -60,6 +60,7 @@ $def with (title, body)
|
|||
font-family: Georgia;
|
||||
padding: 5px;
|
||||
font-size: 12px;
|
||||
color: #3C3C3C;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.3em;
|
||||
|
|
Reference in a new issue