some output

This commit is contained in:
j 2007-03-30 16:04:36 +00:00
parent 0d3592374d
commit 90b66cff00
11 changed files with 186 additions and 23 deletions

View file

@ -23,28 +23,27 @@ class View:
return dict(item = item) return dict(item = item)
def icon(self, item): def icon(self, item):
response.headerMap['Content-Type'] = "image/jpeg" response.headerMap['Content-Type'] = "image/png"
return oilcache.loadIcon(item) return oilcache.loadIcon(item)
def icon_reflection(self, item): def icon_reflection(self, item):
response.headerMap['Content-Type'] = "image/jpeg" response.headerMap['Content-Type'] = "image/png"
return oilcache.loadIconReflection(item) return oilcache.loadIconReflection(item)
@expose() @expose()
def default(self, id, *args, **kw): def default(self, id, *args, **kw):
try: try:
item = ArchiveItem.byHashId(id) 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: except:
raise redirect("/") 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: class Admin:
@expose('.templates.admin_index') @expose('.templates.admin_index')
@ -205,10 +204,10 @@ class Root(controllers.RootController):
tg_template = ".templates.quoteview" tg_template = ".templates.quoteview"
orderBy = [self.get_sort(s), 'title_sort', 'title'] orderBy = [self.get_sort(s), 'title_sort', 'title']
items = []
if q: if q:
items = queryArchive(q) items = queryArchive(q)
//items = ArchiveItems.select(LIKE(ArchiveItems.q.text, '%' + q + '%'), orderBy = orderBy) else:
items = ArchiveItem.select(orderBy = orderBy)
sort = s sort = s
if sort.startswith('-'): if sort.startswith('-'):
sort = sort[1:] sort = sort[1:]

View file

@ -8,7 +8,7 @@ import Image
from scrapeit.utils import read_url from scrapeit.utils import read_url
cache_root = join(abspath(__file__), 'cache') cache_root = join(dirname(abspath(__file__)), 'cache')
img_extension = "png" img_extension = "png"
def loadFile(f_name): def loadFile(f_name):

View file

