{% load djblets_utils %}
{% load staticfiles %}
<div class="admin-widget widget-draggable widget-collapsable widget-masonry-item widget-{{widget.size}}{% if widget.collapsed %} widget-hidden %}{% endif %}{% if widget.actions %} widget-has-actions{% endif %}" id="{{widget.name}}">
 <h1 class="widget-heading">
{% if widget.icon %}
  <img src="{% static widget.icon %}" alt="{{widget.title}}" width="14" height="14" />
{% endif %}
  {{widget.title}}
  <div class="btn-state rb-icon rb-icon-admin-{% if widget.collapsed %}expand{% else %}collapse{% endif %}"></div>
 </h1>
 <div class="widget-content">
  {% if widget.template %}
  {% include widget.template %}
  {% endif %}
 </div>
{% if widget.actions %}
 <div class="widget-actions">
{%  for action in widget.actions %}
  <a href="{{action.url|default:'#'}}"{% attr "class" %}{{action.classes}}{% endattr %}{% attr "id" %}{{action.id}}{% endattr %}{% attr "rel" %}{{action.rel}}{% endattr %}>{{action.label}}</a>
{%  endfor %}
 </div>
{% endif %}
</div>
