index.blade.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. @extends('layouts.app')
  2. @section('content')
  3. <style>
  4. tr {
  5. border-bottom: 1px solid #000;
  6. }
  7. tbody tr:last-child {
  8. border-bottom: none;
  9. }
  10. td {
  11. padding-left: 10px; /* ou margin-left: 10px; */
  12. }
  13. </style>
  14. <table class="w-full bg-jlg-dark-blue flex justify-center">
  15. <thead>
  16. <tr class="border-jlg-white h-64 top-0 w-full lg:w-2/3 fixed flex items-stretch justify-around text-left lg:text-xl uppercase bg-jlg-dark-blue">
  17. <th class="flex items-end justify-start"></th>
  18. <th class="flex items-end justify-start pb-4">Images</th>
  19. <th class="flex items-end justify-start pb-4">Voix Off et In</th>
  20. <th class="flex items-end justify-start pb-4">Bande Son</th>
  21. <th class="flex items-end justify-start pb-4">Écrits</th>
  22. <th class="flex items-end justify-start"></th>
  23. </tr>
  24. </thead>
  25. <tbody class="w-full lg:w-2/3 block bg-jlg-dark-blue">
  26. <?php
  27. $args = array(
  28. 'post_type' => 'post',
  29. 'posts_per_page' => -1,
  30. 'meta_key' => 'Index',
  31. 'meta_type' => 'NUMERIC',
  32. 'orderby' => 'meta_value',
  33. 'order' => 'ASC'
  34. );
  35. $query = new WP_Query($args);
  36. if ($query->have_posts()) :
  37. while ($query->have_posts()) : $query->the_post();
  38. $contenu = get_the_content();
  39. $infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
  40. // Initialisez des variables pour stocker les informations
  41. $images = isset($infosArray[0]) ? $infosArray[0] : '';
  42. $voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
  43. $bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
  44. $ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
  45. //lien pour le crayon
  46. $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
  47. ?>
  48. <tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
  49. <td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
  50. <td class="block pl-0 pr-6"><?php echo $images; ?></td>
  51. <td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
  52. <td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
  53. <td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
  54. <td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';}?></td>
  55. </tr>
  56. <?php
  57. endwhile;
  58. endif;
  59. wp_reset_postdata();
  60. ?>
  61. </tbody>
  62. </table>
  63. @if (! have_posts())
  64. <x-alert type="warning">
  65. {!! __('Sorry, no results were found.', 'sage') !!}
  66. </x-alert>
  67. {!! get_search_form(false) !!}
  68. @endif
  69. @endsection