[svn r1593] Update to use user's preferences. xbelweb
authorfabien
Sun, 12 Oct 2003 10:55:22 -0400
branchxbelweb
changeset 42 6d31ed0f6ad3
parent 41 7b7cd0e74ee3
child 43 4d194fce51e1
[svn r1593] Update to use user's preferences.
add.py
add_bk.tmpl
edit.py
--- a/add.py	Fri Oct 10 11:38:20 2003 -0400
+++ b/add.py	Sun Oct 12 10:55:22 2003 -0400
@@ -11,16 +11,16 @@
 
 # import cgitb; cgitb.enable()
 import cgi
-from htmltmpl import TemplateManager, TemplateProcessor
+from htmltmpl import TemplateManager
+from webutils import get_template_processor;
 import my_db
 import time
 from bkmark import Bookmark
 import os
 
-def main(keywords, title, url):
+def main(keywords, title, url, prefs):
     tmpl = TemplateManager().prepare("add_bk.tmpl")
-    tproc = TemplateProcessor()
-    tproc.set("pagetitle", os.environ["REMOTE_USER"]+"'s XBELWeb Edit Bookmark")
+    tproc = get_template_processor(prefs)
     tproc.set('ctitle', title)
     tproc.set('curl', url)
     tproc.set('desc', '')
@@ -42,4 +42,4 @@
    	 'id' : elem[0],
 	 'keyword' : elem[1],
     	 'checked' : 0 }, kw)
-    main(kw, name, url)
+    main(kw, name, url, db.get_preferences())
--- a/add_bk.tmpl	Fri Oct 10 11:38:20 2003 -0400
+++ b/add_bk.tmpl	Sun Oct 12 10:55:22 2003 -0400
@@ -1,7 +1,7 @@
 <html>
   <TMPL_INCLUDE NAME="headers.tmpl">
   <body>
-    <h1><TMPL_VAR pagetitle></h1>
+    <h1><TMPL_VAR remote_user>'s Edit Bookmark</h1>
     <form action="add_confirm.py" method="post" name="add">
       <fieldset class="bookmark">
         <input type="hidden" name="id" value="<TMPL_VAR bkid>"/>
--- a/edit.py	Fri Oct 10 11:38:20 2003 -0400
+++ b/edit.py	Sun Oct 12 10:55:22 2003 -0400
@@ -15,12 +15,12 @@
 import my_db
 import time
 from bkmark import Bookmark
+from webutils import get_template_processor;
 import os
 
-def main(keywords, bk):
+def main(keywords, bk, prefs):
     tmpl = TemplateManager().prepare("add_bk.tmpl")
-    tproc = TemplateProcessor()
-    tproc.set("pagetitle", os.environ["REMOTE_USER"]+"'s XBELWeb Confirmation")
+    tproc = get_template_processor(prefs)
     tproc.set('ctitle', bk.name)
     tproc.set('curl', bk.url)
     tproc.set('desc', bk.desc)
@@ -40,4 +40,4 @@
    	 'id' : elem[0],
    	 'keyword' : elem[1],
 	 'selected' : elem[0] in ids }, kw)
-    main(kw, bk)
+    main(kw, bk, db.get_preferences())