<?php
/**
 * Avalanche for Magento 1.8+
 * Designed by Fast Division (http://fastdivision.com)
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file license.txt.
 * It is also available through the world-wide-web at this URL:
 * http://fastdivision.com/legal/license.txt
 *
 * @author     Fast Division
 * @version    1.5.0
 * @copyright  Copyright 2013 Fast Division
 * @license    http://fastdivision.com/legal/license.txt
 */
?>
<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>
<div id="content" class="category-products">
	<p style="padding:10px"><?php echo $this->__('There are no products matching the selection.') ?></p>
</div>
<?php else: ?>
<div class="toolbar">
	<?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/toolbar.phtml')->toHtml(); ?>
</div>
<div id="catalog-breadcrumbs" class="breadcrumbs">
	<?php echo $this->getLayout()->createBlock('catalog/layer_state')->setTemplate('catalog/layer/state.phtml')->toHtml(); ?>
</div>
<div id="content" class="category-products">
    <div class="catalog-page">
    	<ul class="product-list">
    	<?php foreach ($_productCollection as $_product): ?>
            <li class="clearfix">
				<div class="list-image<?php if(!$_product->isSaleable()) { ?> unavailable<?php } ?>">
		            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(80)->setQuality(Mage::getStoreConfig('avalanche_mobile/design/jpeg_compression')); ?>" width="80" height="80" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
				</div>
				<div class="list-details">
					<?php if($_product->getRatingSummary()): ?>
		                <div class="list-rating">
		                	<?php echo $this->getReviewsSummaryHtml($_product) ?>
		                </div>
		            <?php endif; ?>
					<div class="list-title">
						<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
						<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a>
						<?php if(!$_product->isSaleable()): ?>
						    <div class="grid-availability"><?php echo $this->__('Out Of Stock') ?></div>
						<?php endif; ?>
					</div>
					<div class="list-price">
						<?php echo $this->getPriceHtml($_product, true) ?>
					</div>
				</div>
            </li>
        <?php endforeach ?>
        </ul>  
    </div>
</div>
<div class="toolbar">
	<?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/toolbar_bottom.phtml')->toHtml(); ?>
</div>
<?php endif; ?>