{% load i18n %}

<li><a class="ajax-modal" href="{% url 'widget_update' widget.get_ct_name widget.id %}">{% trans 'Edit' %}</a></li>
<li><a id="ajax-info-{{ widget.fe_identifier }}" href='#'>{% trans 'Info' %}</a></li>
<li class="divider"></li>

<li class="dropdown-submenu">
  <a tabindex="-1" href="#">Positioning</a>
    <ul class="dropdown-menu">
      <li><a href="{% url 'widget_reorder' widget.get_ct_name widget.id -1 %}">{% trans 'Up' %}</a></li>
      <li><a href="{% url 'widget_reorder' widget.get_ct_name widget.id 1 %}">{% trans 'Down' %}</a></li>
      <li><a href="{% url 'widget_reorder' widget.get_ct_name widget.id 0 %}">{% trans 'As first' %}</a></li>
      <li><a href="{% url 'widget_reorder' widget.get_ct_name widget.id 5 %}">{% trans 'As Last' %}</a></li>
    </ul>
</li>
<li class="divider"></li>
<li><a class="ajax-modal" href="{% url 'widget_delete' widget.get_ct_name widget.id %}">{% trans 'Delete' %}</a></li>

<script type="text/javascript">

$(function() {

  $('#ajax-info-' + '{{ widget.fe_identifier }}').on('click', function (evt, modal) {
  	    $.ajax({
        type: "GET",
        url: '{% url 'widget_info' widget.get_ct_name widget.id %}',
        async: true,
        success: function(data){
          horizon.autoDismissAlerts();
        }      
      });
  });
});

</script>