Draft for pages and subpages

This commit is contained in:
danpros 2024-01-01 11:37:47 +07:00
commit 0ec68537c5
10 changed files with 387 additions and 112 deletions

View file

@ -43,3 +43,47 @@
<?php } else {
echo i18n('No_draft_found') . '!';
} ?>
<?php if (!empty($draftPages)):?>
<br><br>
<hr>
<h2 class="post-index"><?php echo i18n('Draft');?>: <?php echo i18n('Static_pages');?></h2>
<table class="table post-list">
<tr class="head">
<th><?php echo i18n('Title');?></th>
<th><?php echo i18n('Created');?></th>
<th><?php echo i18n('Operations');?></th>
</tr>
<?php foreach ($draftPages as $d): ?>
<?php $count = count(get_static_sub_post($d->md)); ?>
<tr>
<td><?php echo $d->title ?></td>
<td><?php echo format_date($d->lastMod) ?></td>
<td><a class="btn btn-primary btn-xs" href="<?php echo $d->url ?>/edit?destination=admin/draft"><?php echo i18n('Edit');?></a> <?php if ($count == 0):?><a class="btn btn-danger btn-xs" href="<?php echo $d->url ?>/delete?destination=admin/draft"><?php echo i18n('Delete');?></a><?php endif;?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif;?>
<?php if (!empty($draftSubpages)):?>
<br><br>
<hr>
<h2 class="post-index"><?php echo i18n('Draft');?>: Sub</h2>
<table class="table post-list">
<tr class="head">
<th><?php echo i18n('Title');?></th>
<th><?php echo i18n('Created');?></th>
<th><?php echo i18n('Operations');?></th>
<th><?php echo i18n('Static_pages');?></th>
</tr>
<?php foreach ($draftSubpages as $sp): ?>
<?php $parent = get_static_post($sp->parent);?>
<tr>
<td><?php echo $sp->title ?></td>
<td><?php echo format_date($sp->lastMod) ?></td>
<td><a class="btn btn-primary btn-xs" href="<?php echo $sp->url ?>/edit?destination=admin/draft"><?php echo i18n('Edit');?></a> <a class="btn btn-danger btn-xs" href="<?php echo $sp->url ?>/delete?destination=admin/draft"><?php echo i18n('Delete');?></a></td>
<td><a href="<?php echo $parent['current']->url;?>"><?php echo $parent['current']->title;?></a></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif;?>