Skip to content

Commit 13128d5

Browse files
committed
Show deprecated, research, draft in packet view
1 parent 117b68c commit 13128d5

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/templates/Deprecated.inc.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span style="background-color:rgba(192,64,64,0.2);border-radius:6px;padding:2px 6px;" class="red center">Deprecated</span>

src/templates/Draft.inc.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span style="background-color:rgba(192,64,64,0.2);border-radius:6px;padding:2px 6px;" class="red center">Draft</span>

src/templates/InResearch.inc.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span style="background-color:rgba(192,64,64,0.2);border-radius:6px;padding:2px 6px;" class="red center">In Research</span>

src/templates/Packet/View.phtml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ if ($object) {
4848
$user_avatar = null;
4949
}
5050

51+
$deprecated = $object->isDeprecated();
52+
$research = $object->isInResearch();
53+
$published = $object->isPublished();
54+
5155
}
5256

5357
$this->opengraph->attach(new Pair("url", $url));
@@ -80,6 +84,13 @@ require("./header.inc.phtml");
8084
<tr><th style="width:20%;">Message Id:</th><td><?php echo $packet_id; ?></td></tr>
8185
<tr><th>Message Name:</th><td><?php echo filter_var($object->getPacketName(), FILTER_SANITIZE_STRING); ?></td></tr>
8286
<tr><th>Direction:</th><td><?php echo filter_var($object->getPacketDirectionLabel(), FILTER_SANITIZE_STRING); ?></td></tr>
87+
<?php if ($deprecated || $research || !$published) { ?>
88+
<tr><th>Flags:</th><td>
89+
<? if ($deprecated) require('./Deprecated.inc.phtml'); ?>
90+
<? if ($research) require('./InResearch.inc.phtml'); ?>
91+
<? if (!$published) require('./Draft.inc.phtml'); ?>
92+
</td></tr>
93+
<?php } ?>
8394
<tr><th>Used By:</th><td><?php
8495
$products = $this->getContext()->used_by;
8596
if (count($products) == 0) {

0 commit comments

Comments
 (0)