[xiph-commits] r3847 - in arkaiv/trunk/arkaiv: config controllers lib templates
dcrowdy at svn.annodex.net
dcrowdy at svn.annodex.net
Thu Jan 22 19:53:28 PST 2009
Author: dcrowdy
Date: 2009-01-22 19:53:27 -0800 (Thu, 22 Jan 2009)
New Revision: 3847
Modified:
arkaiv/trunk/arkaiv/config/middleware.py
arkaiv/trunk/arkaiv/config/middleware.pyc
arkaiv/trunk/arkaiv/controllers/page.py
arkaiv/trunk/arkaiv/controllers/page.pyc
arkaiv/trunk/arkaiv/lib/helpers.py
arkaiv/trunk/arkaiv/lib/helpers.pyc
arkaiv/trunk/arkaiv/templates/addannodexform.mak
arkaiv/trunk/arkaiv/templates/collectionexpanded.mak
arkaiv/trunk/arkaiv/templates/collections.mak
arkaiv/trunk/arkaiv/templates/displayitem.mak
arkaiv/trunk/arkaiv/templates/playlists.mak
arkaiv/trunk/arkaiv/templates/searchresults.mak
Log:
url changed to url_for in search results
Modified: arkaiv/trunk/arkaiv/config/middleware.py
===================================================================
--- arkaiv/trunk/arkaiv/config/middleware.py 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/config/middleware.py 2009-01-23 03:53:27 UTC (rev 3847)
@@ -7,11 +7,12 @@
from pylons import config
from pylons.error import error_template
from pylons.middleware import error_mapper, ErrorDocuments, ErrorHandler, \
- StaticJavascripts
+ StaticJavascripts, StatusCodeRedirect
from pylons.wsgiapp import PylonsApp
from arkaiv.config.environment import load_environment
+
def make_app(global_conf, full_stack=True, **app_conf):
"""Create a Pylons WSGI application and return it
@@ -49,13 +50,25 @@
if asbool(full_stack):
# Handle Python exceptions
- app = ErrorHandler(app, global_conf, error_template=error_template,
- **config['pylons.errorware'])
+ app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
+
+ # Display error documents for 401, 403, 404 status codes (and
+ # 500 when debug is disabled)
+ if asbool(config['debug']):
+ app = StatusCodeRedirect(app)
+ else:
+ app = StatusCodeRedirect(app, [401, 403, 404, 500])
- # Display error documents for 401, 403, 404 status codes (and 500 when
- # debug is disabled)
- app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf)
+# if asbool(full_stack):
+# # Handle Python exceptions
+# app = ErrorHandler(app, global_conf, error_template=error_template,
+# **config['pylons.errorware'])
+#
+# # Display error documents for 401, 403, 404 status codes (and 500 when
+# # debug is disabled)
+# app = ErrorDocuments(app, global_conf, mapper=error_mapper, **app_conf)
+
# Establish the Registry for this application
app = RegistryManager(app)
Modified: arkaiv/trunk/arkaiv/config/middleware.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/controllers/page.py 2009-01-23 03:53:27 UTC (rev 3847)
@@ -237,7 +237,8 @@
# Now split off the extension
urlpath = os.path.splitext(urlpath[1])[0]
clipimageurl = media_url_base + os.path.dirname(urlpath) + "/"
- url = media_url_base + urlpath + ".anx"
+ #url = media_url_base + urlpath + ".anx"
+ url = media_url_base + urlpath + ".ogg"
if c.playclip=="":
sourcedict['clipdetail'] = ""
else:
Modified: arkaiv/trunk/arkaiv/controllers/page.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/lib/helpers.py
===================================================================
--- arkaiv/trunk/arkaiv/lib/helpers.py 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/lib/helpers.py 2009-01-23 03:53:27 UTC (rev 3847)
@@ -3,4 +3,16 @@
Consists of functions to typically be used within templates, but also available
to Controllers. This module is available to both as 'h'.
"""
-from webhelpers import *
+#from webhelpers import *
+#New stuff as we go to 0.9.7
+
+from webhelpers.html import escape, HTML, literal, url_escape
+from webhelpers.html.tags import *
+from webhelpers.date import *
+from webhelpers.text import *
+from webhelpers.html.converters import *
+from webhelpers.html.tools import *
+from webhelpers.util import *
+
+from webhelpers.rails.wrapped import *
+from routes import url_for
Modified: arkaiv/trunk/arkaiv/lib/helpers.pyc
===================================================================
(Binary files differ)
Modified: arkaiv/trunk/arkaiv/templates/addannodexform.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/addannodexform.mak 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/templates/addannodexform.mak 2009-01-23 03:53:27 UTC (rev 3847)
@@ -3,7 +3,7 @@
The page where data gets added.
-${ h.form(h.url(action='addannodexmedia'), multipart=True) }
+${ h.form(h.url_for(action='addannodexmedia'), multipart=True) }
<table>
<tr>
<td>Upload OGG file:</td>
Modified: arkaiv/trunk/arkaiv/templates/collectionexpanded.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/collectionexpanded.mak 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/templates/collectionexpanded.mak 2009-01-23 03:53:27 UTC (rev 3847)
@@ -5,7 +5,7 @@
% for item in c.items:
<li>
- ${ h.link_to(item['name'], h.url(action="displayitem", edit="no", id=item['index'])) }
+ ${ h.link_to(item['name'], h.url_for(action="displayitem", edit="no", id=item['index'])) }
</li>
% endfor
Modified: arkaiv/trunk/arkaiv/templates/collections.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/collections.mak 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/templates/collections.mak 2009-01-23 03:53:27 UTC (rev 3847)
@@ -5,13 +5,13 @@
% for coll in c.collections:
<li>
- ${ h.link_to(coll['name'], h.url(action="displaycollection", edit="no", id=coll['index'], name=coll['name'])) }
+ ${ h.link_to(coll['name'], h.url_for(action="displaycollection", edit="no", id=coll['index'], name=coll['name'])) }
</li>
% endfor
<hr>
Add new collection:
-${ h.form(h.url(action='addcollection'), multipart=True) }
+${ h.form(h.url_for(action='addcollection'), multipart=True) }
${ h.text_field('newcollection') }
${ h.submit('Add') }
${ h.end_form() }
Modified: arkaiv/trunk/arkaiv/templates/displayitem.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/displayitem.mak 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/templates/displayitem.mak 2009-01-23 03:53:27 UTC (rev 3847)
@@ -7,12 +7,13 @@
</script>
-${ h.form(h.url(action='deleteitem'), multipart=True) }
+${ h.form(h.url_for(action='deleteitem'), multipart=True) }
${ h.submit('Delete') }
${ h.hidden_field('itemid', value=c.itemid) }
${ h.end_form() }
- <embed type="application/liboggplay"
+# <embed type="application/ogg"
+ <embed type="application/x-vlc-plugin"
src="${c.sourcedict['urlpath']}${c.sourcedict['clipdetail']}"
width="320" height="240"/>
<form name="api">
@@ -46,7 +47,7 @@
<hr>
Head:
-${ h.form(h.url(action='editheadinfo'), multipart=True) }
+${ h.form(h.url_for(action='editheadinfo'), multipart=True) }
id:
${ h.text_field('headid', value=c.headdict['id']) }
Title:
@@ -78,7 +79,7 @@
</script>
</td>
<td>
-${ h.form(h.url(action='deletemeta'), multipart=True) }
+${ h.form(h.url_for(action='deletemeta'), multipart=True) }
${ h.submit('Delete') }
${ h.hidden_field('metaid', value=metainfo['index']) }
${ h.hidden_field('itemid', value=c.itemid) }
@@ -91,7 +92,7 @@
</table>
<hr>
Add new meta tag:
-${ h.form(h.url(action='addmetainfo'), multipart=True) }
+${ h.form(h.url_for(action='addmetainfo'), multipart=True) }
<table style="font-size:small">
<tr>
<td>Id</td>
@@ -166,7 +167,7 @@
<td>${clipinfo['a_href']}</td>
-${ h.form(h.url(action='deleteclip'), multipart=True) }
+${ h.form(h.url_for(action='deleteclip'), multipart=True) }
<td>${ h.submit('Delete') } </td>
${ h.hidden_field('clipid', value=clipinfo['ixc']) }
${ h.hidden_field('itemid', value=c.itemid) }
@@ -178,7 +179,7 @@
</table>
Add new clip:
-<!--${ h.form(h.url(action='addclip'), multipart=True) }-->
+<!--${ h.form(h.url_for(action='addclip'), multipart=True) }-->
<form name="addaclip" action="addclip" >
<table style="font-size:small">
<tr>
Modified: arkaiv/trunk/arkaiv/templates/playlists.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/playlists.mak 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/templates/playlists.mak 2009-01-23 03:53:27 UTC (rev 3847)
@@ -5,13 +5,13 @@
% for p in c.playlists:
<li>
-${ h.link_to(p['name'], h.url(action="displayplaylist", id=p['index'], name=p['name']))}
+${ h.link_to(p['name'], h.url_for(action="displayplaylist", id=p['index'], name=p['name']))}
</li>
% endfor
<hr>
Add new playlist:
-${ h.form(h.url(action='addplaylist'), multipart=True) }
+${ h.form(h.url_for(action='addplaylist'), multipart=True) }
${ h.text_field('newplaylist') }
${ h.submit('Add') }
${ h.end_form() }
Modified: arkaiv/trunk/arkaiv/templates/searchresults.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/searchresults.mak 2009-01-22 03:17:09 UTC (rev 3846)
+++ arkaiv/trunk/arkaiv/templates/searchresults.mak 2009-01-23 03:53:27 UTC (rev 3847)
@@ -17,7 +17,7 @@
% for item in c.items:
<tr>
<td>${item['index']}</td>
-<td>${ h.link_to(item['name'], h.url(action="displayitem", edit="no", id=item['index']))}</td>
+<td>${ h.link_to(item['name'], h.url_for(action="displayitem", edit="no", id=item['index']))}</td>
<td><input type='checkbox' name='${i}' value='${item['index']}'></td>
</tr>
<%
@@ -48,7 +48,7 @@
<tr>
<td>${meta['name']}</td>
<td>${meta['content']}</td>
-<td>${ h.link_to(meta['itemname'], h.url(action="displayitem", edit="no", id=meta['itemindex']))}</td>
+<td>${ h.link_to(meta['itemname'], h.url_for(action="displayitem", edit="no", id=meta['itemindex']))}</td>
<td><input type='checkbox' name='${i}' value='${meta['itemindex']}'></td>
</tr>
<%
@@ -79,7 +79,7 @@
<tr>
<td>${clip['id']}</td>
<td>${clip['itemname']}</td>
-<td>${ h.link_to(clip['desc'], h.url(action="displayitem", edit="no", id=clip['itemindex'], playclip=clip['id']))}</td>
+<td>${ h.link_to(clip['desc'], h.url_for(action="displayitem", edit="no", id=clip['itemindex'], playclip=clip['id']))}</td>
<td><input type='checkbox' name='${i}' value='${clip['index']}'></td>
</tr>
<%
More information about the commits
mailing list