{% if info %}{{ info }}{% endif %}
<script>
    var DROPLETS_SHOW_DATE = {% if show_date %}{{ show_date }}{% else %}0{% endif %};
</script>
<div style="padding:10px 15px 0;">
    <a class="button" href="{{ MODULE_DIR }}/add_droplet.php"><i class="fa fa-fw fa-tint"></i>{{ L_('DR_TEXT:ADD_DROPLET') }}</a>
</div>
<form method="post" action="{{ TOOL_URI }}">
    {{ FTAN }}
    <table class="droplets row_a tablesorter filters-table" id="myTable">
	<thead>
            <tr>
                <th width="40"></th>
                <th width="25%">{{ L_('TEXT:NAME') }}</th>
                <th>{{ L_('TEXT:DESCRIPTION') }}</th>
                {% if show_date %}
                <th width="6%">{{ L_('TEXT:DATE') }}</th>
                {% endif %}
                <th width="6%">{{ L_('TEXT:ACTIVE') }}</th>
                <th width="7%"></th>
            </tr>
	</thead>
	<tbody>
        {% set num_droplets = "" %}
        {% for item in droplets %}
   	    <tr id="{{ item.id }}" class="{% if item.active == 0 %}inactive{% endif %}{% if item.name in hilite %} hilite{% endif %}" data-idkey="id_{{ getIDKEY(item.id) }}">
                
                <td style="white-space:nowrap">
                    <label>
                    <input type="checkbox" class="checker" name="markeddroplet[]" id="markeddroplet[]" value="{{ item.id }}" />
                    {% if item.valid_code and item.unique %}
                        <i class="fa fa-tint"></i>
                    {% else %}
                        <i class="fa fa-tint blinking text-danger" title="{{ L_('DR_TEXT:INVALIDCODE') }}!"></i>
                    {% endif %}
                    </label>
                </td>
                
                <td style="white-space:nowrap" class="droplet-name">
                    <a href="{{ TOOL_URI }}&amp;do=modify&amp;droplet_id={{ item.id }}" title="{{ L_('DR_TEXT:MODIFY_DROPLET') }}">
                        <i class="fa fa-fw fa-edit"></i> {{ item.name }}
                    </a>
                </td>
                
                <td>
                    <span class="show-droplet-code"><i class="fa fa-info-circle"></i> {{ item.description }}</span>          
                    <div class="droplet-info" style="display:none;">
                        <pre class="droplet-code">{{ item.comments }}</pre>
                        {% set TIMESTAMP = item.modified_when + constant('TIMEZONE') %}
                        <p class="droplet-code"><em>{{ L_('MESSAGE:PAGES_LAST_MODIFIED') }} {{ get_user_name(item.modified_by) }}, {{ TIMESTAMP|date(constant('DATE_FORMAT')~ ' ' ~constant('TIME_FORMAT')) }}</em></p>
                    </div>
                </td>
                
                {% if show_date %}
                <td class="modify-date" data-sort-timestamp="{{ TIMESTAMP }}">                    
                    {{ TIMESTAMP|date(constant('DATE_FORMAT')) }} 
                </td>
                {% endif %}
                <td class="status">                     
                    <span style="display:none;">{% if item.active %}1{% else %}0{% endif %}</span>    
                    <input type="checkbox" id="switch_{{ item.id }}" switch="bool" {% if item.active == 1 %}checked{% endif %}  /><label for="switch_{{ item.id }}"></label>
                </td>
                
                <td style="white-space:nowrap; text-align: center;">
                    <a href="javascript: confirm_link('{{ item.name }}: {{ L_('DR_TEXT:DUPLICATE') }}?', '{{ TOOL_URI }}&amp;copy={{ item.id }}');" title="{{ L_('DR_TEXT:DUPLICATE') }}">
                        <i class="fa fa-fw fa-copy"></i>
                    </a>                    
                    <a href="javascript:void(0)" class="delete-item" 
                       title="{{ L_('TEXT:DELETE') }}" 
                       data-question="&raquo;<b>%s</b>&laquo; {{ L_('DR_TEXT:DROPLET_DELETE') }}" 
                       data-delete="{{ L_('TEXT:DELETE') }}" 
                       data-cancel="{{ L_('TEXT:CANCEL') }}"
                       data-del-uri="{{ TOOL_URI }}&amp;do=delete&amp;droplet_id={{ item.id }}"
                       >
                        <i class="fa  fa-fw fa-trash"></i>
                    </a>
                </td>
            </tr>
{% endfor %}
        </tbody>
    <tfoot>
        <tr>     
            <td colspan="2"><label style="font-weight:600"><input type="checkbox" id="checkAll" /> {{ droplets|length }} Droplets</label></td>
            <td align="right" colspan="{% if show_date %}4{% else %}5{% endif %}">
                <label style="font-weight:600">
                    <input type="checkbox" id="show_date" {% if show_date %}checked{% endif %} data-uri="{{ TOOL_URI }}&amp;do=show_date&amp;val={% if show_date %}{{ show_date }}{% else %}0{% endif %}" /> {{ L_('DR_TEXT:SHOW_DATE') }}
                </label>
            </td>
        </tr>
    </tfoot>
</table>
    
<div class="row" id="operateChecked" style="display:none">
    {{ L_('DR_TEXT:MARKED') }}:
    <button type="submit" class="button ico-export" name="export" id="export">{{ L_('DR_TEXT:EXPORT') }}</button>
    <button type="submit" class="button ico-delete" name="delete" id="delete" onclick="javascript: alert('{{ L_('DR_TEXT:DELETED') }}', '{{ TOOL_URI }}');">{{ L_('TEXT:DELETE') }}</button>
    <span style="font-size:smaller">{{ L_('DR_TEXT:DEL_INFO') }}</span>
</div>
</form>


