some output
This commit is contained in:
parent
0d3592374d
commit
90b66cff00
11 changed files with 186 additions and 23 deletions
|
|
@ -23,28 +23,27 @@ class View:
|
|||
return dict(item = item)
|
||||
|
||||
def icon(self, item):
|
||||
response.headerMap['Content-Type'] = "image/jpeg"
|
||||
response.headerMap['Content-Type'] = "image/png"
|
||||
return oilcache.loadIcon(item)
|
||||
|
||||
def icon_reflection(self, item):
|
||||
response.headerMap['Content-Type'] = "image/jpeg"
|
||||
response.headerMap['Content-Type'] = "image/png"
|
||||
return oilcache.loadIconReflection(item)
|
||||
|
||||
@expose()
|
||||
def default(self, id, *args, **kw):
|
||||
try:
|
||||
item = ArchiveItem.byHashId(id)
|
||||
if not args:
|
||||
return self.view(item)
|
||||
elif args[0] == 'icon.jpg':
|
||||
return self.icon(item)
|
||||
elif args[0] == 'icon_reflection.jpg':
|
||||
return self.icon_reflection(item)
|
||||
elif args[0] == 'json':
|
||||
return item.json
|
||||
|
||||
except:
|
||||
raise redirect("/")
|
||||
if not args:
|
||||
return self.view(item)
|
||||
elif args[0].startswith('icon.'):
|
||||
return self.icon(item)
|
||||
elif args[0].startswith('icon_reflection.'):
|
||||
return self.icon_reflection(item)
|
||||
elif args[0] == 'json':
|
||||
return item.json
|
||||
|
||||
class Admin:
|
||||
@expose('.templates.admin_index')
|
||||
|
|
@ -205,10 +204,10 @@ class Root(controllers.RootController):
|
|||
tg_template = ".templates.quoteview"
|
||||
|
||||
orderBy = [self.get_sort(s), 'title_sort', 'title']
|
||||
items = []
|
||||
if q:
|
||||
items = queryArchive(q)
|
||||
//items = ArchiveItems.select(LIKE(ArchiveItems.q.text, '%' + q + '%'), orderBy = orderBy)
|
||||
else:
|
||||
items = ArchiveItem.select(orderBy = orderBy)
|
||||
sort = s
|
||||
if sort.startswith('-'):
|
||||
sort = sort[1:]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue