[UI][CARD][Note] Add Conversation link
This commit is contained in:
parent
3c79d82b80
commit
4b98200ecd
|
@ -27,9 +27,11 @@ use App\Core\Cache;
|
||||||
use App\Core\DB\DB;
|
use App\Core\DB\DB;
|
||||||
use App\Core\Entity;
|
use App\Core\Entity;
|
||||||
use App\Core\Event;
|
use App\Core\Event;
|
||||||
|
use App\Core\Router\Router;
|
||||||
use App\Core\VisibilityScope;
|
use App\Core\VisibilityScope;
|
||||||
use App\Util\Formatting;
|
use App\Util\Formatting;
|
||||||
use Component\Avatar\Avatar;
|
use Component\Avatar\Avatar;
|
||||||
|
use Component\Conversation\Entity\Conversation;
|
||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -218,6 +220,21 @@ class Note extends Entity
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
// }}} Autocode
|
// }}} Autocode
|
||||||
|
|
||||||
|
public function getConversation(): Conversation
|
||||||
|
{
|
||||||
|
return Conversation::getByPK(['id' => $this->getConversationId()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConversationUrl(int $type = Router::ABSOLUTE_URL): ?string
|
||||||
|
{
|
||||||
|
return Router::url('conversation', ['conversation_id' => $this->getConversationId()], $type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConversationUri(): string
|
||||||
|
{
|
||||||
|
return $this->getConversationUrl(type: Router::ABSOLUTE_URL);
|
||||||
|
}
|
||||||
|
|
||||||
public function getActor(): Actor
|
public function getActor(): Actor
|
||||||
{
|
{
|
||||||
return Actor::getById($this->actor_id);
|
return Actor::getById($this->actor_id);
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
<div class="note-info">
|
<div class="note-info">
|
||||||
{{ block('note_author') }}
|
{{ block('note_author') }}
|
||||||
<em>
|
<em>
|
||||||
<a href="{{ note.getUrl() }}" class="note-url">{{ 'in conversation' | trans }} {{ note.getModified() | ago }}</a>
|
<a href="{{ note.getConversationUrl() }}" class="note-url">{{ 'in conversation' | trans }}</a> <a href="{{ note.getUrl() }}" class="note-url">{{ note.getModified() | ago }}</a>
|
||||||
</em>
|
</em>
|
||||||
|
|
||||||
{{ block('note_actions') }}
|
{{ block('note_actions') }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user