index.blade.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. if(is_user_logged_in()){ // verifier si l'utilisateur est connecté
  38. while ($query->have_posts()) : $query->the_post();
  39. $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
  40. ?>
  41. <tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
  42. <td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
  43. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
  44. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
  45. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
  46. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
  47. <td class="block text-sm pl-0 pr-6"><?php echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">&#128393;</a>';?></td>
  48. </tr>
  49. <?php
  50. endwhile;
  51. }
  52. elseif (!is_user_logged_in()) { // si l'utilsateur n'est pas connecté alors le bouton edit a un shortcode qui appelle le plugin user Login
  53. while ($query->have_posts()) : $query->the_post();
  54. $edit_link = $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
  55. ?>
  56. <tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
  57. <td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
  58. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
  59. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
  60. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
  61. <td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
  62. <td class="block text-sm pl-0 pr-6"><?php echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">&#128393;</a>';?></td>
  63. </tr>
  64. <?php
  65. endwhile;
  66. }
  67. endif;
  68. wp_reset_postdata();
  69. ?>
  70. </tbody>
  71. </table>
  72. @if (! have_posts())
  73. <x-alert type="warning">
  74. {!! __('Sorry, no results were found.', 'sage') !!}
  75. </x-alert>
  76. {!! get_search_form(false) !!}
  77. @endif
  78. @endsection