src/NCBS/WebsiteBundle/Resources/views/Bible/readingplan/readingplan_note_list.html.twig line 1

Open in your IDE?
  1. {% if reading_plan_notes is defined and reading_plan_notes is not empty %}
  2.         <div class="col-4">
  3.                         
  4.         {% for curr_record in reading_plan_notes %}                    
  5.             <div class="card" style="background: #fff20540;">
  6.                 <div class="card-body" >
  7.                     {% set nID = curr_record.id %}
  8.                     <p class="text-content" id="note{{ nID }}">{{ curr_record.text|raw }}</p>
  9.                 </div>
  10.                 <div class="card-footer" style="background-color:unset;">
  11.                     <span><a href="javascript:editNote({{ nID }})"><i class="fas fa-pencil"></i></a> <a href="javascript:copyNote({{ nID }})"><i class="fas fa-copy" id="copy{{ nID }}"></i><i class="fas fa-check" id="check{{ nID }}" style="display:none"></i></a></span>
  12.                     <span style="float:right;"><a href="javascript:deleteNote({{ nID }})" style="color:#333333;"><i class="fas fa-trash-can"></i></a></span>
  13.                 </div>
  14.             </div>
  15.             <div class="card-deck" style="margin-top:20px;"></div>                                         
  16.         {% endfor %} 
  17.                 
  18.         {% set sTitle = app.session.get('ui_str')["readingplan.add.another.note"]|raw %}
  19. <a class="btn btn-outline-dark" href="javascript:addReadingPlanNote({{ current_step_id }});"><i class="fas fa-clipboard"></i> {{ sTitle }}</a>
  20.         </div>
  21.         
  22.         <script>
  23.             function copyNote(vNoteID)
  24.             {
  25.                 if (navigator.clipboard == null) {    
  26.                     alert("Unable to copy the note.");
  27.                 } else {
  28.                     var sText = $("#note"+vNoteID).text();    
  29.                     navigator.clipboard.writeText(sText);
  30.                     $("#copy"+vNoteID).hide();
  31.                     $("#check"+vNoteID).show();
  32.                     setTimeout(function() {
  33.                          $("#copy"+vNoteID).show();
  34.                         $("#check"+vNoteID).hide();
  35.                     }, 2000);
  36.                 }
  37.             }
  38.             
  39.             function editNote(vID)
  40.             {
  41.                 {% if not bLoggedIn %}
  42.                     if(confirm(sMsgLogin))
  43.                     {
  44.                         window.location.href = "{{ path('login') }}";
  45.                     }
  46.                 {% else %}            
  47.                     popupWin("{{ path('mynote') }}?action=edit&id="+vID+"&rps={{ current_step_id }}", 'note_win',screen.width*0.6, screen.height*0.7);
  48.                 {% endif %}
  49.             }
  50.             
  51.             function deleteNote(vID)
  52.             {
  53.                 {% if not bLoggedIn %}
  54.                     if(confirm(sMsgLogin))
  55.                     {
  56.                         window.location.href = "{{ path('login') }}";
  57.                     }
  58.                 {% else %}    
  59.                     if(confirm("{{ app.session.get('ui_str')["confirm.delete.mynote"]|raw }}"))
  60.                     {
  61.                         var sUrl = "/dbadmin/sc_deletemynote.php?id="+vID;            
  62.                         $.ajax({ url: sUrl, success: function(sHtml) {    
  63.                             window.location.reload();
  64.                         } });
  65.                     }
  66.                 {% endif %}
  67.             }
  68.         </script>                            
  69.     {% endif %}