{#
/**
 * @module          wysiwyg
 * @author          LEPTON Project
 * @copyright       2010-2026 LEPTON Project
 * @link            https://lepton-cms.org
 * @license         https://gnu.org/licenses/gpl.html
 * @license_terms   please see info.php of this module
 *
 */
 #}
{% autoescape false %}
<!-- Output by Twig :: module "wysiwyg" -->
<div class="ui basic segment">				
	<h3 class="ui header">{{ oWGH.language.all_courses }}</h3>
	<form class="ui form" name="wysiwyg_history" action="{{ LEPTON_URL }}/modules/wysiwyg/history.php" method="post">
		<input type="hidden" name="page_id" value="{{ page_id }}" />
		<input type="hidden" name="section_id" value="{{ section_id }}" />
		<table class="history_table">
		  <thead>
			<tr>
			  <th>{{ oWGH.language.header1 }}</th>
			  <th>{{ oWGH.language.date }}</th>
			  <th>{{ oWGH.language.comment }}</th>
			  <th>{{ oWGH.language.saved_by }}</th>
			  <th>{{ oWGH.language.pushed_by }}</th>					  
			</tr>
		  </thead>
		  <tbody>
			{% for item in all_histories %}
			<tr>
				<td rowspan="2">{{ item.id }}</td>
				<td>{{ item.date|date("d.m.Y H:i:s") }}</td>
				<td>{{ item.comment }}</td>
				<td>{{ item.user_id_display_name }}</td>							
				<td>{{ item.user_id_hist_display_name }} </td>						
			</tr>
			<tr>
				<td colspan="4">
					<button class="history_button" type="submit" name="view_version" value="{{ item.id }}" title="{{ oWGH.language.version_view }}" formaction="{{ oWGH.action_url }}show_history.php?leptoken={{ leptoken }}" onclick="displayPreview({{ item.post_id }});return false;" formmethod="post">{{ oWGH.language.version_view }}</button>
					<button class="history_button" type="submit" name="restore_version" value="{{ item.id }}" title="{{ oWGH.language.version_restore }}" formaction="{{ oWGH.action_url }}modify_post.php?post_id={{ item.post_id }}&leptoken={{ leptoken }}" formmethod="post">{{ oWGH.language.version_restore }}</button>
					<button class="history_button_delete" type="submit" name="delete_version" value="{{ item.id }}" title="{{ oWGH.language.version_delete }}" formaction="{{ oWGH.action_url }}show_history.php?leptoken={{ leptoken }}" formmethod="post" onclick = "return history_delete({{ item.post_id }},'{{ item.date|date("d.m.Y h:m:s") }}',this);">{{ oWGH.language.version_delete }}</button>								
				</td>
			</tr>
			{% endfor %}
		  </tbody>
		</table>
		<button class="delete" type="reset" name="reset"  onclick="window.history.back();">{{ TEXT.CANCEL }}</button>
	</form>
</div>

<link href="{{ LEPTON_URL }}/modules/lib_jquery/plugins/colorbox/colorbox.css" rel="stylesheet" />
<script type="text/javascript" src="{{ LEPTON_URL }}/modules/lib_jquery/plugins/colorbox/jquery.colorbox-min.js"></script>
<script>
// a.1
function displayPreview( iItemID ){
    $.colorbox({href:'{{ LEPTON_URL }}/modules/wysiwyg/preview.php?sid='+iItemID});
}
// end a.1
	function wc_delete(id,ref){
		var form_ref = ref.form;
		if(confirm('{{ oWGH.language.want_delete_wc }} "'+id+'" {{ oWGH.language.want_really }}?')) {
		form_ref.submit();
		return true;
		} else {
		return false;
		}
	}
</script>
<!-- end Twig -->
{% endautoescape %}