  <div class="page-info">
    <div class="container">
      <div id="breadcrumbs">
        <a href='/' class="first">صفحه اصلی</a> \  <a href="/categories/all/">محصولات</a>  \ 	{foreach from=$item.categories item=e}
								{foreach from=$e item=c name=foo}
									<a href="/{$languageURL}categories/{$categories[$c].id}/{$categories[$c].name|url}" title="">{$categories[$c].name}</a> {if !$smarty.foreach.foo.last} \ {/if}
								{/foreach}
							{/foreach}  \
     </div>
   <h1 class="page-title">{$item.name}</h1>
    </div>
      <div id="tabsy">
          <ul>
            <li class="{if $smarty.get.controller != 'faq' && $smarty.get.controller != 'comments' && $smarty.get.controller != 'edit'} selected {/if} "><div></div><a href="/{$languageURL}items/{$item.id}/{$item.name|url}">جزئیات محصول</a></li>
			{if $faqs>0 || check_login_bool() && $item.user_id == $smarty.session.user.user_id}
			<li class="{if $smarty.get.controller == 'faq'}selected{/if}" id="faq-tab"><div></div><a href="/{$languageURL}items/faq/{$item.id}/{$item.name|url}">{$lang.faqs}</a></li>
			{/if}
			{if check_login_bool() && $item.user_id == $smarty.session.user.user_id}
			<li class="{if $smarty.get.controller == 'edit'}selected{/if}" ><div></div><a href="/{$languageURL}items/edit/{$item.id}/{$item.name|url}">{$lang.edit}</a></li>
			{/if}
			<li class="{if $smarty.get.controller == 'comments'}selected last{/if}  {if check_login_bool() && $item.user_id == $smarty.session.user.user_id}last{/if}"><div></div><a href="/{$languageURL}items/comments/{$item.id}/{$item.name|url}">{$lang.comments1}</a><div class="last"></div></li>
          </ul>
      </div>
  </div>     
    <div id="content">
      <div class="container">
	  	{$errorMessage}
        {include file="$root_path/zipmarket/apps/items/views/purchase_panel.html"}
      <div class="content-s">
	{if $paging}
    <div class="page-controls">
      <div class="pagination">
     {$paging}
      </div>
    </div>
   {/if}
{if $comments}
<div class="comment-list">
    {foreach from=$comments item=c}
<div class="comment">
  <div class="comment__user">
    <div>
   <div class="avatar-wrapper">
    <a href="/{$languageURL}user/{$users[$c.user_id].username}" class="avatar" title="{$users[$c.user_id].username}">
	{if $users[$c.user_id].avatar != ''} 
    <img alt="{$users[$c.user_id].username}" class="" height="80" src="{$data_server}uploads/users/{$c.user_id}/A_{$users[$c.user_id].avatar}" width="80" />
    {else}
    <img alt="{$users[$c.user_id].username}" class="" height="80" src="{$data_server}img/default-user.jpg" width="80" />
    {/if}
    </a>
   </div>
  </div>
 <ul class="badges"></ul>
</div>
  <div class="comment__container">
    <div class="content-box comment__body">
        <div class="comment__header">
          <a href="/{$languageURL}user/{$users[$c.user_id].username}" class="comment__username">{$users[$c.user_id].username}</a>
        {if $item.user_id == $c.user_id}
		<strong class="comment__user-type--author">فروشنده</strong>
		{elseif isset($buyFromUsers[$c.user_id])}
		<strong class="comment__user-type--purchased">خریدار</strong>
	    {/if}	
          <div class="comment__meta">
        {$lang.posted} {$c.datetime|date_format:"j F Y"}
        {if $c.report_by == '0'}
        <a href="/{$languageURL}items/comments/{$item.id}/?report={$c.id}" class="glyph-flag fancybox"><span class="glyph-alt">{$lang.report}</span></a>
        {/if} 
         </div>
        </div>
        <p>{$c.comment|nl2br}</p>      
    </div>
{if isset($c.reply)}
{foreach from=$c.reply item=cc}
<div class="comment__reply ">
  <a href="/{$languageURL}user/{$users[$cc.user_id].username}" class='comment__reply__avatar'>
  {if $users[$cc.user_id].avatar != ''} 
    <img alt="{$users[$cc.user_id].username}" height="30" src="{$data_server}uploads/users/{$cc.user_id}/A_{$users[$cc.user_id].avatar}" width="30" />
  {else}
  	<img alt="{$users[$cc.user_id].username}" class="avt" height="30" src="/static/img/default-user.jpg" width="30" />
  {/if}
 </a>
  <div class="comment__reply__body">
      <div class="comment__header">
        <a href="/{$languageURL}user/{$users[$cc.user_id].username}" class="comment__username">{$users[$cc.user_id].username}</a>
        
        {if $item.user_id == $cc.user_id}
		<strong class="comment__user-type--author">فروشنده</strong>
		{elseif isset($buyFromUsers[$cc.user_id])}
		<strong class="comment__user-type--purchased">خریدار</strong>
	    {/if}	
       <div class="comment__meta">
  {$lang.posted} {$cc.datetime|date_format:"j F Y"}
  {if $cc.report_by == '0'}
    <a href="/{$languageURL}items/comments/{$item.id}/?report={$cc.id}" onclick="return confirm('{$lang.are_you_sure_report}');" class="glyph-flag fancybox"><span class="glyph-alt">{$lang.report}</span></a>
  {/if}
       </div>
      </div>
      <p>{$cc.comment|nl2br}</p>
  </div>
</div>
{/foreach}
{/if}
  	  <div id="replyhere_{$c.id}"></div>
	{literal}<script language="javascript">
 $("{/literal}#replyhere_{$c.id}{literal}").load("{/literal}/{$languageURL}items/reply/{$c.id}{literal}");
</script>{/literal}
  </div>
</div> 
{/foreach}   
</div>
{else}
<div class="content-box vertical-space">
هیچ نظری برای این محصول ثبت نشده است .
</div>
{/if}
{if check_login_bool()}
         <h2 class="box-heading">افزودن نظر</h2>
            <div class="content-box">
             <form action="" method="post">
              <fieldset class="horizontal-form">
                <div class="input-group">
                  <label for="item_comment_content">{$lang.comment}</label>
                  <div class="inputs">
					<textarea class="big input supertall" name="comment" rows="1"></textarea></div>
                </div>

                <div class="input-group">
                  <label for="reply_notification">اشتراک ایمیل ؟</label>
                  <div class="inputs">
                    <label for="reply_notification">
                      <input class="checkbox" id="reply_notification" name="reply_notification" type="checkbox" value="1" />
                      {$lang.comment_reply_notify}
                    </label>
                  </div>
                </div>
              </fieldset>
              <div class="form-submit">
              <button type="submit" name="add" class="btn-icon post-reply">{$lang.post_comment}</button>
              </div>
            </form>          
           </div>
{literal}
<script type="text/javascript">
$(function(){
$("textarea").live("keyup keydown",function(){
var h=$(this);
h.height(20).height(h[0].scrollHeight); 
});});

</script>
{/literal}
{/if}
      </div>
          {include file="$root_path/zipmarket/apps/items/views/rightside.html"}
        <div class="clear"><!-- --></div>
      </div>
    </div>
        <div class="clear"><!-- --></div>