{assign var="OnAlbumPage" value=1}
{include file="$blogtemplate/header.template"}

{assign var="postDate" value=$album->getTimestamp()}

<div class="post">
	<h2><a href="{$url->albumLink($album)}">{$album->getName()}</a></h2>
	<span class="alignleft">{$locale->tr("created")}: {$locale->formatDate($postDate,"%d %B, %Y")}</span><br />
	<div class="entry"><p>{$album->getDescription()}</p>

	<table style="border:2px;width:100%;border-color:blue;" summary="{$locale->tr("album")}">
		<tr>
			<td style="width:33%;" align="center" >
				<div class="gallery-thumb"><a href="{$url->parentAlbumLink($album)}"><img src="{$url->getTemplateFile('/images/greenfolder.png')}" alt="{$locale->tr("albums")}" /><br/>.. {$locale->tr("back")}</a></div>
			</td>
			{assign var="counter" value=1}
			{assign var=children value=$album->getChildren()}
			{foreach from=$children item=childalbum}
			<td style="width:33%;" align="center" >
				<div class="gallery-thumb"><a href="{$url->albumLink($childalbum)}"><img src="{$url->getTemplateFile('/images/greenfolder.png')}" alt="{$locale->tr("albums")}" /><br/>{$childalbum->getName()} ({$childalbum->getNumResources()})</a><br/><br/>{assign var="counter" value="`$counter+1`"}</div>
			</td>
		{if $counter%3 == 0}
		</tr>
		<tr>
		{/if}
		{/foreach}
		{foreach from=$resources item=resource}
			<td style="width:33%;" align="center" >
				<div class="gallery-thumb">
				{if $resource->hasPreview()}
					<a href="{$url->resourceDownloadLink($resource)}"><img alt="{$resource->getDescription()}" height="64" width="64" src="{$url->resourcePreviewLink($resource)}" /><br/>{$resource->getFileName()}</a>
				{else}
					<a href="{$url->resourceLink($resource)}">
				{if $resource->isSound()}
					<img alt="Sound" src="{$url->getTemplateFile('/images/sound.gif')}" />
				{elseif $resource->isVideo()}
					<img alt="Video" src="{$url->getTemplateFile('/images/video.gif')}" />
				{elseif $resource->isZip()}
					<img alt="Zip" src="{$url->getTemplateFile("/images/compressed.png")}" />
				{else}
					<img alt="File" src="{$url->getTemplateFile("/images/file.gif")}" />
				{/if}
					<br/>{$resource->getFileName()}</a>
				{/if}
					<br/>{assign var=metadata value=$resource->getMetadataReader()}{$metadata->getRoundedSize()}<br/>
				{if $resource->isImage()}
					{$metadata->getWidth()} x {$metadata->getHeight()}<br/>
				{elseif $resource->isSound()}
					{$metadata->getFormat()|upper} {$metadata->getSampleRate()} bps<br/>
				{elseif $resource->isVideo()}
					{$metadata->getFormat()|upper}{$metadata->getWidth()} x {$metadata->getHeight()},{$metadata->getLengthString()}<br/>
				{elseif $resource->isZip()}
					{$metadata->getTotalFiles()} {$locale->tr("files")}<br/>
				{/if}
					{assign var="counter" value="`$counter+1`"}
				</div>
			</td>
		{if $counter%3 == 0}
		</tr>
		<tr>
		{/if}
		{/foreach}
			<td></td>
		</tr>
	</table>
</div>
</div>
<div class="navigation">{pager style="links"}</div>
</div>
{include file="$blogtemplate/sidebar.template"}
{include file="$blogtemplate/footer.template"}