diff --git a/oilarchive/controllers.py b/oilarchive/controllers.py index c99bfd1..87fdda0 100644 --- a/oilarchive/controllers.py +++ b/oilarchive/controllers.py @@ -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:] diff --git a/oilarchive/oilcache.py b/oilarchive/oilcache.py index 9be845d..253debd 100644 --- a/oilarchive/oilcache.py +++ b/oilarchive/oilcache.py @@ -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): diff --git a/oilarchive/static/css/archive.css b/oilarchive/static/css/archive.css new file mode 100644 index 0000000..1cc554f --- /dev/null +++ b/oilarchive/static/css/archive.css @@ -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); +} \ No newline at end of file diff --git a/oilarchive/static/images/backgroundBruegelChildren.jpg b/oilarchive/static/images/backgroundBruegelChildren.jpg new file mode 100644 index 0000000..18446b0 Binary files /dev/null and b/oilarchive/static/images/backgroundBruegelChildren.jpg differ diff --git a/oilarchive/static/images/itemIconLargeMouseOver.png b/oilarchive/static/images/itemIconLargeMouseOver.png new file mode 100644 index 0000000..7fe3fdb Binary files /dev/null and b/oilarchive/static/images/itemIconLargeMouseOver.png differ diff --git a/oilarchive/static/images/itemIconSmallMouseOver.png b/oilarchive/static/images/itemIconSmallMouseOver.png new file mode 100644 index 0000000..1eea5c8 Binary files /dev/null and b/oilarchive/static/images/itemIconSmallMouseOver.png differ diff --git a/oilarchive/static/images/transparent.png b/oilarchive/static/images/transparent.png new file mode 100644 index 0000000..cde9090 Binary files /dev/null and b/oilarchive/static/images/transparent.png differ diff --git a/oilarchive/static/javascript/archive.js b/oilarchive/static/javascript/archive.js new file mode 100644 index 0000000..cf8376d --- /dev/null +++ b/oilarchive/static/javascript/archive.js @@ -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)'; + } +} \ No newline at end of file diff --git a/oilarchive/templates/iconview.kid b/oilarchive/templates/iconview.kid index 136fbb3..205fefc 100644 --- a/oilarchive/templates/iconview.kid +++ b/oilarchive/templates/iconview.kid @@ -5,18 +5,31 @@ Oil of the 21st Century Archive -
-
-
- - +
+
+ -
- ${XML(item.iconTitle)}
${item.getPreview(sort)} +
+ + + +
+
+
+ ${item.title} +
+
+ ${item.relDate} +
-
diff --git a/oilarchive/templates/master.kid b/oilarchive/templates/master.kid index cd0cf41..fc524f6 100644 --- a/oilarchive/templates/master.kid +++ b/oilarchive/templates/master.kid @@ -16,7 +16,10 @@ +