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:]
|
||||
|
|
|
@ -8,7 +8,7 @@ import Image
|
|||
|
||||
from scrapeit.utils import read_url
|
||||
|
||||
cache_root = join(abspath(__file__), 'cache')
|
||||
cache_root = join(dirname(abspath(__file__)), 'cache')
|
||||
img_extension = "png"
|
||||
|
||||
def loadFile(f_name):
|
||||
|
|
129
oilarchive/static/css/archive.css
Normal file
129
oilarchive/static/css/archive.css
Normal 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);
|
||||
}
|
BIN
oilarchive/static/images/backgroundBruegelChildren.jpg
Normal file
BIN
oilarchive/static/images/backgroundBruegelChildren.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 130 KiB |
BIN
oilarchive/static/images/itemIconLargeMouseOver.png
Normal file
BIN
oilarchive/static/images/itemIconLargeMouseOver.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
oilarchive/static/images/itemIconSmallMouseOver.png
Normal file
BIN
oilarchive/static/images/itemIconSmallMouseOver.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
oilarchive/static/images/transparent.png
Normal file
BIN
oilarchive/static/images/transparent.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
19
oilarchive/static/javascript/archive.js
Normal file
19
oilarchive/static/javascript/archive.js
Normal 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)';
|
||||
}
|
||||
}
|
|
@ -5,18 +5,31 @@
|
|||
<title>Oil of the 21st Century Archive</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 816px; margin-left: auto; margin-right: auto; margin-top: 96px; margin-bottom: 64px">
|
||||
<div py:for="item in items" class="icon">
|
||||
<div id="iconPoster${item.hashId}" class="iconPoster">
|
||||
<a href="/view/${item.hashId}">
|
||||
<img class="iconImage" src="/view/${item.hashId}/icon.jpg" onMouseOver="mouseOverIcon('${item.hashId}')" onMouseOut="mouseOutIcon('${item.hashId}')" />
|
||||
<div id="listBody">
|
||||
<div py:for="item in items" id="${item.hashId}" class="inline listItem">
|
||||
<div class="table">
|
||||
<a href="/view/${item.hashId}">
|
||||
<img src="/view/${item.hashId}/icon.png" class="listItemLink link" onMouseOver="mouseOver('${item.hashId}','IconLarge')" onMouseOut="mouseOut('${item.hashId}','IconLarge')" />
|
||||
</a>
|
||||
</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;">
|
||||
<span class="textBold">${XML(item.iconTitle)}</span><br /><span class="textGrey">${item.getPreview(sort)}</span>
|
||||
<div class="item">
|
||||
<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 style="height: 64px;"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
</style>
|
||||
<style type="text/css" media="screen">
|
||||
@import "/static/css/style.css";
|
||||
@import "/static/css/archive.css";
|
||||
</style>
|
||||
<script src="/static/js/archive.js" />
|
||||
|
||||
</head>
|
||||
|
||||
<body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'" py:attrs="item.items()">
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<img class="itemIcon" src="/view/${item.hashId}/icon.png" />
|
||||
<div class="author">${item.author}</div>
|
||||
<div class="title">${item.title}</div>
|
||||
<div class="description">${item.description}</div>
|
||||
<div class="description">${XML(item.html)}</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue