Added last edit time to basic post information
This commit is contained in:
parent
77365e500a
commit
a7c07d32df
3 changed files with 8 additions and 2 deletions
2
TODO
2
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
|
||||
|
|
|
@ -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' %>
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue