Convert history?as_xml to use a mako template.

This commit is contained in:
James Taylor
2008-04-25 16:40:07 +00:00
parent 55ed2aa6d1
commit 2e45325b9b
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -84,11 +84,11 @@ class Universe( BaseController ):
return self.history_new(trans)
if as_xml:
trans.response.set_content_type('text/xml')
template = "history.xml"
return trans.fill_template_mako( "root/history_as_xml.mako", history=history )
else:
template = "root/history.mako"
mode = trans.get_cookie(name=self.pref_cookie_name)
return trans.fill_template(template, history=history, mode=mode )
mode = trans.get_cookie( name=self.pref_cookie_name )
return trans.fill_template( "root/history.mako", history=history, mode=mode )
@web.expose
def display(self, trans, id=None, hid=None, tofile=None, toext=".txt"):
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0"?>
<history>
#for $data in $history.active_datasets
<data id="$data.id" hid="$data.hid" name="$data.name" state="$data.state" dbkey="$data.dbkey">
$data.blurb
</data>
#end for
</history>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<history>
%for data in history.active_datasets:
<data id="${data.id}" hid="${data.hid}" name="${data.name}" state="${data.state}" dbkey="${data.dbkey}">
${data.blurb}
</data>
%endfor
</history>