{% load i18n %}
{% for widget in used_widgets %}
    <div class="sidebar_item widget_{{widget.id}}" rel="{{widget.id}}">
    <h2>
    <span class="move"></span>
    <span class="title">{{widget.title}}</span>
    <a href="javascript:;" class="delete" title="Delete" onclick="delete_widget({{widget.id}});"/></a>
    <a href="javascript:;" class="edit" title="Edit" onclick="toggle_widget_editor({{widget.id}});"/></a>
    </h2>
    <div class="sidebar_editor editor_{{widget.id}}">
    <!-- form data -->
    <input type="hidden" name="widget_id" value="{{widget.id}}"/>
    {% csrf_token %}
    {{ widget.title_form.as_p }}
    <hr />
    {{ widget.admin_form.as_p}}
    {{ widget.admin_form.help_text}}
    <p>
    <input type="button" name="btn_update" value="{% trans 'Update' %}" onclick="update_widget({{widget.id}});"/>
    <img src="{{STATIC_URL}}admin/sidebar/images/loading.gif" class="widget_loading widget_loading_{{widget.id}}"/>
    </p>
    <!-- end form data -->
    </div>
    </div>
{% endfor %}

