diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 21:50:45 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-26 21:50:45 +0000 |
commit | 974f9f778891bbefeb083b2d97b3dae206c96452 (patch) | |
tree | 721c3c78bddb09c26ec306ae13e4093667961a97 /themes | |
parent | 4e8937ccefc95272442a9cd5ccb71aab01f113a1 (diff) |
Add a new "tag" page type.
Create the concept of "page types" which let us specify the kind of
page that we're rendering in high level terms. Currently there are
three page types: album, photo and tag.
The tag page type uses slightly different variables. It has a $tag
but no $item. Adjust all sidebar_block() functions to avoid printing
stuff that's dependent on the item if there is no item.
Simplify the tag code to stop trying to fake an item.
Update the theme slightly to use $item and $tag where appropriate
(notably, for making the <title> element).
Diffstat (limited to 'themes')
-rw-r--r-- | themes/default/views/header.html.php | 2 | ||||
-rw-r--r-- | themes/default/views/page.html.php | 12 | ||||
-rw-r--r-- | themes/default/views/tag.html.php | 31 |
3 files changed, 42 insertions, 3 deletions
diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index 1ca2a952..c34486be 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -14,9 +14,11 @@ <?= $theme->header_bottom() ?> +<? if ($page_type != "tag"): ?> <ul id="gBreadcrumbs" class="gClearFix"> <? foreach ($parents as $parent): ?> <li><a href="<?= url::site("albums/{$parent->id}") ?>"><?= $parent->title_edit ?></a></li> <? endforeach ?> <li class="active"><?= $item->title_edit ?></li> </ul> +<? endif ?> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index de0eff93..702595a6 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -4,7 +4,13 @@ <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" /> - <title><?= _("Browse Photos") ?> :: <?= $item->title ?></title> + <title> + <? if ($page_type == "tag"): ?> + <?= _("Browse Tags") ?> :: <?= $tag->name ?> + <? else: ?> + <?= _("Browse Photos") ?> :: <?= $item->title ?> + <? endif ?> + </title> <link rel="stylesheet" type="text/css" href="<?= url::file("lib/yui/reset-fonts-grids.css") ?>" media="screen,print,projection" /> <link rel="stylesheet" type="text/css" href="<?= $theme->url("css/screen.css") ?>" @@ -24,8 +30,8 @@ </head> <body> - <?= $theme->page_top() ?> - <div id="doc4" class="yui-t5 gView"> + <?= $theme->page_top() ?> + <div id="doc4" class="yui-t5 gView"> <div id="hd"> <div id="gHeader"> <?= $theme->display("header.html") ?> diff --git a/themes/default/views/tag.html.php b/themes/default/views/tag.html.php new file mode 100644 index 00000000..a4254e06 --- /dev/null +++ b/themes/default/views/tag.html.php @@ -0,0 +1,31 @@ +<? defined("SYSPATH") or die("No direct script access."); ?> +<div id="gAlbumHeader"> + <h1><?= $tag->name ?></h1> + <?= $theme->tag_top() ?> +</div> + +<ul id="gAlbumGrid"> + <? foreach ($children as $i => $child): ?> + <? $album_class = ""; ?> + <? if ($child->is_album()): ?> + <? $album_class = "gAlbum "; ?> + <? endif ?> + <li class="gItem <?= $album_class ?>"> + <?= $theme->thumbnail_top($child) ?> + <a href="<?= url::site("{$child->type}s/{$child->id}") ?>"> + <img id="gPhotoID-<?= $child->id ?>" class="gThumbnail" + alt="photo" src="<?= $child->thumbnail_url() ?>" + width="<?= $child->thumbnail_width ?>" + height="<?= $child->thumbnail_height ?>" /> + </a> + <h2><?= $child->title_edit ?></h2> + <?= $theme->thumbnail_bottom($child) ?> + <ul class="gMetadata"> + <?= $theme->thumbnail_info($child) ?> + </ul> + </li> + <? endforeach ?> +</ul> +<?= $theme->tag_bottom() ?> + +<?= $theme->pager() ?> |