mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 19:28:51 +02:00
Show the diff of element edited log entries on detail pages
This commit is contained in:
parent
923e40ed8f
commit
b62fd602f2
8 changed files with 369 additions and 11 deletions
|
@ -21,20 +21,27 @@
|
|||
namespace App\Twig;
|
||||
|
||||
use App\Services\LogSystem\LogDataFormatter;
|
||||
use App\Services\LogSystem\LogDiffFormatter;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class LogExtension extends AbstractExtension
|
||||
final class LogExtension extends AbstractExtension
|
||||
{
|
||||
public function __construct(LogDataFormatter $logDataFormatter)
|
||||
|
||||
private LogDataFormatter $logDataFormatter;
|
||||
private LogDiffFormatter $logDiffFormatter;
|
||||
|
||||
public function __construct(LogDataFormatter $logDataFormatter, LogDiffFormatter $logDiffFormatter)
|
||||
{
|
||||
$this->logDataFormatter = $logDataFormatter;
|
||||
$this->logDiffFormatter = $logDiffFormatter;
|
||||
}
|
||||
|
||||
public function getFunctions()
|
||||
{
|
||||
return [
|
||||
new TwigFunction('format_log_data', [$this->logDataFormatter, 'formatData'], ['is_safe' => ['html']])
|
||||
new TwigFunction('format_log_data', [$this->logDataFormatter, 'formatData'], ['is_safe' => ['html']]),
|
||||
new TwigFunction('format_log_diff', [$this->logDiffFormatter, 'formatDiff'], ['is_safe' => ['html']]),
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue