{*
 * $Revision: 15342 $
 * If you want to customize this file, do not edit it directly since future upgrades
 * may overwrite it.  Instead, copy it into a new directory called "local" and edit that
 * version.  Gallery will look for that file first and use it if it exists.
 *}
 
{* <div class="breadcrumb"> *}
	{* g->block type="core.BreadCrumb" skipRoot=true separator="/" *}
{* </div> *}
 
{*<h2>{$theme.item.title|markup}</h2>*}

{assign var="firstItem" value=true}

<div class="banner-cabeceras">
{foreach from=$theme.children item=child}
	{if !$child.canContainChildren}
			{if $user.isRegisteredUser}
				<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
			{/if}		
			
         {if isset($child.thumbnail)}
         	{g->image item=$child image=$child.thumbnail}
         {/if}

			{if $user.isRegisteredUser}
				</a>
			{/if}
	{/if}
{/foreach}
</div>



{* Description *}
{if !empty($theme.item.description)}
  <p>{$theme.item.description|markup}</p>
{/if}

{if !count($theme.children)}
  <div class="gallery-empty">
    <p><strong>{g->text text="This album is empty."}</strong></p>
    {if isset($theme.permissions.core_addDataItem)}
    <p><a href="{g->url arg1="view=core.ItemAdmin" arg2="subView=core.ItemAdd"
			arg3="itemId=`$theme.item.id`"}">{g->text text="Add a photo!"}</a></p>
    {/if}
  </div>
{else}

  {assign var="firstAlbum" value=true}

  {* Ponemos un valor raro para que no coincida con el caso en que no hay nada en el campo keyword *}
  	{assign var="currentKeywords" value="-----------------"} 
  {* *}
  
  {foreach from=$theme.children item=child}
    {if $child.canContainChildren}

      {* Keywords separator *}
		{capture name=keywords}{$child.keywords}{/capture}
		
		{if $smarty.capture.keywords != $currentKeywords}
  			{if !$firstAlbum}
			   </div> {* class="gallery-album" *}
    			</div> {* class="gallery-albums" *}
      		<div class="clear"></div>
  			{/if}
			
       	<div class="gallery-albums">
      	{if $firstAlbum}
				{assign var="firstAlbum" value=false}
			{else}
				<hr/>
			{/if}

			<h3>
				{if $smarty.capture.keywords == 'vanguardista'}
					{g->text text="L&iacute;nea vanguardista"}
				{else}
					{if $smarty.capture.keywords == 'moderna'}
						{g->text text="L&iacute;nea moderna"}
					{else}
						{if $smarty.capture.keywords == 'clasica'}
							{g->text text="L&iacute;nea clįsica"}
						{else}
							{$smarty.capture.keywords}
						{/if}
					{/if}
				{/if}
			</h3>
			<div class="gallery-album">
			
			{assign var="currentKeywords" value=$smarty.capture.keywords}
		{/if}
		
        <div class="gallery-thumb">
          <a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">
          {if isset($child.thumbnail)}
            {g->image item=$child image=$child.thumbnail}
          {else}
            {g->text text="no thumbnail"}
          {/if}
          </a>
		  <!--<p>{$child.keywords}</p>-->
        <!--<p>{if isset($child.summary)}{$child.summary|entitytruncate:256|markup}{/if}</p>-->
        </div>
   
	  {/if} {* if $child.canContainChildren *}
	
	{/foreach}

	{if !$firstAlbum}
	   </div> {* class="gallery-album" *}
  		</div> {* class="gallery-albums" *}
      <div class="clear"></div>
	{/if}
  
{/if}

{* Navigator *}
{if $theme.totalPages > 1}
{g->block type="core.Navigator" navigator=$theme.navigator prefix="&laquo; " suffix=" &raquo;"
	  currentPage=$theme.currentPage totalPages=$theme.totalPages}
{/if}

{if $user.isRegisteredUser}
	{* Show any other album blocks (comments, etc) *}
	{foreach from=$theme.params.albumBlocks item=block}
	  {g->block type=$block.0 params=$block.1}
	{/foreach}

	{* System Links only on the root page *}
	{*if empty($theme.parents)*}
		 <div class="gbSystemLinks">
    		{g->block type="core.SystemLinks"
	      	order="core.SiteAdmin core.YourAccount core.Login core.Logout"
	      	othersAt=4}
		  </div>
	{*/if*}

	{* Guest preview mode *}
	{g->block type="core.GuestPreview" class="gbBlock"}

	{* Our emergency edit link, if the user removes all blocks containing edit links *}
	{g->block type="core.EmergencyEditItemLink" class="gbBlock" checkBlocks="album"}
	
{/if}

