]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
auto-claude: subtask-4-3 - Add Plyr JS init and CSS styles via registerCss origin/auto-claude/002-write-offs-erp
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 19 Feb 2026 16:50:01 +0000 (19:50 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Thu, 19 Feb 2026 16:50:01 +0000 (19:50 +0300)
- Added registerCss with video-plyr-wrap wrapper styles
- Wrapped video elements in div.video-plyr-wrap for proper Plyr styling
- Plyr initialization already present from previous subtask

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
erp24/views/write_offs_erp/view.php

index 774b512817f00e0213d04a2c9561eec20972d4c1..dc817407bf9b15b0316560c0d8eb4a22e7c42182 100644 (file)
@@ -28,6 +28,22 @@ $this->registerCssFile('/css/write-offs-erp.css', ['position' => \yii\web\View::
 // Plyr.js video player assets
 $this->registerCssFile('https://cdn.plyr.io/3.7.8/plyr.css', ['position' => View::POS_HEAD]);
 $this->registerJsFile('https://cdn.plyr.io/3.7.8/plyr.min.js', ['position' => View::POS_END]);
+
+// Plyr wrapper styles
+$this->registerCss(<<<CSS
+.video-plyr-wrap {
+    width: 200px;
+    max-width: 100%;
+    margin: 0;
+}
+.video-plyr-wrap .plyr {
+    border-radius: 4px;
+}
+.video-plyr-wrap video {
+    max-width: 100%;
+    height: auto;
+}
+CSS);
 ?>
     <style>
         .tumb img {
@@ -169,10 +185,12 @@ $this->registerJsFile('https://cdn.plyr.io/3.7.8/plyr.min.js', ['position' => Vi
                                         $dataTable .= '</div>';
                                     } else {
                                         // MP4/MOV - используем Plyr.js плеер
+                                        $dataTable .= '<div class="video-plyr-wrap">';
                                         $dataTable .= '<video class="write-offs-video" playsinline controls width="200" preload="none">';
                                         $dataTable .= '<source src="' . $videoUrl . '" type="' . $mimeType . '">';
                                         $dataTable .= 'Ваш браузер не поддерживает видео.';
                                         $dataTable .= '</video>';
+                                        $dataTable .= '</div>';
                                         // Ссылка на скачивание для MOV
                                         if ($ext === 'mov') {
                                             $dataTable .= '<br><a href="' . $videoUrl . '" download style="font-size:12px; color:#6c757d;">⬇ Скачать MOV</a>';