	<div class="r_block w50_1">
		<div class="r_block_head">
			<span class="glyphicon glyphicon-align-left"></span> Вопрос
		</div> 
		<div class="r_block_c">
			<div class="with_code">{text}</div>
		</div>
	</div>
	<div class="r_block w50_2">
		<div class="r_block_head">
			<span class="glyphicon glyphicon-th"></span> Информация
		</div> 
		<div class="r_block_c">
			<p><span class="glyphicon glyphicon-tasks"></span> <b>Тема:</b> {name}</p>
			<p><span class="glyphicon glyphicon-user"></span> <b>Автор:</b> <a target="_blank" href="../profile?id={author_id}">{author_login}</a></p>
			<p>
				<span class="glyphicon glyphicon-map-marker"></span> <b>Статус:</b> 
				{if('{status}' == '1')}
					<span id="status" class="label label-info">Открыт</span>
				{else}
					<span id="status" class="label label-success">Закрыт</span>
				{/if}
			</p>
			<p><span class="glyphicon glyphicon-calendar"></span> <b>Дата</b> {date}</p>
			<hr>
			<div class="r_block_head">
				<span class="glyphicon glyphicon-th"></span> Файл
			</div>
				<br>
			{if('{files}' == 'none')} 
				Пользователь не прикрепил файлов
			{else}
				<p><a target="_blank" class="btn2" href="../{{$ticket->files}}">Скачать файл <span class="glyphicon glyphicon-link"></span></a></p>
			{/if}
			{if(('{status}' == '1') or (is_worthy("l")))}
				<hr>
				<div class="block_head mt-10">
					<span class="glyphicon glyphicon-cog"></span> Действие
				</div>
			{/if}
			{if('{status}' == '1')}
				<button class="btn2" onclick="close_ticket('{id}')">Закрыть тикет <span class="glyphicon glyphicon-remove"></span></button>
			{/if}
			{if(is_worthy("l"))}
				<button class="btn2" onclick="dell_ticket('{id}')">Удалить тикет <span class="glyphicon glyphicon-trash"></span></button>
			{/if}
		</div>
	</div>
	<div class="clear"></div>
	<div class="r_block">
		<div class="r_block_head">
			<span class="glyphicon glyphicon-comment"></span> Комментарии
		</div>
		<div class="r_block_c">
			<div id="add_ticket_answer" class="mt-10">
				{if('{status}' == '1')}
					<textarea id="text" class="form-control maxMinW100" maxlength="1000"></textarea>
					<div class="smile_input_forum">
						<input id="send_btn" class="btn2 mt-10" type="button" onclick="send_ticket_answer({id});" value="Отправить">
						<div id="smile_btn" class="smile_btn visible-lg-inline-block" data-container="body" data-toggle="popover" data-placement="top" data-content="empty"></div>
					</div>
				{else}
					<div class="disabled_input form-control">Тикет закрыт <span class="glyphicon glyphicon-ban-circle"></span></div>
				{/if}
			</div>
		</div>
		<div class="r_block_c">
			<div id="answers">
				<center><img src="{site_host}templates/{template}/img/loader.gif?v={cache}"></center><br>
			</div>
			<script>load_ticket_answers("{id}");</script>
		</div>
	</div>
</div>
<script>
	$(document).ready(function() {
		init_tinymce("text", "lite", "{file_manager_theme}", "{file_manager}", "{{md5($conf->code)}}");
		get_smiles('#smile_btn', 1);
	});

	$('#smile_btn').popover({ html: true, animation: true, trigger: "click" });
	$('#smile_btn').on('show.bs.popover', function () {
		$(document).mouseup(function (e) {
			var container = $(".popover-content");
			if (container.has(e.target).length === 0){
				$('#smile_btn').popover('hide'); selected = 'gcms_smiles';
			}
		});
	});

	function set_smile(elem){
		var smile =  "<img src=\""+$(elem).attr("src")+"\" class=\"g_smile\" height=\"20px\" width=\"20px\">";
		tinymce.activeEditor.insertContent(smile);
		$('#smile_btn').popover('hide'); selected = 'gcms_smiles';
	}
</script>
<div class="right_block">
	{include file="/home/right_col.tpl"}
</div>