diff --git a/TODO b/TODO index 8eef49ec..650e1900 100644 --- a/TODO +++ b/TODO @@ -3,8 +3,6 @@ first major release. everything related to posts: - single post view - - basic information - - time of last edit - fav - score (see notes about scoring) - editing diff --git a/public_html/templates/post.tpl b/public_html/templates/post.tpl index 6b8463a9..6b98697e 100644 --- a/public_html/templates/post.tpl +++ b/public_html/templates/post.tpl @@ -69,6 +69,13 @@ </li> <% } %> + <% if (post.lastEditTime !== post.uploadTime) { %> + <li> + Edited: + <%= formatRelativeTime(post.lastEditTime) %> + </li> + <% } %> + <% if (post.featureCount > 0) { %> <li> Featured: <%= post.featureCount %> <%= post.featureCount < 2 ? 'time' : 'times' %> diff --git a/src/Services/PostService.php b/src/Services/PostService.php index ccaf5df4..57f0ec55 100644 --- a/src/Services/PostService.php +++ b/src/Services/PostService.php @@ -115,6 +115,7 @@ class PostService $transactionFunc = function() use ($post, $formData) { $this->validator->validate($formData); + $post->setLastEditTime($this->timeService->getCurrentTime()); if ($formData->content !== null) $this->updatePostContentFromString($post, $formData->content);