{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <form method="POST" action="{{ path('note_template_form', {action: action, id: id}) }}" enctype="multipart/form-data">
        <div class="row max-width-initial">
            <div class="large-6 columns">
                <h5>Basic information</h5>
                <p class="form-hint-text">Enter basic information below</p>
                {#<div class="row">#}
                    {#<div class="large-3 large-text-right columns">#}
                        {#<label for="userType">User Type</label>#}
                    {#</div>#}
                    {#<div class="large-9 columns">#}
                        {#<select name="noteForm[userType]" id="">#}
                            {#<option value="All">All</option>#}
                            {#{% for userType in userTypes %}#}
                                {#<option value="{{ userType.description }}">{{ userType.description }}</option>#}
                            {#{% endfor %}#}
                        {#</select>#}
                    {#</div>#}
                {#</div>#}
                {#<div class="row">#}
                    {#<div class="large-3 large-text-right columns">#}
                        {#{{ form_label(form.company_description) }}#}
                    {#</div>#}
                    {#<div class="large-9 columns">#}
                        {#{{ form_widget(form.company_description) }}#}
                        {#{{ form_widget(form.company) }}#}
                    {#</div>#}
                {#</div>#}
                {#<div class="row">#}
                    {#<div class="large-3 large-text-right columns">#}
                        {#{{ form_label(form.healthFacility_description) }}#}
                    {#</div>#}
                    {#<div class="large-9 columns">#}
                        {#{{ form_widget(form.healthFacility_description) }}#}
                        {#{{ form_widget(form.healthFacility) }}#}
                    {#</div>#}
                {#</div>#}
                {#<div class="row">#}
                    {#<div class="large-3 large-text-right columns">#}
                        {#{{ form_label(form.chartType_description) }}#}
                    {#</div>#}
                    {#<div class="large-9 columns">#}
                        {#{{ form_widget(form.chartType_description) }}#}
                        {#{{ form_widget(form.chartType) }}#}
                    {#</div>#}
                {#</div>#}
                {#<div class="row">#}
                    {#<div class="large-3 large-text-right columns">#}
                        {#{{ form_label(form.chartStatus_description) }}#}
                    {#</div>#}
                    {#<div class="large-9 columns">#}
                        {#{{ form_widget(form.chartStatus_description) }}#}
                        {#{{ form_widget(form.chartStatus) }}#}
                    {#</div>#}
                {#</div>#}
                {#<div class="row">#}
                    {#<div class="large-3 large-text-right columns">#}
                        {#{{ form_label(form.noteType) }}#}
                    {#</div>#}
                    {#<div class="large-9 columns">#}
                        {#{{ form_widget(form.noteType) }}#}
                    {#</div>#}
                {#</div>#}
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.description) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.description) }}
                    </div>
                </div>
                <div class="row">
                    <div class="large-3 large-text-right columns">
                        {{ form_label(form.note) }}
                    </div>
                    <div class="large-9 columns">
                        {{ form_widget(form.note) }}
                    </div>
                </div>
            </div>
            <div class="small-12 columns">
                <hr class="max-width-initial">
                <div class="button-container">
                    <button type="submit" class="button just-continue" name="action" value="{{ action }}"
                            data-message="Are you sure you want to save this information?"
                    >Save</button>
                    {% if action == 'u' and (userData.type == 'Super Admin' or 'Admin Note Template Delete' in userData.accesses) %}
                        <button type="submit" class="ask-continue button alert" name="action" value="d"
                                data-message="Are you sure you want to delete this record?"
                        >Delete</button>
                    {% endif %}
                    <a href="{{ path('note_template') }}" class="button secondary">Back</a>
                </div>
            </div>
        </div>
        {{ form_widget(form.action) }}
        {{ form_widget(form.id) }}
        {{ form_widget(form._token) }}
    </form>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script>
        //<![CDATA[
        jQ(document).ready(function(){
            noteTemplate_form.settings.chartType_autocomplete_url = '{{ path('chart_type_autocomplete') }}';
            noteTemplate_form.settings.chartStatus_autocomplete_url = '{{ path('chart_status_autocomplete') }}';
            noteTemplate_form.settings.company_autocomplete_url = '{{ path('company_autocomplete') }}';
            noteTemplate_form.settings.health_facility_autocomplete_url = '{{ path('health_facility_autocomplete') }}';
            noteTemplate_form.init();
        });
        //]]>
    </script>
{% endblock %}