diff options
Diffstat (limited to 'src/app/Views/editor')
| -rw-r--r-- | src/app/Views/editor/index.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/app/Views/editor/index.php b/src/app/Views/editor/index.php index 624002a..7f2c258 100644 --- a/src/app/Views/editor/index.php +++ b/src/app/Views/editor/index.php @@ -46,4 +46,19 @@ <button id="btn-save" class="btn" disabled>Save post</button> </div> </div> + + <?php if (!empty($userPosts)): ?> + <h2 class="my-posts-title">My posts</h2> + <div class="my-posts-grid"> + <?php foreach ($userPosts as $post): ?> + <div class="my-post"> + <img src="/<?= htmlspecialchars($post['image_path']) ?>" alt="My post"> + <form method="POST" action="/editor/delete/<?= $post['id'] ?>" class="delete-form"> + <?= \App\Csrf::field() ?> + <button type="submit" class="btn-delete" onclick="return confirm('Delete this post?')">Delete</button> + </form> + </div> + <?php endforeach; ?> + </div> + <?php endif; ?> </div> |
