2018-10-16 16:28:42 +00:00
|
|
|
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
use Coduo\PHPHumanizer\DateTimeHumanizer;
|
|
|
|
|
|
|
|
?>
|
2018-10-18 12:49:07 +00:00
|
|
|
<li class="post-item is-reply% my-2" data-uuid="<?= $uuid ?>" data-username="<?= $username ?>">
|
|
|
|
<div class="comment-well" <?= isset($hideShadows) && $hideShadows ? 'style="box-shadow: none;padding:0"' : '' ?>>
|
2018-10-16 16:28:42 +00:00
|
|
|
<div class="post-non-content">
|
|
|
|
<a href="<?= base_url('user/' . $username) ?>" target="_blank">
|
|
|
|
<img src="<?= $profile_picture ?>?w=100" class="img-fluid">
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="content-container">
|
|
|
|
<div class="content">
|
|
|
|
<h3>
|
|
|
|
<a href="<?= base_url('user/' . $username) ?>" target="_blank">
|
|
|
|
<?= $displayname ?>
|
|
|
|
</a>
|
|
|
|
<small><?php
|
|
|
|
$date_created = strtotime($date);
|
|
|
|
echo DateTimeHumanizer::difference(new \DateTime(), new \DateTime("@$date_created"), $_SESSION['site_lang']); ?></small>
|
|
|
|
<?php if ($reply_to != NULL): ?>
|
|
|
|
<small>
|
|
|
|
<i class="fa fa-reply"></i>
|
|
|
|
als Antwort an
|
2018-10-18 12:49:07 +00:00
|
|
|
<a href="#" onclick="showFullPost('<?= $replyToPost['uuid'] ?>', '<?= $replyToPost['username'] ?>')">@<?= $replyToPost['displayname'] ?></a>
|
2018-10-16 16:28:42 +00:00
|
|
|
</small>
|
|
|
|
<?php endif; ?>
|
|
|
|
</h3>
|
|
|
|
<div class="comment">
|
|
|
|
<p>
|
|
|
|
<?= $this->PostsModel->closeTags($content) ?>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<?php if (!empty($media)): ?>
|
|
|
|
<div class="post-media-list row">
|
|
|
|
<?php foreach ($media as $item): ?>
|
|
|
|
<div class="col">
|
|
|
|
<div class="post-media" data-full-image="<?= $item['mediaUrl'] ?>" style="background-image: url(<?= $item['mediaUrl'] ?>?w=500"></div>
|
|
|
|
</div>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2018-10-17 11:56:22 +00:00
|
|
|
<?php if (!isset($hideActionBtns) || !$hideActionBtns): ?>
|
|
|
|
<div class="action-btns">
|
|
|
|
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn reply-button" data-toggle="tooltip" data-placement="top" title="Antworten">
|
|
|
|
<i class="far fa-comment"></i>
|
|
|
|
<span><?= $replyCount ?></span>
|
2018-10-16 16:28:42 +00:00
|
|
|
</a>
|
2018-10-17 11:56:22 +00:00
|
|
|
<a href="#" data-uuid="<?= $uuid ?>" class="action-btn like-button <?= isset($userHasLiked) && $userHasLiked ? 'active' : '' ?>" data-toggle="tooltip" data-placement="top" title="Gefällt mir">
|
|
|
|
<i class="<?= isset($userHasLiked) && $userHasLiked ? 'fas' : 'far' ?> fa-heart"></i>
|
|
|
|
<span><?= $likeCount ?></span>
|
|
|
|
</a>
|
|
|
|
<div class="action-btn dropdown">
|
|
|
|
<a href="#" class="action-btn more-options-button" id="postMoreOptionsButton<?= $uuid ?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
<i class="fa fa-ellipsis-h"></i>
|
2018-10-16 16:28:42 +00:00
|
|
|
</a>
|
2018-10-17 11:56:22 +00:00
|
|
|
|
|
|
|
<div class="dropdown-menu" aria-labelledby="postMoreOptionsButton<?= $uuid ?>">
|
|
|
|
<a href="#" onclick="copyToClipboard('<?= base_url('user/' . $username . '/post/' . $uuid) ?>')" class="dropdown-item">
|
|
|
|
<i class="fa fa-copy"></i>
|
|
|
|
Link zum Post kopieren
|
2018-10-16 16:28:42 +00:00
|
|
|
</a>
|
2018-10-17 11:56:22 +00:00
|
|
|
<a href="#" onclick="openPostReportModal('<?= $uuid ?>')" class="dropdown-item">
|
|
|
|
<i class="fa fa-flag"></i>
|
|
|
|
Post melden
|
|
|
|
</a>
|
|
|
|
<?php if (isset($_SESSION['user']) && $_SESSION['user']['username'] == $username): ?>
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
<a href="#" onclick="openDeletePostModal('<?= $uuid ?>')" class="dropdown-item text-danger">
|
|
|
|
<i class="fa fa-trash"></i>
|
|
|
|
Post löschen
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2018-10-16 16:28:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-10-17 11:56:22 +00:00
|
|
|
<?php endif; ?>
|
2018-10-16 16:28:42 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|