bludit/admin/views/edit-post.php

84 lines
2.9 KiB
PHP
Raw Normal View History

2015-07-03 22:44:26 +02:00
<h2 class="title"><i class="fa fa-pencil"></i> <?php $Language->p('Edit post') ?></h2>
2015-05-05 03:00:01 +02:00
<form method="post" action="" class="forms">
2015-07-03 22:44:26 +02:00
<input type="hidden" id="jskey" name="key" value="<?php echo $_Post->key() ?>">
2015-06-27 06:28:13 +02:00
2015-05-05 03:00:01 +02:00
<label>
2015-07-03 22:44:26 +02:00
<?php $Language->p('Title') ?>
<input id="jstitle" name="title" type="text" class="width-70" value="<?php echo $_Post->title() ?>">
2015-05-05 03:00:01 +02:00
</label>
<label>
2015-07-03 22:44:26 +02:00
<?php $Language->p('Content') ?> <span class="forms-desc"><?php $Language->p('HTML and Markdown code supported') ?></span>
2015-07-14 04:16:28 +02:00
<textarea id="jscontent" name="content" rows="10" class="width-70"><?php echo $_Post->contentRaw(true, false) ?></textarea>
2015-05-05 03:00:01 +02:00
</label>
<?php
if($Site->advancedOptions()) {
2015-07-03 22:44:26 +02:00
echo '<div id="jsadvancedOptions">';
2015-05-05 03:00:01 +02:00
}
else
{
2015-07-04 02:14:58 +02:00
echo '<p class="advOptions">'.$Language->g('Enable more features at').' <a href="'.HTML_PATH_ADMIN_ROOT.'settings#advanced">'.$Language->g('settings-advanced-writting-settings').'</a></p>';
2015-07-03 22:44:26 +02:00
echo '<div id="jsadvancedOptions" style="display:none">';
2015-05-05 03:00:01 +02:00
}
?>
2015-07-03 22:44:26 +02:00
<h4><?php $Language->p('Advanced options') ?></h4>
2015-05-05 03:00:01 +02:00
<label>
2015-07-03 22:44:26 +02:00
<?php $Language->p('Friendly Url') ?>
2015-05-05 03:00:01 +02:00
<div class="input-groups width-50">
2015-07-03 22:44:26 +02:00
<span class="input-prepend"><?php echo $Site->urlPost() ?><span id="jsparentExample"></span></span>
<input id="jsslug" type="text" name="slug" value="<?php echo $_Post->slug() ?>">
2015-05-05 03:00:01 +02:00
</div>
2015-07-20 05:14:12 +02:00
<span class="forms-desc"><?php $Language->p('you-can-modify-the-url-which-identifies') ?></span>
2015-05-05 03:00:01 +02:00
</label>
<label>
2015-07-03 22:44:26 +02:00
<?php $Language->p('Description') ?>
<input id="jsdescription" type="text" name="description" class="width-50" value="<?php echo $_Post->description() ?>">
2015-07-20 05:14:12 +02:00
<span class="forms-desc"><?php $Language->p('this-field-can-help-describe-the-content') ?></span>
2015-05-05 03:00:01 +02:00
</label>
<label>
2015-07-03 22:44:26 +02:00
<?php $Language->p('Tags') ?>
<input id="jstags" name="tags" type="text" class="width-50" value="<?php echo $_Post->tags() ?>">
2015-07-20 05:14:12 +02:00
<span class="forms-desc"><?php $Language->p('write-the-tags-separeted-by-comma') ?></span>
2015-05-05 03:00:01 +02:00
</label>
</div>
2015-07-14 06:41:32 +02:00
<button class="btn btn-blue" name="publish"><?php echo ($_Post->published()?$Language->p('Save'):$Language->p('Publish now')) ?></button>
<button class="btn" name="draft"><?php $Language->p('Draft') ?></button>
<button id="jsdelete" class="btn" name="delete"><?php $Language->p('Delete') ?></button>
2015-05-05 03:00:01 +02:00
</form>
<script>
$(document).ready(function()
{
2015-07-03 22:44:26 +02:00
var key = $("#jskey").val();
2015-05-05 03:00:01 +02:00
2015-07-03 22:44:26 +02:00
$("#jstitle").keyup(function() {
2015-05-05 03:00:01 +02:00
var slug = $(this).val();
2015-07-03 22:44:26 +02:00
checkSlugPost(slug, key, $("#jsslug"));
2015-05-05 03:00:01 +02:00
});
2015-07-03 22:44:26 +02:00
$("#jsslug").keyup(function() {
var slug = $("#jsslug").val();
2015-05-05 03:00:01 +02:00
2015-07-03 22:44:26 +02:00
checkSlugPost(slug, key, $("#jsslug"));
2015-05-05 03:00:01 +02:00
});
2015-07-04 02:14:58 +02:00
$("#jsdelete").click(function() {
if(!confirm("<?php $Language->p('confirm-delete-this-action-cannot-be-undone') ?>")) {
event.preventDefault();
}
});
2015-05-05 03:00:01 +02:00
});
2015-07-04 00:36:37 +02:00
</script>