Procházet zdrojové kódy

Correction premier film dans liste

Sangfroid před 2 měsíci
rodič
revize
0c15736ae0

+ 4 - 0
src/Controller/IndexController.php

@@ -138,6 +138,10 @@ class IndexController extends AbstractController
             }
         } elseif ($fromList === 'common' && $toList === 'user') {
             $last = end($userListFilms);
+            if (!$last) {
+                $newUserListFilm->setPosition(0);
+                return;
+            }
             $positionLast = $last->getPosition();
             $newUserListFilm->setPosition($positionLast + 1);
 

+ 2 - 2
templates/index/index.html.twig

@@ -54,8 +54,8 @@
             <td>{{ film.name }}</td>
             <td>{{ film.realisateur }}</td>
             <td>{{ film.genre }}</td>
-            <td></td>
-            <td></td>
+            <td>{{ (film.commonLists | first).addedBy.email }}</td>
+            <td>{{ (film.commonLists | first).dateAdded | date('d/m/Y') }}</td>
         </tr>
         {% endfor %}
     </tbody>