{*
 **********************************************************
 * Developed by: Team Theme Metro
 * Website: http://www.thememetro.com
 **********************************************************
*}

<div class="article">
	{if $kbarticle.voted}{include file="$template/includes/alert.tpl" type="success" msg="{lang key="knowledgebaseArticleRatingThanks"}" textcenter=true}{/if}

	<div class="article-content">
		{$kbarticle.text}
	</div>
	
	<div class="article-tools">
		<ul class="kb-article-details">
			<li><i class="fas fa-star"></i> {$kbarticle.useful} {$LANG.knowledgebaseratingtext}</li>
			{if $kbarticle.tags }<li><i class="fas fa-tag"></i> {$kbarticle.tags}</li>{/if}
		</ul>
		<a href="#" class="btn btn-icon d-print-none" onclick="window.print();return false"><i class="fal fa-print"></i></a></li>
	</div>


	<div class="rate-article hidden-print">
		<div class="TM-card">
			<form action="{routePath('knowledgebase-article-view', {$kbarticle.id}, {$kbarticle.urlfriendlytitle})}" method="post">
				<input type="hidden" name="useful" value="vote">
				{if $kbarticle.voted}{$LANG.knowledgebaserating}{else}{$LANG.knowledgebasehelpful}{/if}
				{if $kbarticle.voted}
					{$kbarticle.useful} {$LANG.knowledgebaseratingtext} ({$kbarticle.votes} {$LANG.knowledgebasevotes})
				{else}
					<button type="submit" name="vote" value="yes" class="btn btn-primary btn-sm"><i class="far fa-thumbs-up"></i> {$LANG.knowledgebaseyes}</button>
					<button type="submit" name="vote" value="no" class="btn  btn-default btn-sm"><i class="far fa-thumbs-down"></i> {$LANG.knowledgebaseno}</button>
				{/if}
			</form>
		</div>
	</div>
	
</div>

{if $kbarticles}
    <div class="kb-also-read">
        <h4>{$LANG.knowledgebaserelated}</h4>
        <div class="kbarticles">
            {foreach key=num item=kbarticle from=$kbarticles}
				<div class="kb-article" onclick="clickableSafeRedirect(event, '{routePath('knowledgebase-article-view', {$kbarticle.id}, {$kbarticle.urlfriendlytitle})}')">
					<span class="fal fa-file-alt fa-fw"></span>{$kbarticle.title} {if $kbarticle.editLink} <span class="admin-edit-link"><a href="{$kbarticle.editLink}"><i class="fal fa-edit fa-fw"></i>{$LANG.edit}</a></span>{/if}
					<p>{$kbarticle.article|truncate:100:"..."}</p>
				</div>
            {/foreach}
        </div>
    </div>
{/if}

<div class="mt-3 d-print-none">
	<a href="javascript:history.go(-1)" class="btn btn-default btn-xs px-4">
		{lang key='clientareabacklink'}
	</a>

	{if $kbarticle.editLink}
		<a href="{$kbarticle.editLink}" class="btn btn-default btn-xs px-4 float-right">
			<i class="fal fa-edit fa-fw"></i>
			{lang key='edit'}
		</a>
	{/if}
</div>


{if $themesettings.general.disqus !== "" && $themesettings.general.edinknow}
<div class="space-30"></div>
<div id="disqus_thread"></div>
<script type="text/javascript">
    var disqus_shortname = '{$themesettings.general.disqus}';
	
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
{/if}