{% if reading_plan_notes is defined and reading_plan_notes is not empty %}
<div class="col-4">
{% for curr_record in reading_plan_notes %}
<div class="card" style="background: #fff20540;">
<div class="card-body" >
{% set nID = curr_record.id %}
<p class="text-content" id="note{{ nID }}">{{ curr_record.text|raw }}</p>
</div>
<div class="card-footer" style="background-color:unset;">
<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>
<span style="float:right;"><a href="javascript:deleteNote({{ nID }})" style="color:#333333;"><i class="fas fa-trash-can"></i></a></span>
</div>
</div>
<div class="card-deck" style="margin-top:20px;"></div>
{% endfor %}
{% set sTitle = app.session.get('ui_str')["readingplan.add.another.note"]|raw %}
<a class="btn btn-outline-dark" href="javascript:addReadingPlanNote({{ current_step_id }});"><i class="fas fa-clipboard"></i> {{ sTitle }}</a>
</div>
<script>
function copyNote(vNoteID)
{
if (navigator.clipboard == null) {
alert("Unable to copy the note.");
} else {
var sText = $("#note"+vNoteID).text();
navigator.clipboard.writeText(sText);
$("#copy"+vNoteID).hide();
$("#check"+vNoteID).show();
setTimeout(function() {
$("#copy"+vNoteID).show();
$("#check"+vNoteID).hide();
}, 2000);
}
}
function editNote(vID)
{
{% if not bLoggedIn %}
if(confirm(sMsgLogin))
{
window.location.href = "{{ path('login') }}";
}
{% else %}
popupWin("{{ path('mynote') }}?action=edit&id="+vID+"&rps={{ current_step_id }}", 'note_win',screen.width*0.6, screen.height*0.7);
{% endif %}
}
function deleteNote(vID)
{
{% if not bLoggedIn %}
if(confirm(sMsgLogin))
{
window.location.href = "{{ path('login') }}";
}
{% else %}
if(confirm("{{ app.session.get('ui_str')["confirm.delete.mynote"]|raw }}"))
{
var sUrl = "/dbadmin/sc_deletemynote.php?id="+vID;
$.ajax({ url: sUrl, success: function(sHtml) {
window.location.reload();
} });
}
{% endif %}
}
</script>
{% endif %}