@ -0,0 +1,129 @@
body {
font-family: Lucida Grande;
font-size: 11px;
margin: 0px;
color: rgb(255, 255, 255);
background: url(/static/images/backgroundBruegelChildren.jpg) fixed;
}
img {
border: 0px;
}
select {
font-family: Lucida Grande;
font-size: 11px;
}
input {
font-family: Lucida Grande;
font-size: 11px;
}
.page {
width: 864px;
padding-top: 108px;
padding-bottom: 16px;
margin-left: auto;
margin-right: auto;
}
.table {
display: table-cell;
vertical-align: middle;
}
.link {
cursor: pointer;
}
.inline {
display: inline;
float: left;
}
.textLarge {
font-family: Lucida Grande;
font-weight: bold;
font-size: 12px;
}
.textIconLarge {
font-family: Lucida Grande;
font-weight: bold;
font-size: 9px;
}
.textIconSmall {
font-family: Lucida Grande;
font-weight: bold;
font-size: 8px;
}
.textGrey {
color: rgb(128, 128, 128);
}
.textXSmall {
font-family: Lucida Grande;
font-size: 8px;
}
.item {
position: relative;
left: 0px;
top: 0px;
width: 128px;
height: 56px;
padding-left: 8px;
padding-right: 8px;
padding-bottom: 8px;
text-align: center;
z-index: 1;
}
.itemText {
position: relative;
left: 1px;
top: -55px;
width: 128px;
height: 56px;
padding-left: 8px;
padding-right: 8px;
padding-bottom: 8px;
text-align: center;
z-index: 0;
}
#listBody {
width: 816px;
margin-left: auto;
margin-right: auto;
margin-top: 96px;
margin-bottom: 64px;
}
.listItem {
width: 144px;
height: 208px;
text-align: center;
overflow: hidden;
}
.listItem .table {
width: 128px;
height: 120px;
padding-left: 8px;
padding-right: 8px;
padding-top: 8px;
text-align: center;
vertical-align: bottom;
}
.listItemLink {
width: 128px;
height: 128px;
}
.item .textIconLarge {
color: rgb(0, 0, 0);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,19 @@
function mouseOver(id, view) {
if (view == 'IconLarge' || view == 'IconSmall')
document.getElementById(id).style.background = 'url(/static/images/item' + view + 'MouseOver.png)';
else {
document.getElementById(id + 'Left').style.background = 'url(/static/images/item' + view + 'LeftMouseOver.png)';
document.getElementById(id + 'Center').style.background = 'url(/static/images/item' + view + 'CenterMouseOver.png)';
document.getElementById(id + 'Right').style.background = 'url(/static/images/item' + view + 'RightMouseOver.png)';
}
}
function mouseOut(id, view) {
if (view == 'IconLarge' || view == 'IconSmall')
document.getElementById(id).style.background = 'url(/static/images/transparent.png)';
else {
document.getElementById(id + 'Left').style.background = 'url(/static/images/item' + view + 'LeftActive.png)';
document.getElementById(id + 'Center').style.background = 'url(/static/images/item' + view + 'CenterActive.png)';
document.getElementById(id + 'Right').style.background = 'url(/static/images/item' + view + 'RightActive.png)';
}
}

View file

@ -5,18 +5,31 @@
<title>Oil of the 21st Century Archive</title> <title>Oil of the 21st Century Archive</title>
</head> </head>
<body> <body>
<div style="width: 816px; margin-left: auto; margin-right: auto; margin-top: 96px; margin-bottom: 64px"> <div id="listBody">
<div py:for="item in items" class="icon"> <div py:for="item in items" id="${item.hashId}" class="inline listItem">
<div id="iconPoster${item.hashId}" class="iconPoster"> <div class="table">
<a href="/view/${item.hashId}"> <a href="/view/${item.hashId}">
<img class="iconImage" src="/view/${item.hashId}/icon.jpg" onMouseOver="mouseOverIcon('${item.hashId}')" onMouseOut="mouseOutIcon('${item.hashId}')" /> <img src="/view/${item.hashId}/icon.png" class="listItemLink link" onMouseOver="mouseOver('${item.hashId}','IconLarge')" onMouseOut="mouseOut('${item.hashId}','IconLarge')" />
</a> </a>
</div> </div>
<div id="iconText${it.imdb}" class="iconText textSmall" style="background: url(/view/${item.hashId}/icon_reflection.jpg); background-position: center top; background-repeat: no-repeat;"> <div class="item">
<span class="textBold">${XML(item.iconTitle)}</span><br /><span class="textGrey">${item.getPreview(sort)}</span> <img src="/static/images/transparent.png" class="link" style="width: 128px; height: 8px" onMouseOver="mouseOver('${item.hashId}','IconLarge')" onMouseOut="mouseOut('${item.hashId}','IconLarge')" />
<div class="link textIconLarge" onMouseOver="mouseOver('${item.hashId}','IconLarge')" onMouseOut="mouseOut('${item.hashId}','IconLarge')">
${item.title}
</div>
<div class="link textIconLarge textGrey" onMouseOver="mouseOver('${item.hashId}','IconLarge')" onMouseOut="mouseOut('${item.hashId}','IconLarge')">
${item.relDate}
</div>
</div>
<div class="itemText">
<div>
<span class="textIconLarge">${item.title}</span>
</div>
<div>
<span class="textIconLarge">${item.relDate}</span>
</div>
</div> </div>
</div> </div>
</div> </div>
<div style="height: 64px;"></div>
</body> </body>
</html> </html>

View file

@ -16,7 +16,10 @@
</style> </style>
<style type="text/css" media="screen"> <style type="text/css" media="screen">
@import "/static/css/style.css"; @import "/static/css/style.css";
@import "/static/css/archive.css";
</style> </style>
<script src="/static/js/archive.js" />
</head> </head>
<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()"> <body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">

View file

@ -11,7 +11,7 @@
<img class="itemIcon" src="/view/${item.hashId}/icon.png" /> <img class="itemIcon" src="/view/${item.hashId}/icon.png" />
<div class="author">${item.author}</div> <div class="author">${item.author}</div>
<div class="title">${item.title}</div> <div class="title">${item.title}</div>
<div class="description">${item.description}</div> <div class="description">${XML(item.html)}</div>
</div> </div>
</body> </body>
</html> </html>