Files
Batflat/inc/modules/blog/view/admin/manage.html
2018-03-12 13:23:44 +01:00

87 lines
4.3 KiB
HTML

<article class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{$lang.general.manage}</h3>
<ul class="nav nav-tabs">
{loop: $blog.langs}
<li class="{$value.attr}"><a href="{?=url(ADMIN.'/blog/manage?lang='.$value.name)?}">{$value.name}</a></li>
{/loop}
</ul>
</div>
<div class="panel-body">
<form method="post">
<div class="clearfix">
<h3 class="pull-left" style="margin-top:5px;">{$lang.blog.post_count} {$blog.postCount}</h3>
<button type="submit" title="{$lang.general.delete}" name="delete" class="btn btn-danger pull-right" data-confirm="{$lang.blog.post_del_confirm}" disabled><i class="fa fa-trash"></i> {$lang.general.delete} (<span>0</span>)</button>
</div>
<div class="table-responsive">
<table class="table table-striped no-margin">
<thead>
<tr>
<th><input type="checkbox" class="check-all" /></th>
<th>{$lang.blog.manage_title}</th>
<th>{$lang.blog.manage_status}</th>
<th>{$lang.blog.manage_author}</th>
<th>{$lang.blog.manage_comments}</th>
<th>{$lang.blog.manage_date}</th>
<th class="text-right">{$lang.general.actions}</th>
</tr>
</thead>
<tbody>
{if: !empty($blog.posts)}
{loop: $blog.posts}
<tr>
<td><input type="checkbox" name="post-list[]" class="list-item" value="{$value.id}" /></td>
<td><a href="{$value.editURL}">{$value.title}</a></td>
<td>
{if: $value.status >= 2}
<i class="fa fa-circle text-success" data-toggle="tooltip" data-placement="right" title="{$value.type}"></i>
{elseif: $value.status == 1}
<i class="fa fa-circle text-warning" data-toggle="tooltip" data-placement="right" title="{$value.type}"></i>
{else}
<i class="fa fa-circle text-danger" data-toggle="tooltip" data-placement="right" title="{$value.type}"></i>
{/if}
</td>
<td>{$value.user}</td>
<td>{$value.comments}</td>
<td>{$value.published_at}</td>
<td class="text-right">
<a href="{$value.viewURL}" target="_blank" class="btn btn-primary btn-xs">
<i class="fa fa-search"></i> <span class="hidden-xs">{$lang.pages.view}</span>
</a>
</td>
</tr>
{/loop}
{else}
<tr><td colspan="7" class="text-center">{$lang.general.empty_array}</td></tr>
{/if}
</tbody>
</table>
</div>
</form>
{$blog.pagination}
</div>
</div>
</div>
</article>
<script>
$(".list-item").change(function() {
if($('.list-item:checked').length > 0)
$('button[name="delete"]').prop("disabled", false)
else
$('button[name="delete"]').prop("disabled", true)
$('button[name="delete"] span').text($(".list-item:checked").length);
}).change();
$(".check-all").change(function(e) {
if($(this).is(":checked"))
$('.list-item').prop('checked', true);
else
$('.list-item').prop('checked', false);
$('.list-item').change();
});
</script>