[PLUGINS][Repeat] Repeat template override WIP.

This commit is contained in:
2021-10-29 00:33:24 +01:00
parent 0f358a9c5d
commit 9a23e03330
5 changed files with 50 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ use App\Core\Modules\NoteHandlerPlugin;
use App\Entity\Note;
use App\Util\Common;
use App\Util\Exception\RedirectException;
use App\Util\Formatting;
use Symfony\Component\HttpFoundation\Request;
class Repeat extends NoteHandlerPlugin
@@ -77,6 +78,17 @@ class Repeat extends NoteHandlerPlugin
return Event::next;
}
public function onOverrideTemplateImport(string $current_template, string $default, string &$response)
{
switch ($current_template) {
case '/network/feed.html.twig':
$response = "plugins/repeat/cards/note/view.html.twig";
return Event::stop;
}
return Event::next;
}
public function onAddRoute(RouteLoader $r): bool
{
// Add/remove note to/from repeats