mitrobill/ui/ui/page-edit.tpl

62 lines
2.7 KiB
Smarty
Raw Normal View History

{include file="sections/header.tpl"}
2022-09-08 10:54:35 +07:00
<div class="row">
<div class="col-sm-12">
<div class="panel mb20 panel-primary panel-hovered">
2023-10-20 10:34:24 +07:00
<div class="panel-heading">
<div class="btn-group pull-right">
<a class="btn btn-danger btn-xs" title="Reset File" href="{$_url}pages/{$PageFile}-reset" onclick="return confirm('Reset File?')"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span></a>
</div>
{$pageHeader}
</div>
2023-10-18 17:24:00 +07:00
<div id="myNicPanel" style="width: 100%;"></div>
<div id="panel-edit" class="panel-body">{$htmls}</div>
2022-09-08 10:54:35 +07:00
{if $writeable}
<div class="panel-footer">
<a href="javascript:saveIt()" class="btn btn-primary btn-block">SAVE</a>
<br>
2024-02-13 13:54:01 +07:00
<p class="help-block">{Lang::T("Sometimes you need to refresh 3 times until content change")}</p>
2023-10-18 17:24:00 +07:00
<input type="text" class="form-control" onclick="this.select()" readonly
value="{$app_url}/pages/{$PageFile}.html">
2022-09-08 10:54:35 +07:00
</div>
{else}
<div class="panel-footer">
2024-02-13 13:54:01 +07:00
{Lang::T("Failed to save page, make sure i can write to folder pages, <i>chmod 664 pages/*.html<i>")}
2022-09-08 10:54:35 +07:00
</div>
{/if}
2023-10-18 17:24:00 +07:00
{if $PageFile=='Voucher'}
<div class="panel-footer">
<p class="help-block">
<b>[[company_name]]</b> Your Company Name at Settings.<br>
<b>[[price]]</b> Plan Price.<br>
<b>[[voucher_code]]</b> Voucher Code.<br>
<b>[[plan]]</b> Voucher Plan.<br>
2023-10-20 14:31:56 +07:00
<b>[[counter]]</b> Counter.<br>
2023-10-18 17:24:00 +07:00
</p>
</div>
{/if}
2022-09-08 10:54:35 +07:00
</div>
</div>
</div>
2023-10-18 17:24:00 +07:00
<form id="formpages" class="hidden" method="post" role="form" action="{$_url}pages/{$PageFile}-post">
2022-09-08 10:54:35 +07:00
<textarea name="html" id="html"></textarea>
</form>
2022-09-17 21:05:24 +07:00
<script src="ui/ui/scripts/nicEdit.js"></script>
2023-10-18 17:24:00 +07:00
{literal}
2023-10-20 10:34:24 +07:00
<script type="text/javascript">
var myNicEditor
bkLib.onDomLoaded(function() {
myNicEditor = new nicEditor({fullPanel : true});
myNicEditor.setPanel('myNicPanel');
myNicEditor.addInstance('panel-edit');
});
2023-10-18 17:24:00 +07:00
2023-10-20 10:34:24 +07:00
function saveIt() {
//alert(document.getElementById('panel-edit').innerHTML);
document.getElementById('html').value = nicEditors.findEditor('panel-edit').getContent()
document.getElementById('formpages').submit();
}
</script>
2023-10-18 17:24:00 +07:00
{/literal}
2022-09-08 10:54:35 +07:00
2023-10-18 17:24:00 +07:00
{include file="sections/footer.tpl"}