Skip to content

Commit 26cb050

Browse files
committed
Make edit and delete btn consistent news posts
1 parent 8807891 commit 26cb050

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/Templates/News/Index.phtml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ else
3838
echo '<div class="container">';
3939
echo '<div class="row"><div class="col">';
4040

41-
if ($edit_visible || $delete_visible) echo '<span class="float-right">';
42-
if ($edit_visible) echo '<a class="btn btn-sm btn-secondary" href="' . $edit_url . '" title="Edit">📝</a>';
43-
if ($delete_visible) echo '<a class="btn btn-sm btn-secondary" href="' . $delete_url . '" title="Delete">❌</a>';
44-
if ($edit_visible || $delete_visible) echo '</span>';
41+
if ($delete_visible) echo '<span class="float-right ml-1"><a class="btn btn-sm btn-danger" href="' . $delete_url . '" title="Delete">❌</a></span>';
42+
if ($edit_visible) echo '<span class="float-right ml-1"><a class="btn btn-sm btn-secondary" href="' . $edit_url . '" title="Edit">📝</a></span>';
4543

4644
echo '<h1><a href="' . $url . '">' . filter_var($news_post_title, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '</a></h1>';
4745
if (!($news_post->getOptionsBitmask() & \BNETDocs\Libraries\News\Post::OPTION_PUBLISHED))

src/Templates/News/View.phtml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,12 @@ require('./Includes/header.inc.phtml'); ?>
4848
<div class="alert alert-warning">This news post is marked as <strong>draft</strong>. Edit the news post to <strong>publish</strong> it.</div>
4949
<? } ?>
5050
<div class="row"><div class="col">
51-
<span class="float-right">
52-
<? if ($edit_visible) { ?>
53-
<a class="btn btn-sm btn-secondary" href="<?=$edit_url?>" title="Edit">📝</a>
54-
<? } if ($delete_visible) { ?>
55-
<a class="btn btn-sm btn-danger" href="<?=$delete_url?>" title="Delete">❌</a>
56-
<? } ?>
57-
</span>
51+
<? if ($delete_visible) { ?>
52+
<span class="float-right ml-1"><a class="btn btn-sm btn-danger" href="<?=$delete_url?>" title="Delete">❌</a></span>
53+
<? } if ($edit_visible) { ?>
54+
<span class="float-right ml-1"><a class="btn btn-sm btn-secondary" href="<?=$edit_url?>" title="Edit">📝</a></span>
55+
<? } ?>
56+
5857
<h1><a href="<?=$url?>"><?=filter_var($title, FILTER_SANITIZE_FULL_SPECIAL_CHARS)?></a></h1>
5958
<? if (!($object->getOptionsBitmask() & \BNETDocs\Libraries\News\Post::OPTION_PUBLISHED)) { ?>
6059
<section class="red"><p><strong>Warning:</strong> This news post is not yet published. You can view this because you are allowed to create, modify, or delete news posts.</p></section>

0 commit comments

Comments
 (0)