summaryrefslogtreecommitdiff
path: root/src/web/_views/comments.php
blob: 78cc1cbda62dd2d94daedf1c3bc6550871b3000d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
<?=aria_section('comments', lang('comments'))?>
	<?php
		if ($comments)
		foreach($comments as $comment) {
			$date = $this->format_date($comment['created']);

			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 (!$comments || !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>