issue: reply posts in article elements
[minimedit.git] / widget / reply.php
index f9248512105bda05860bf691d212bbf7d1e0e3b3..4f6a2c88242f4f1ed5876c52b98a56826370a213 100644 (file)
@@ -28,15 +28,22 @@ if ($row = $query->fetch()) {
        $Page->teaser = $row->raw;
 }
 
-print '<ul class="replies">';
+print '<section class="replies">';
 
 $imagecount = 0;
 while ($row = $query->fetch()) {
        $rowuser = new User("profile/{$row->author}");
-       printf('<li id="%d">', $row->id);
-       printf('<strong>%s</strong> <small class=date>%s</small>',
-               $rowuser->html, showdate(preg_split('/\D/', $row->created))
-       );
+       printf('<article id="%d">', $row->id);
+       printf('<strong>%s</strong>', $rowuser->html);
+       $rowdate = showdate(preg_split('/\D/', $row->created));
+       if ($User->admin('beheer') and $row->updated) {
+               $rowdate = "<s>$rowdate</s> " . showdate(preg_split('/\D/', $row->updated));
+       }
+       printf(' <small class=date>%s</small>', $rowdate);
+       if ($User->admin('beheer') and $User->admin('user') || $User->login === $row->author) {
+               printf(' <a href="%s" title="%s" class=icon>%s</a>',
+                       "/{$Page->link}/{$row->id}", 'reactie aanpassen', "\u{270D}");
+       }
        if ($html = $row->message) {
                $html = preg_replace('/(?<=<img )/',
                        $imagecount > 2 ? 'loading="lazy" ' : '', $html, -1, $found);
@@ -64,11 +71,11 @@ while ($row = $query->fetch()) {
                }
                print "</ul>\n";
        }
-       print "</li>\n";
+       print "</article>\n";
 }
 
 if ($User->login) {
-       print '<li>';
+       print '<article><hr />';
        print '<form method="post" action="" enctype="multipart/form-data">';
        if (isset($Issue) and $User->admin("edit {$Page->link}")) {
                print "<aside>\n";
@@ -132,7 +139,7 @@ if ($User->login) {
        print '<input type="submit" value="Plaatsen" />'."\n";
        print "</form>";
        print '<script src="/upload/progress.js"></script>';
-       print "</li>\n";
+       print "</article>\n";
 }
 
-print "</ul>\n\n";
+print "</section>\n\n";