diff options
Diffstat (limited to 'src/web/_views/comments.php')
-rw-r--r-- | src/web/_views/comments.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/web/_views/comments.php b/src/web/_views/comments.php new file mode 100644 index 0000000..d72afd6 --- /dev/null +++ b/src/web/_views/comments.php @@ -0,0 +1,51 @@ +<?php /* Copyright (c) 2024 Freya Murphy */ ?> +<?=aria_section('comments', lang('comments'))?> + <?php + foreach($comments as $comment) { + $date = date_create($comment['created']); + $date = date_format($date, "Y-m-d H:i"); + + echo '<div class="comment">'; + echo '<h3 class="header">' . esc($comment['author']) . '</h3>'; + echo '<span class="date">' . $date . '</span>'; + echo '<p class="content">' . esc($comment['content']) . '</p>'; + echo '</div>'; + } + if (!count($comments)) { + echo '<span>'. lang('no_comments') .'</span>'; + } + ?> + <div class="new"> + <h3><?=lang('new_comment_title')?></h3> + <form id="new_comment" method="get" action="<?=lang('base_path') . '_comments/post'?>"> + <input + type="text" + name="author" + id="author" + aria-label="<?=lang('new_comment_author_label')?>" + placeholder="<?=lang('new_comment_author_ph')?>"> + <input + type="text" + name="content" + id="content" + aria-label="<?=lang('new_comment_content_label')?>" + placeholder="<?=lang('new_comment_content_ph')?>"> + <input + type="hidden" + class="hidden" + name="ref" + value="<?=base64_encode($ref)?>"> + <input + type="hidden" + class="hidden" + name="page" + value="<?=$page?>"> + <input + type="submit" + role="button" + id="submit" + value="<?=lang('new_comment_submit_text')?>"> + </form> + </div> +</div> + |