mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-13 21:59:34 +00:00
Label generator: increase PDF preview height to show toolbar in Chromium (fixes #1165)
This commit is contained in:
parent
270815712e
commit
211d80adee
2 changed files with 19 additions and 2 deletions
|
|
@ -135,8 +135,9 @@
|
|||
|
||||
{% block additional_content %}
|
||||
{% if pdf_data %}
|
||||
<div class="card mt-2 p-1 border-secondary" style="resize: vertical; overflow: scroll; height: 250px">
|
||||
<object id="pdf_preview" data="{{ pdf_data | data_uri(mime='application/pdf') }}"style="height: inherit">
|
||||
{# Make the PDF viewer a few pixels taller so Chromium-based browsers show the PDF toolbar by default (fixes #1165) #}
|
||||
<div class="card mt-2 p-1 border-secondary" style="resize: vertical; overflow: auto; height: 280px; min-height: 200px;">
|
||||
<object id="pdf_preview" data="{{ pdf_data | data_uri(mime='application/pdf') }}" style="height: 100%; width: 100%; display: block;">
|
||||
</object>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
16
tests/Template/LabelDialogTemplateTest.php
Normal file
16
tests/Template/LabelDialogTemplateTest.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Template;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class LabelDialogTemplateTest extends TestCase
|
||||
{
|
||||
public function testPdfViewerHeightIsIncreased(): void
|
||||
{
|
||||
$tpl = file_get_contents(__DIR__ . '/../../templates/label_system/dialog.html.twig');
|
||||
|
||||
$this->assertStringContainsString('id="pdf_preview"', $tpl, 'PDF object id must exist');
|
||||
$this->assertStringContainsString('height: 280px', $tpl, 'Default PDF viewer height should be 280px to make the toolbar visible in Chromium-based browsers');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue