album/webapp/WEB-INF/velocity/photo.vm

77 lines
2.4 KiB
Text
Raw Normal View History

2008-11-24 19:54:24 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width = 600" />
<title>$entry.name</title>
<style type="text/css">
body {
font-size: 11px;
2009-01-12 01:11:24 +00:00
font-family: "Lucida Grande", "Lucida Sans", Arial, sans-serif;
2008-11-24 19:54:24 +00:00
color: #6d6d6d;
background: #acc95f;
margin: 10px auto;
text-align: center;
}
h1 {
text-align: left;
}
2008-11-24 19:54:24 +00:00
a:link, a:visited {
text-decoration: none;
color: #4c4c4c;
font-weight: 700;
}
a:hover, a:focus {
text-decoration: underline;
color: #6a6a6a;
}
div.photo {
align: center;
2009-01-12 01:11:24 +00:00
height: 200px;
}
div.grid {
float: left;
2009-01-12 01:11:24 +00:00
#set($divheight = $thmb + 50)
height: ${divheight}px;
2008-11-24 19:54:24 +00:00
}
img {
padding: 5px;
}
.nav {
border: 0 none;
padding: 0px;
vertical-align: middle;
}
2008-11-24 19:54:24 +00:00
</style>
</head>
<body>
#macro(navlink $entry)${base}$mapper.map(${entry.getPath()}).#if($entry.isFile())photo#{else}album#end#end
#macro(navbutton $entry $direction)#if($entry)<a href="#navlink($entry)"><img class="nav" width="26" height="32" src="${assets}/${direction}.png"/></a>#else<img class="nav" width="26" height="32" src="${assets}/${direction}-inactive.png"/>#end#end
<h1>#navbutton(${entry.prev()} "left")#navbutton(${entry.parent()} "up")#navbutton(${entry.next()} "right") $entry.name</h1>
<hr/>
#if($entry.isFile())
#set($dim = $entry.thumbnail.size.scaled($thmb))
#set($thpath = $mapper.map(${entry.thumbnail.getPath()}))
#set($enpath = $mapper.map(${entry.getPath()}))
2008-11-24 19:54:24 +00:00
<div class="photo">
<a href="${base}${enpath}"><img src="${base}${thpath}?size=$thmb" border="0" width="$dim.width" height="$dim.height"/></a><br/>
2008-11-24 19:54:24 +00:00
<span class="caption">$!entry.caption</span>
</div>
#else
2009-01-12 01:11:24 +00:00
#foreach($en in $entry.getContents())
#set($dim = $en.thumbnail.size.scaled($thmb))
#set($thpath = $mapper.map(${en.thumbnail.getPath()}))
<div class="grid">
<span class="name">$en.name</span><br/>
<a href="#navlink($en)"><img src="${base}${thpath}?size=${thmb}" border="0" width="${dim.width}" height="${dim.height}"/></a><br/>
<span class="caption">$!en.caption</span>
</div>
#end
#end
2008-11-24 19:54:24 +00:00
</body>
</html>