diff options
Diffstat (limited to 'site/app/views/addons/category_landing.thtml')
-rw-r--r-- | site/app/views/addons/category_landing.thtml | 299 |
1 files changed, 172 insertions, 127 deletions
diff --git a/site/app/views/addons/category_landing.thtml b/site/app/views/addons/category_landing.thtml index db0764c..5cff14d 100644 --- a/site/app/views/addons/category_landing.thtml +++ b/site/app/views/addons/category_landing.thtml @@ -37,142 +37,187 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - -$this->viewVars['bodyclass'] = 'inverse category_landing'; -$this->layout = 'amo2009'; - -$curr_tag_name = $this_tag['Translation']['name']['string']; -$curr_tag_desc = $this_tag['Translation']['description']['string']; - -$nameLimit = 40; -$summaryLimit = 70; ?> -<div class="stand-alone-options"> - <?=$this->renderElement('amo2009/categories')?> - <?=$this->renderElement('amo2009/search')?> -</div> -<div class="primary" role="main"> +<div id="content" class="landing landing-with-slider"> - <h2><?php echo $curr_tag_name ?></h2> +<?=$this->renderElement('search', array('category' => + array($this_tag['Tag']['addontype_id'], $this_tag['Tag']['id'])))?> - <div id="featured_addons" class="clearfix"> - <ul> - <?php foreach ($featured_addons as $addon): ?> - - <li class="addon_block_wrapper"> - <div class="addon_block item"> - <h4 class="name"><a href="<?=$html->url("/addon/{$addon['Addon']['id']}")?>"><?php echo $html->truncateChars(28, $addon['Translation']['name']['string'], true) ?></a></h4> - <p class="authors"><?=_('addons_home_by')?> <?=$html->linkUsersFromModel($addon['User'], 2,"/addon/{$addon['Addon']['id']}#authors" );?></p> - <p class="summary"><?php echo $html->truncateChars($summaryLimit, $addon['Translation']['summary']['string'], true) ?></p> - <div class="preview"><a href="<?=$html->url("/addon/{$addon['Addon']['id']}")?>"><img src="<?php echo $this->controller->Image->getHighlightedPreviewURL($addon['Addon']['id']);?>" alt="" /></a></div> - <p class="rating"><?=$this->renderElement('amo2009/stars',array('rating' => $addon['Addon']['averagerating']))?></p> - <?php - $addonIconPath = $this->controller->Image->getAddonIconURL($addon['Addon']['id']); - $addonID = $addon['Addon']['id']; - $addonName = $addon['Translation']['name']['string']; - $hasVersion = (isset($addon['Version']) && !empty($addon['Version'])); - $addonVersion = ($hasVersion ? $addon['Version'][0]['version'] : ''); - $hasFiles = ($hasVersion && !empty($addon['File'])); - if ($hasFiles) { - $addonFiles = $addon['File']; - $addonEULA = $addon['Translation']['eula']['string']; - - - $addonCreators = $addon['User']; - $addonSummary = $addon['Translation']['summary']['string']; +<div id="content-main"> + + <div id="content-extra"> + <div class="more-addons"> + <h3><?=$html->link(sprintf(_('category_extra_see_all'), $this_tag['Translation']['name']['string']), + "/browse/type:{$type_id}/cat:{$cat_id}?sort=name", + array('class'=>'view'))?></h3> + + <ul> + <?php + $sortorders = array( + 'popular' => _('category_extra_mostpopular'), + 'rated' => _('category_extra_highestrated'), + 'updated' => _('category_extra_lastupdated'), + ); + foreach ($sortorders as $sortkey => $title): + ?> + <li><?=$html->link($title, + "/browse/type:{$type_id}/cat:{$cat_id}?sort={$sortkey}", + array('class'=>'view'))?></li> + <?php endforeach; ?> + <li><?=$html->link(_('category_extra_allrecommended'), + "/recommended/cat:{$cat_id}", array('class'=>'view'))?></li> + </ul> + </div> + + <?=$this->renderElement('pitch'); ?> + </div><!-- /#content-extra --> - // prepare preview image - if (isset($addonPreviewPath) && !empty($addonPreviewPath)) { - $_alt = sprintf(_('img_preview_of'),$addonName); - $previmg = '<img src="'.$addonPreviewPath.'" ' - .'alt="'.$_alt.'" title="'.$_alt.'"/>'; - $previmg = '<p class="preview-img">' - .$html->link($previmg, "/addon/{$addonID}").'</p>'; - } else - $previmg = ''; - // prepare icon - if (isset($addonIconPath) && !empty($addonIconPath)) - $icon = '<img src="'.$addonIconPath.'" class="icon" alt=""/>'; - else - $icon = ''; + <?php if (!empty($featureAddons)): ?> + <!-- <div> --> + <div id="recommended"> + <h3><?=_('addons_home_feature_head')?></h3> - // prepare categories - if (!empty($addon['Tag'])) { - $categories = $this->renderElement('addon_categories', array('tags' => $addon['Tag'])); - } else - $categories = ''; + <div id="slider" class="slider_widget"> + <div class="inner"> + <div class="viewport"> + <ul class="item_set"> + <?php + $idx = 0; + $total_features = count( $featureAddons ); + foreach ( $featureAddons as $feature1 ) { + $idx++; - // prepare summary - if (!isset($addonSummary) || empty($addonSummary)) - $addonSummary = ' '; + $prev_idx = $idx - 1; + if ($prev_idx < 1) + $prev_idx = $total_features; + $next_idx = $idx + 1; + if ($next_idx > $total_features) + $next_idx = 1; - $_install_render_options = array( - 'addonIconPath' => $addonIconPath, - 'addonName' => $addonName, - 'addonId' => $addonID, - 'addonFiles' => $addonFiles, - 'addonEULA' => $addonEULA, - 'addonStatus' => $addon['Addon']['status'], - 'is_latest' => ($addon['Addon']['status'] == STATUS_PUBLIC), - 'addonType' => $addon['Addon']['addontype_id'], - 'compatible_apps' => $addon['compatible_apps'], - 'allPlatforms' => $platforms, - 'buttonType' => 'small', - 'showInstructions' => false - ); - echo $this->renderElement('amo2009/install', $_install_render_options); - - } - ?> + ?> + <li id="feature1_<?=$idx?>" class="item addon featured main"> + <?=$this->renderElement('feature', array( + 'addonIconPath' => $this->controller->Image->getAddonIconURL($feature1['Addon']['id']), + 'addonThumbPath' => $this->controller->Image->getHighlightedPreviewURL($feature1['Addon']['id']), + 'addonName' => $feature1['Translation']['name']['string'], + 'addonSummary' => $feature1['Translation']['summary']['string'], + 'addonId' => $feature1['Addon']['id'], + 'addonFiles' => $feature1['File'], + 'addonEULA' => $feature1['Translation']['eula']['string'], + 'addonStatus' => $feature1['Addon']['status'], + 'addonAuthors' => $feature1['User'], + 'addonTags' => $feature1['Tag'], + 'addonWeeklyDownloads' => $feature1['Addon']['weeklydownloads'], + 'allPlatforms' => $platforms, + 'compatible_apps' => $feature1['compatible_apps'], + 'addonType' => $feature1['Addon']['addontype_id'], + 'addonRating' => $feature1['Addon']['averagerating'], + 'addonReviews' => $feature1['Addon']['totalreviews'], + 'addonVersionCreated' => $feature1['Version'][0]['created'] + ))?> + </li> + <?php + } ?> + </ul> + </div> + <div class="controls"> + <div class="controls_inner"> + <a href="#slider" title="Previous" class="prev"> + <img src="<?=$html->urlImage("slider-prev-disabled.gif")?>" + width="30" height="30" alt="<?=___('addon_slider_tooltip_previous', 'Previous Add-on')?>" + title="<?=___('addon_slider_tooltip_previous', 'Previous Add-on')?>" /> + </a> + <span class="indicator"> + <span class="index">1</span> + / + <span class="total"><?=$total_features?></span> + </span> + <a href="#slider" title="Next" class="next"> + <img src="<?=$html->urlImage("slider-next.gif")?>" + width="30" height="30" alt="<?=___('addon_slider_tooltip_next', 'Next Add-on')?>" + title="<?=___('addon_slider_tooltip_next', 'Next Add-on')?>" /> + </a> </div> - </li> - <?php endforeach ?> - </ul> - </div> - - <div id="new_addons" class="addons_column clearfix"> - <h3><span><?= ___('addons_recently_added') ?></span></h3> - <ul> - <?php foreach ($new_addons as $idx=>$addon): ?> - <li class="<?= (0 == ($idx % 2)) ? 'odd' : 'even' ?>"><a href="<?=$html->url("/addon/{$addon['id']}")?>"> - <img class="icon" src="<?php echo $addon['icon_url']?>" width="32" height="32" alt="" /> - <span class="name"><?php echo $html->truncateChars($nameLimit, $addon['name'], true) ?></span> - <span class="meta created"> - added <?php echo strftime('%m/%d/%Y', strtotime($addon['created'])) ?> - </span> - </a></li> - <?php endforeach ?> - </ul> - <p class="view-all"><?=$html->link(___('view_recently_added').' »',"/browse/type:{$type_id}/cat:{$cat_id}?sort=newest")?></p> - </div> + </div> + </div> + <div class="vex"><span><!-- bottom edge --></span></div> + </div> + </div><!-- /#recommended --> + <?php endif; /* !empty(recommended) */ ?> - <div id="popular_addons" class="addons_column clearfix"> - <h3><span><?=___('addons_top_downloads') ?></span></h3> - <ul> - <?php foreach ($popular_addons as $idx=>$addon): ?> - <li class="<?= (0 == ($idx % 2)) ? 'odd' : 'even' ?>"><a href="<?=$html->url("/addon/{$addon['id']}")?>"> - <img class="icon" src="<?php echo $addon['icon_url']?>" width="32" height="32" alt="" /> - <span class="name"><?php echo $html->truncateChars($nameLimit, $addon['name'], true) ?></span> - <span class="meta downloads"><?php echo $html->number_format($addon['weeklydownloads']) ?> <?= _('addon_downloads_weekly') ?></span> - </a></li> - <?php endforeach ?> - </ul> - <p class="view-all"><?=$html->link(___('view_top_downloads').' »',"/browse/type:{$type_id}/cat:{$cat_id}?sort=popular")?></p> - </div> + <?php if (FALSE && !empty($featureAddons)): ?> + <div id="recommended"> + <h3><?=_('addons_home_feature_head')?></h3> + <?php + foreach($featureAddons as $id => $addon): + ?> + <div id="feature<?=$id+1?>" class="addon main"> + <?=$this->renderElement('feature', array( + 'addonIconPath' => $this->controller->Image->getAddonIconURL($addon['Addon']['id']), + 'addonThumbPath' => $this->controller->Image->getHighlightedPreviewURL($addon['Addon']['id']), + 'addonName' => $addon['Translation']['name']['string'], + 'addonSummary' => $addon['Translation']['summary']['string'], + 'addonId' => $addon['Addon']['id'], + 'addonFiles' => $addon['File'], + 'addonEULA' => $addon['Translation']['eula']['string'], + 'addonAuthors' => $addon['User'], + 'addonWeeklyDownloads' => $addon['Addon']['weeklydownloads'], + 'allPlatforms' => $platforms, + 'compatible_apps' => $addon['compatible_apps'], + 'addonType' => $addon['Addon']['addontype_id'], + 'addonRating' => $addon['Addon']['averagerating'], + 'addonReviews' => $addon['Addon']['totalreviews'], + 'addonVersionCreated' => $addon['Version'][0]['created'] + ))?> + <div class="vex"><span><!-- bottom edge --></span></div> + </div> + <?php endforeach; ?> + </div><!-- /#recommended --> + <?php endif; /* !empty(recommended) */ ?> + + <?php if (!empty($randomAddons)): ?> + <div id="secondaries"> + <?php + global $experimental_status; + $is_first = TRUE; + foreach($randomAddons as $id => $addon): + $idx = count($featureAddons) + $id + 1; + if (in_array($addon['Addon']['status'], $experimental_status)) + $extraclass = ' exp'; + else + $extraclass = ''; + if ($is_first) { + $is_first = FALSE; $extraclass = ' first'; + } + ?> + <div id="feature<?=$idx?>" class="addon sub<?=$extraclass?>"> + <div class="irk"> + <?=$this->renderElement('feature', array( + 'addonIconPath' => $this->controller->Image->getAddonIconURL($addon['Addon']['id']), + 'addonThumbPath' => $this->controller->Image->getHighlightedPreviewURL($addon['Addon']['id']), + 'addonName' => $addon['Translation']['name']['string'], + 'addonSummary' => $addon['Translation']['summary']['string'], + 'addonId' => $addon['Addon']['id'], + 'addonEULA' => $addon['Translation']['eula']['string'], + 'addonStatus' => $addon['Addon']['status'], + 'addonAuthors' => $addon['User'], + 'addonWeeklyDownloads' => $addon['Addon']['weeklydownloads'], + 'allPlatforms' => $platforms, + 'addonType' => $addon['Addon']['addontype_id'], + 'addonRating' => $addon['Addon']['averagerating'], + 'addonReviews' => $addon['Addon']['totalreviews'] + ))?> + </div> + <div class="vex"><span><!-- bottom edge --></span></div> + </div> + <?php endforeach; ?> + </div><!-- /#secondaries --> + <?php endif; /* !empty(random) */ ?> - <div id="updated_addons" class="addons_column last clearfix"> - <h3><span><?=___('addons_top_rated') ?></span></h3> - <ul> - <?php foreach ($updated_addons as $idx=>$addon): ?> - <li class="<?= (0 == ($idx % 2)) ? 'odd' : 'even' ?>"><a href="<?=$html->url("/addon/{$addon['id']}")?>"> - <img class="icon" src="<?php echo $addon['icon_url']?>" width="32" height="32" alt="" /> - <span class="name"><?php echo $html->truncateChars($nameLimit, $addon['name'], true) ?></span> - <span class="meta rating"><?=$this->renderElement('amo2009/stars',array('rating' => $addon['averagerating']))?></span> - </a></li> - <?php endforeach ?> - </ul> - <p class="view-all"><?=$html->link(___('view_top_rated').' »',"/browse/type:{$type_id}/cat:{$cat_id}?sort=rated")?></p> - </div> +</div><!-- /#content-main --> -</div> +<?=$this->renderElement('sidebar', array('highlight' => + array($this_tag['Tag']['addontype_id'], $this_tag['Tag']['id'])))?> +<?=$this->renderElement('app_chooser')?> +</div><!-- /#content --> |