{% extends "::base.html.twig" %}  
{% block image %}{% endblock %}   
{% block body %}

    <div id="note_edit" >
        <form id="clientform" action="{{ path('DorcasTabithaBundle_note_update',
            { 'note_id' : note.noteid } ) }}" method="post" {{ form_enctype(form) }} class="dorcas">
            <h4>Edit a Note - Admin and Creator Only</h4>
            Entered By: {{ note.user }} &nbsp; &nbsp; Date: {{ note.createddt|date("m/d/Y") }}
            <div >
                {{ form_label(form.note, '')}}
                {{ form_errors(form.note) }}
                {{ form_widget(form.note, { 'attr': {'rows': '4', 'cols': '100', 'class': 'tinymce'} }) }}
            </div>
            <div style=" padding-top: 18px;">
                <input type="submit" value="Save and Close Window" onclick="closeandreload()" >
            </div>      
            {{ form_rest(form) }}
            {% if app.session.hasFlash('notice') %}
                <div class="flash-notice" >
                    {{ app.session.flash('notice') }}
                </div>
            {% endif %}
            <br />
        </form>
    </div>

{% endblock %}

{% block logout %}{% endblock %}

{% block javascripts %}

    {{ parent() }}

<script src="{{ asset('bundles/DorcasTabitha/js/js/tiny_mce/jquery.tinymce.js') }}" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function(){

	$('textarea').tinymce({
            // Location of TinyMCE script - changed for tabitha
            script_url : '{{ asset('bundles/DorcasTabitha/js/js/tiny_mce/tiny_mce.js') }}',

            // General options
            theme : "advanced",
            readonly : false,
            plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
  
            // Added for Tabitha to force absolute paths for emoticons
            relative_urls : false, 

            // Theme options
            theme_advanced_buttons1 : "bold,italic,underline,|,formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,|,cut,copy,paste,|,emotions,iespell,|,print,",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            // commented for tabitha
            theme_advanced_statusbar_location : "none",
            theme_advanced_resizing : true,

            // Example content CSS (should be your site CSS) - changed for tabitha
            content_css : '{{ asset('bundles/DorcasTabitha/css/base.css') }}',

            // Drop lists for link/image/media/template dialogs
            template_external_list_url : "lists/template_list.js",
            external_link_list_url : "lists/link_list.js",
            external_image_list_url : "lists/image_list.js",
            media_external_list_url : "lists/media_list.js",

            // Replace values for the template plugin
            template_replace_values : {
                username : "Some User",
                staffid : "991234"
            }
        });
		
});          

</script>


<script type="text/javascript">

function closeandreload(){ 
    var form = document.forms["clientform"];
    form.submit();
    opener.location.reload(true); // or opener.location.href = opener.location.href;
    window.close(); // or self.close(); 
}

</script>

    
{% endblock %}

 
