diff options
| author | Jonas Kohl | 2024-09-19 16:32:18 +0200 | 
|---|---|---|
| committer | Jonas Kohl | 2024-09-19 16:32:18 +0200 | 
| commit | 4a6e12bf1fc7837699f780674c33cba5f2b1223c (patch) | |
| tree | 0636da538f47b285774525418c1730789c650607 /src/application/views | |
| parent | 5c707597ba936b1b82ee9a1cf546e720d1a490bd (diff) | |
Add log messages
Diffstat (limited to 'src/application/views')
| -rw-r--r-- | src/application/views/view_topiclog.php | 67 | 
1 files changed, 67 insertions, 0 deletions
| diff --git a/src/application/views/view_topiclog.php b/src/application/views/view_topiclog.php new file mode 100644 index 0000000..be3f78d --- /dev/null +++ b/src/application/views/view_topiclog.php @@ -0,0 +1,67 @@ +<?php + +/** @var \mystic\forum\orm\TopicLogMessage $logMessage */ +/** @var ?\mystic\forum\orm\User $postAuthor */ + +use mystic\forum\orm\TopicLogMessage; + +$hide_actions ??= false; +$hide_pfp ??= false; + +$user = ""; +if ($postAuthor === null) { +    $user = __("(deleted)"); +} else { +    $user = '<a href="?_action=viewuser&user=' . htmlentities(urlencode($postAuthor->id)) . '">' . htmlentities($postAuthor->displayName) . '</a>'; +} + +?> +<div class="media" id="post-<?= htmlentities($logMessage->id) ?>"> +<div class="media-left hidden-sm hidden-xs"> +    <?php if ($postAuthor): ?> +        <?php if ($hide_actions): ?> +            <img class="media-object" alt="<?= __("Profile picture") ?>" src="?_action=profilepicture&user=<?= htmlentities(urlencode($postAuthor->id)) ?>" width="64" height="64"> +        <?php else: ?> +            <a href="?_action=viewuser&user=<?= htmlentities(urlencode($postAuthor->id)) ?>"> +                <img class="media-object" alt="<?= __("Profile picture") ?>" src="?_action=profilepicture&user=<?= htmlentities(urlencode($postAuthor->id)) ?>" width="64" height="64"> +            </a> +        <?php endif; ?> +    <?php else: ?> +        <div class="media-object" style="width:64px;height:64px"></div> +    <?php endif; ?> +</div> +<div class="media-body"> +    <?php if ($logMessage->type === TopicLogMessage::LOCKED): ?> +        <div class="well icon-well text-info"> +            <span class="glyphicon glyphicon-lock text-info" aria-hidden="true"></span> +            <em><?= __("%user% locked this topic", [ +                "user" => $user, +            ]) ?></em> +            <br> +            <small class="_time"><?= $logMessage->postDate->format("c") ?></small> +        </div> +    <?php elseif ($logMessage->type === TopicLogMessage::UNLOCKED): ?> +        <div class="well icon-well text-success"> +            <span class="glyphicon glyphicon-globe text-success" aria-hidden="true"></span> +            <em><?= __("%user% unlocked this topic", [ +                "user" => $user, +            ]) ?></em> +            <br> +            <small class="_time"><?= $logMessage->postDate->format("c") ?></small> +        </div> +    <?php elseif ($logMessage->type === TopicLogMessage::TITLE_CHANGED): ?> +        <div class="well icon-well text-info"> +            <span class="glyphicon glyphicon-pencil text-info" aria-hidden="true"></span> +            <em><?= __("%user% changed the title of this topic from %old_title% to %new_title%", [ +                "user" => $user, +                "old_title" => '<strong>' . htmlentities($logMessage->params["old_value"] ?? __("unknown")) . '</strong>', +                "new_title" => '<strong>' . htmlentities($logMessage->params["new_value"] ?? __("unknown")) . '</strong>', +            ]) ?></em> +            <br> +            <small class="_time"><?= $logMessage->postDate->format("c") ?></small> +        </div> +    <?php else: ?> +        <?= __("unknown") ?> +    <?php endif; ?> +</div> +</div> |