templates/content/structure/show.html.twig line 70

Open in your IDE?
  1. {% extends 'content/baseImmemory.html.twig' %}
  2. {# extends 'realisations/immemory/base.html.twig' #}
  3. {% block title %}{{ stack.nom }} {% endblock %}
  4. {% block body %}
  5.   <div class="col-12 menuShow">
  6.     {% include "content/structure/breadcrumb.html.twig" %}
  7.   </div>
  8.   <div class="container-fluid">
  9.     <div class="row fondintro">
  10.       <div class="col-12 titreCard">
  11.         <h1>
  12.           {{ stack.nom }}
  13.         </h1>
  14.       </div>
  15.       <div class="col-12 col-md-6 showAdmin">
  16.         <div class="zonesImg{{ stack.id }}" style="position:relative; ">
  17.           <img src="{{ pathLocal }}/{{ stack.urlImage }}" alt="{{ stack.urlImage }}" class=" img-fluid">
  18.           {% include "content/structure/zonesActives.html.twig" %}
  19.         </div>
  20.       </div>
  21.       <div class="col-12 col-md-6">
  22.         <div class="col-12 details">
  23.           <ul>
  24.             <li>Id : <span class="categorie_details">{{ stack.id }}</span></li>
  25.             <li>Catégorie : <span class="categorie_details">{{ stack.Scategorie.nom }}</span></li>
  26.             <li>Séquence : <span class="categorie_details">{{ stack.Ssequence.nom }}</span></li>
  27.             <li>Card : <span class="categorie_details">{{ stack.nom }}</span></li>
  28.           </ul>
  29.         </div>
  30.         <div class="col-12 showBtns">
  31.           <a class="btn btnImmemory" href="{{ path('front_cdrom_900_ciblebif', {'id': stack.id}) }}" target="_blank">
  32.             voir dans CDRom
  33.           </a>
  34.           {% if app.user is not null %}
  35.             {% for role in app.user.roles  %}
  36.               {% if role == "ROLE_ADMIN" %}
  37.                 <a class="btn btnImmemory" href="{{ path('admin_stacks_edit', {'id': stack.id}) }}">
  38.                   Modifier
  39.                 </a>
  40.                 <a class="btn btnImmemory" href="{{ path('admin_stacks_delete', {'id': stack.id}) }}">
  41.                   Supprimer
  42.                 </a>
  43.               {% else %}
  44.               {% endif %}
  45.             {% endfor %}
  46.           {% endif %}
  47.           {% if recherche == 0 %}
  48.             <a class="btn btnImmemory rouge" href="{{ urlBack }}">
  49.           {% else %}
  50.             <a class="btn btnImmemory rouge" href="{{ path('webSite_stacks_sequence_recherche', {'page': 1, 'search': recherche }) }}">
  51.           {% endif %}
  52.               Retour
  53.             </a>
  54.         </div>
  55.         <div class="listNav">
  56.           <h3>Navigation :</h3>
  57.           <div id="navigationImmemory" class="">
  58.             {% include "content/structure/menuZonesActives.html.twig" %}
  59.           </div>
  60.         </div>
  61.         {% if app.user is not null %}
  62.           <h3>Commentaires :</h3>
  63.           {% if stack.commentaires|length == 0 %}
  64.             Pas de Commentaire
  65.           {% else %}
  66.             {% for comm in stack.commentaires %}
  67.               <div class="commentaire" style="background-color:beige; padding:7px 7px 0 7px;border: 1px solid grey;">
  68.                 {{ comm.texte|raw }}
  69.                 <div class="row" style="padding:4px 0; border-top:1px solid grey; ">
  70.                   <div class="col-6" style="text-align: left;">
  71.                     <small> {{ comm.userCrea[0].username|slice(0, 1) | capitalize }}{{ comm.userCrea[0].id }} le {{ comm.dateModif|date("d m Y") }} à {{ comm.dateModif|date("H:i:s") }} </small>
  72.                   </div>
  73.                   <div class="col-6" style="text-align:right;">
  74.                     {% if app.user.id == comm.userCrea[0].id or app.user.roles[0] == "ROLE_ADMIN" %}
  75.                       <a id="btnModifComm_{{ comm.id }}" href="#ligne_{{ stack.id }}" class="btn btn-sm btn-warning" title="Modifier">
  76.                         <i class="fa fa-pencil-square-o" aria-hidden="true"></i>
  77.                       </a>
  78.                       <a id="btnSupprComm_{{ comm.id }}" href="#ligne_{{ stack.id }}" class="btn btn-sm btn-danger" title="Effacer">
  79.                         <i class="fa fa-trash" aria-hidden="true"></i>
  80.                       </a>
  81.                     {% endif %}
  82.                   </div>
  83.                 </div>
  84.               </div>
  85.             {% endfor %}
  86.           {% endif %}
  87.         {% else %}
  88.         {% endif %}
  89.         <br><br>
  90.         <h3>Médias :</h3>
  91.         {% if stack.film.nom is defined and stack.film.nom != "-" and stack.film.nom != "Vide" and stack.film.id != 1 %}
  92.           <!-- film -->
  93.           <h3>Movies :</h3>
  94.           <h5> {{ stack.film.id }}. {{ stack.film.nom }} </h5>
  95.         {% else %}
  96.           <i> No clip</i> <br>
  97.         {% endif %}
  98.         <br><br>
  99.         {% if stack.transitIn.son0 is defined and stack.transitIn.son0 is not null %}
  100.           <!-- Son -->
  101.           <h3>Sound :</h3>
  102.           <h5>  {{ stack.transitIn.son0 }} </h5>
  103.         {% else %}
  104.           <i>No sound </i><br>
  105.         {% endif %}
  106.       </div>
  107.       <div id="txt" class=" col-12 textShowAdmin">
  108.         {% if stack.texte is defined and stack.texte is not null %}
  109.           <!-- Texte -->
  110.           <h3>Text :</h3>
  111.           <p>  {{ stack.texte|raw }} </p>
  112.         {% else %}
  113.           <i> No text</i> <br>
  114.         {% endif %}
  115.       </div>
  116.     </div>
  117.   </div>
  118.   <div id="fondForm" class="fondForm" style="
  119.                 background-color: black;
  120.                 position: fixed;
  121.                 display: none;
  122.                 width: 100%;
  123.                 height: 100%; color:white;
  124.                 top:0; left:0; z-index:200; opacity:1;">
  125.       <div class="container">
  126.         <div class="row justify-content-center">
  127.           <div id="contenuForm" class="col-12">
  128.           </div>
  129.         </div>
  130.       </div>
  131.   </div>
  132. {% endblock %}
  133. {% block javascripts %}
  134. <script type="text/javascript">
  135.   $(function(){
  136. // ---------------------------------------
  137. // gestion du bouton ajouter un commentaire
  138. $('[id ^= "btnAjouteComm_"]').click(function(){
  139.   // recup code
  140.   monid = $(this).attr('id').substr(14);
  141.   console.log( monid );
  142.   // affiche le fond du formulaire
  143.   $("#fondForm").show(145);
  144.   // charge le formulaire d'ajout de commentaire dans le fond du formulaire
  145.   $.ajax({
  146.     type: "POST",
  147.     url: "{{ path('membre_stacks_commentaire_formAjoute') }}",
  148.     data: {
  149.       cardId: $(this).attr('id').substr(14),
  150.     },
  151.     success: function(msg)
  152.     {
  153.       // affiche le code de la stack
  154.       $( "#contenuForm" ).html( msg );
  155.       $("#btnCloseForm").click(function(){
  156.         $("#fondForm").hide(145);
  157.       });
  158.       $("#btnCloseForm2").click(function(){
  159.         $("#fondForm").hide(145);
  160.       });
  161.       $('[name ^= "form"]').submit(function(evt){
  162.         evt.preventDefault();
  163.         // recup données
  164.         texte = CKEDITOR.instances['form_texte'].getData()
  165.         $.ajax({
  166.           type: "POST",
  167.           url: "{{ path('membre_stacks_commentaire_formTraitement') }}",
  168.           data: {
  169.             texte: texte,
  170.             monid: monid,
  171.           },
  172.           success: function(msg2)
  173.           {
  174.             console.log("formTraitement " + msg2['ok']);
  175.             $("#fondForm").hide(145);
  176.             location.reload(true);
  177.           }
  178.         });
  179.         console.log("submit form " + texte);
  180.       });
  181.     }
  182.   });
  183. });
  184. // gestion du bouton ajouter un commentaire
  185. $('[id ^= "btnModifComm_"]').click(function(){
  186.   // recup code
  187.   monid = $(this).attr('id').substr(13);
  188.   console.log( monid );
  189.   // affiche le fond du formulaire
  190.   $("#fondForm").show(145);
  191.   // charge le formulaire d'ajout de commentaire dans le fond du formulaire
  192.   $.ajax({
  193.     type: "POST",
  194.     url: "{{ path('membre_stacks_commentaire_formModif') }}",
  195.     data: {
  196.       commId: monid,
  197.     },
  198.     success: function(msg)
  199.     {
  200.       // affiche le code de la stack
  201.       $( "#contenuForm" ).html( msg );
  202.       $("#btnCloseForm").click(function(){
  203.         $("#fondForm").hide(145);
  204.         $( "#contenuForm" ).html( "" );
  205.       });
  206.       $("#btnCloseForm2").click(function(){
  207.         $("#fondForm").hide(145);
  208.         $( "#contenuForm" ).html( "" );
  209.       });
  210.       //
  211.       $('[name ^= "form"]').submit(function(evt){
  212.         evt.preventDefault();
  213.         // recup données
  214.         texte = CKEDITOR.instances['form_texte'].getData()
  215.         $.ajax({
  216.           type: "POST",
  217.           url: "{{ path('membre_stacks_commentaire_formModifTraitement') }}",
  218.           data: {
  219.             texte: texte,
  220.             monid: monid,
  221.           },
  222.         /*
  223.         */
  224.           success: function(msg2)
  225.           {
  226.             console.log("formModifTraitement " + msg2['ok']);
  227.             $("#fondForm").hide(145);
  228.             $( "#contenuForm" ).html( "" );
  229.             location.reload(true);
  230.           }
  231.         });
  232.         console.log("submit form " + texte);
  233.       });
  234.     }
  235.   });
  236. });
  237. // gestion du bouton ajouter un commentaire
  238. $('[id ^= "btnSupprComm_"]').click(function(){
  239.   // recup code
  240.   monid = $(this).attr('id').substr(13);
  241.   console.log( monid );
  242.   // affiche le fond du formulaire
  243.   $("#fondForm").show(145);
  244.   // charge le formulaire d'ajout de commentaire dans le fond du formulaire
  245.   $.ajax({
  246.     type: "POST",
  247.     url: "{{ path('membre_stacks_commentaire_formSuppr') }}",
  248.     data: {
  249.       commId: monid,
  250.     },
  251.     success: function(msg)
  252.     {
  253.       // affiche le code de la stack
  254.       $( "#contenuForm" ).html( msg );
  255.       $("#btnCloseForm").click(function(){
  256.         $("#fondForm").hide(145);
  257.         $( "#contenuForm" ).html( "" );
  258.       });
  259.       $("#btnCloseForm2").click(function(){
  260.         $("#fondForm").hide(145);
  261.         $( "#contenuForm" ).html( "" );
  262.       });
  263.       //
  264.       $('[id ^= "btnSuppCommOui_"]').click(function(){
  265.         console.log("oui");
  266.         $.ajax({
  267.           type: "POST",
  268.           url: "{{ path('membre_stacks_commentaire_formSupprTraitement') }}",
  269.           data: {
  270.             monid: monid,
  271.           },
  272.           success: function(msg2)
  273.           {
  274.             console.log("formSupprTraitement " + msg2['ok']);
  275.             $("#fondForm").hide(145);
  276.             $( "#contenuForm" ).html( "" );
  277.             location.reload(true);
  278.           }
  279.           /*
  280.           */
  281.         });
  282.       });
  283.     }
  284.   });
  285. });
  286. });
  287. </script>
  288. {% endblock %}