<mt:setvarblock name="page_title"><mt:if name="blog_id"><__trans phrase="Manage [_1] Widgets" params="<mt:if name="is_blog"><__trans phrase="Blog"><mt:else><__trans phrase="Website"></mt:if>"><mt:else><__trans phrase="Manage Global Widgets"></mt:if></mt:setvarblock>
<mt:var name="position_actions_top" value="1">

<mt:setvarblock name="html_head" append="1">
<script type="text/javascript" src="<mt:var name="static_uri">/js/widget.js"></script>
<script type="text/javascript">
/* <![CDATA[ */
var widgetSetTableSelect;
var widgetTableSelect;
function init() {
    // setup
    widgetSetTableSelect = new TC.TableSelect( "template-listing-table" );
    widgetSetTableSelect.rowSelect = true;
    widgetTableSelect = new TC.TableSelect( "widget-listing-table" );
    widgetTableSelect.rowSelect = true;
}
/* ]]> */
</script>
</mt:setvarblock>

<mt:setvarblock name="action_buttons">
<button
   onclick="doRemoveItems(getByID('template-listing-form'), '<__trans phrase="Widget Set" escape="js">', '<__trans phrase="Widget Sets" escape="js">', '', '', 'delete_widget'); return false;"
   accesskey="x"
   title="<__trans phrase="Delete selected Widget Sets (x)">"
   class="button">
  <__trans phrase="Delete">
</button>
</mt:setvarblock>

<mt:setvarblock name="related_content">
<mt:if name="object_loop">
  <mtapp:widget id="tips" label="<__trans phrase="Helpful Tips">">
    <p><__trans phrase="To add a widget set to your templates, use the following syntax:"></p>
    <p><__trans phrase="<strong>&lt;$MTWidgetSet name=&quot;Name of the Widget Set&quot;$&gt;</strong>"></p>
  </mtapp:widget>
</mt:if>
<$MTApp:PageActions from="list_template"$>
</mt:setvarblock>

<mt:setvarblock name="system_msg">
<mt:if name="rebuild">
  <mtapp:statusmsg
     id="saved-msg"
     class="success"
     rebuild="all"
     can_close="0">
    <__trans phrase="Your changes to the widget set have been saved.">
  </mtapp:statusmsg>
</mt:if>
<mt:if name="deleted">
  <mtapp:statusmsg
     id="delete-msg"
     class="info"
     rebuild="all"
     can_close="0">
    <__trans phrase="You have successfully deleted the selected widget set(s) from your blog.">
  </mtapp:statusmsg>
</mt:if>
</mt:setvarblock>

<mt:include name="include/header.tmpl">

<mt:setvarblock name="listing_header">
<h2><__trans phrase="Widget Sets"></h2>
<p><a href="<mt:var name="script_url">?__mode=edit_widget&amp;blog_id=<mt:var name="blog_id">" class="icon-left icon-create"><__trans phrase="Create Widget Set"></a></p>
</mt:setvarblock>

<mtapp:listing hide_pager="1">
<mt:if name="__first__">
  <mt:setvarblock name="table_header">
    <tr>
      <th class="col head cb"><input type="checkbox" name="id-head" value="all" class="select" /></th>
      <th class="col head widgetmanager-name primary"><span class="col-label"><__trans phrase="Name"></span></th>
      <th class="col head widgetmanager-widgets primary"><span class="col-label"><__trans phrase="Installed Widgets"></span></th>
    </tr>
  </mt:setvarblock>
  <thead>
    <mt:var name="table_header">
  </thead>
  <tfoot>
    <mt:var name="table_header">
  </tfoot>
  <tbody>
</mt:if>
    <tr class="<mt:if name="__odd__">odd<mt:else>even</mt:if>">
      <td class="col cb"><input type="checkbox" name="id" value="<mt:var name="id" escape="html">" class="select" /></td>
      <td class="col widgetmanager-name"><a href="?__mode=edit_widget&blog_id=<mt:var name="blog_id">&id=<mt:var name="id" escape="url">"><mt:var name="widgetmanager" escape="html"></a></td>
      <td class="col widgetmanager-widgets"><mt:var name="names" escape="html"></td>
    </tr>
<mt:if name="__last__">
  </tbody>
</mt:if>
<mt:else>
  <div id="<$mt:var name="template_type"$>-listing" class="listing zero-state-listing zero-state">
    <div class="listing-header">
      <mt:var name="listing_header">
    </div>
    <mtapp:statusmsg
       id="zero-state"
       class="info zero-state"
       can_close="0">
      <__trans phrase="No widget sets could be found.">
    </mtapp:statusmsg>
  </div>
</mtapp:listing>

<mt:setvarblock name="create_link">
<p><a href="<mt:var name="script_url">?__mode=view&amp;_type=template&amp;type=widget&amp;blog_id=<mt:var name="blog_id">" class="icon-left icon-create"><__trans phrase="Create widget template"></a></p>
</mt:setvarblock>

<mt:include name="include/template_table.tmpl"
    object_loop="$widget_table"
    template_type="widget"
    has_list_actions="$widget_has_list_actions"
    has_pulldown_actions="$widget_has_pulldown_actions"
    list_actions="$widget_list_actions"
    more_list_actions="$widget_more_list_actions">

<mt:setvarblock name="jq_js_include" append="1">
    init();
    jQuery.mtCheckbox();
</mt:setvarblock>

<mt:include name="include/footer.tmpl">
