{strip}
<div class="listing stock">
	<header>
		<div class="floaticon">
			{if $gBitUser->hasPermission('p_stock_create')}
				<a href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php">{biticon ipackage="icons" iname="view-list-icons" iexplain="Create Assembly"}</a>
			{/if}
			{minifind prompt="Assemblies"}
		</div>
		<h1>{tr}Assemblies{/tr}{if $gQueryUserId} {tr}by{/tr} {displayname user_id=$gQueryUserId}{/if}</h1>
	</header>

	<section class="body">
		<ul class="list-inline sortby">
			<li>{biticon ipackage="icons" iname="go-next" iexplain="sort by"}</li>
			{if $gBitSystem->isFeatureActive('stock_list_title')}
				<li>{smartlink ititle="Gallery Name" isort="title" user_id=$gQuerUserId offset=$iMaxRows home=$userInfo.login search=$iSearchString}</li>
			{/if}
			{if $gBitSystem->isFeatureActive('stock_list_user')}
				<li>{smartlink ititle="Owner" isort=$gBitSystem->getConfig('users_display_name') user_id=$gQuerUserId offset=$iMaxRows home=$userInfo.login search=$iSearchString}</li>
			{/if}
			{if $gBitSystem->isFeatureActive('stock_list_created')}
				<li>{smartlink ititle="Created" isort="created" user_id=$gQuerUserId offset=$iMaxRows home=$userInfo.login search=$iSearchString}</li>
			{/if}
			{if $gBitSystem->isFeatureActive('stock_list_lastmodif')}
				<li>{smartlink ititle="Last Modified" isort="last_modified" user_id=$gQuerUserId offset=$iMaxRows home=$userInfo.login search=$iSearchString}</li>
			{/if}
			{if $gBitSystem->isFeatureActive('stock_list_hits')}
				<li>{smartlink ititle="Hits" isort="hits" user_id=$gQuerUserId offset=$iMaxRows home=$userInfo.login search=$iSearchString}</li>
			{/if}
		</ul>

		<div class="form-group">
			<div class="row galleries">
				{* math assign=quarterValue equation="round(c/4)" c=$galleryList|count *}
				{foreach from=$galleryList key=galleryId item=gal}
				<div class="col-xs-6 col-sm-4 col-md-3 ">
					<div class="{$gal.content_type_guid} thumbnail">
						{if $gBitSystem->isFeatureActive('stock_list_thumbnail') && $gal.display_url}
							{assign var=thumbnailUri value=$gBitSystem->getParameter( $gal, 'thumbnail_uri', "`$smarty.const.STOCK_PKG_URL`image/no_image.png")}
							<a href="{$gal.display_url}"><div class="square" style="background-image:url('{$thumbnailUri}');"alt="{$gal.title|escape}" 
								title="{$gal.title|truncate:50|escape}" 
							{if !empty($gal.data)}
								data-toggle="popover" data-trigger="click hover focus" data-placement="top" data-content="{$gal.data|truncate}"
							{/if}>
							<img src="{$thumbnailUri}" alt="{$gal.title|escape}"><h3 class="gallery-title"><a href="{$gal.display_url}">
							{if $gBitSystem->isFeatureActive('stock_list_title')}
								{$gal.title|truncate|escape}
							{else}
								{tr}Gallery{/tr} {$gal.gallery_id}
							{/if}
							</a>
							</h3><div class="security" style="position:absolute; top:5%;right:5%;color:#fff;">
							{if $gal.is_hidden=='y' || $gal.is_private=='y' || $gal.access_answer}
								{biticon ipackage="icons" iname="lock" iexplain="Security" label=true}
							{/if}
							{if $gal.is_hidden=='y'}
								<span style="padding:5px;">{tr}Hidden{/tr}</span>
							{/if}
							{if $gal.is_private=='y'}
								<span style="padding:5px;">{tr}Private{/tr}</span>
							{/if}
							{if $gal.access_answer}
								<span style="padding:5px;">{tr}Password{/tr}</span>
							{/if}
							</div></div></a>
						{/if}
						<div class="caption">

						{if $gBitSystem->isFeatureActive('stock_list_user')}
							<strong>{displayname hash=$gal nolink=true}</strong> <small><a href="{$smarty.const.STOCK_PKG_URL}list_assemblies.php?user_id={$gal.user_id}" style="display:block;">{tr}Galleries{/tr}</a></small>
						{/if}
						{* if $galleryList[ix]->isProtected()}
							{biticon ipackage="icons" iname="lock" iexplain="Protected"}
						{/if *}

						{if $gBitSystem->isFeatureActive('stock_list_created' ) || $gBitSystem->isFeatureActive('stock_list_lastmodif' )}
							<div class="date">
								{if $gBitSystem->isFeatureActive('stock_list_created' ) }
									<strong>{tr}Created{/tr}:</strong> {$gal.created|bit_short_date}<br />
								{/if}
								{if $gBitSystem->isFeatureActive('stock_list_lastmodif' )}
									<strong>{tr}Modified{/tr}:</strong> {$gal.last_modified|bit_short_date}<br />
								{/if}
							</div>
						{/if}

						<!--{if $gBitSystem->isFeatureActive('stock_list_hits')}
							<small><strong>{tr}Hits{/tr}:</strong> {$gal.hits}</small>
						{/if}-->

						{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gal}

						{if $gBitUser->hasPermission('p_stock_update')}
							<a href="{$smarty.const.STOCK_PKG_URL}edit_assembly.php?content_id={$gal.content_id}">{biticon ipackage="icons" iname="edit" iexplain="Edit"}</a>
						{/if}

						</div>
					</div>
				</div>

			{/foreach}	
			</div>
		</div>

		<nav>
			{pagination gallery_id=$gContent->mGalleryId}
		</nav>

	</section>	<!-- end .body -->
{/strip}
</div>	<!-- end .stock -->
