<div id="folderlisting-main-table"
     i18n:domain="plone">
  <input type="hidden" name="sort_on"
         tal:attributes="value request/sort_on|string:getObjPositionInCourse"
         />
  <input type="hidden" name="state"
  	 tal:attributes="value request/state|string:InProgress"
	 />
  <input type="hidden" name="pagenumber" tal:attributes="value view/batch/pagenumber"/>
  <input type="hidden" name="orig_template" tal:attributes="value view/viewname"/>
  <tal:block condition="view/selectall">
    <input type="hidden" name="paths:list"
           tal:repeat="item view/batch/items_not_on_page"
           tal:attributes="value item/path"/>
  </tal:block>

  <!-- <div metal:use-macro="context/document_actions/macros/document_actions">
      Document actions (print, sendto etc)
  </div> -->
  <p class="discreet"
     tal:condition="not: view/batch"
     i18n:translate="description_no_visible_items_add_paste">
     This folder has no visible items. To add content, press the
     add button, or paste content from another location.
  </p>

  <metal:listing define-macro="folder_listing"
                 tal:define="nosortclass view/get_nosort_class">
                             
  <div class="visualClear" id="clear-space-before-navigation"><!-- --></div>

    <div tal:replace="structure view/batching"/>
    <table class="listing"
           id="listing-table"
           summary="Content listing"
           i18n:attributes="summary summary_content_listing;"
           tal:condition="view/items">
      <thead>
          <tr tal:condition="view/selectall">
            <th colspan="6" class="nosort">
              All <tal:block replace="view/batch/size"/> items in this folder
              are selected. 
              <a tal:attributes="href view/selectnone_url" 
                 id="foldercontents-clearselection">Clear selection</a>
            </th>
          </tr>

          <tr>
            <th class="nosort">&nbsp;</th>
            <th tal:attributes="class nosortclass"
                id="foldercontents-title-column">&nbsp;<tal:title i18n:translate="listingheader_title"
                >Title</tal:title>&nbsp;</th>
            <th tal:attributes="class nosortclass"
                id="foldercontents-size-column">&nbsp;<tal:size i18n:translate="listingheader_size"
                >Size</tal:size>&nbsp;</th>
            <th tal:attributes="class nosortclass"
                id="foldercontents-modified-column">&nbsp;<tal:modified i18n:translate="listingheader_modified"
                >Modified</tal:modified>&nbsp;</th>
            <th tal:attributes="class nosortclass"
                id="foldercontents-status-column">&nbsp;<tal:state i18n:translate="listingheader_status"
                >State</tal:state>&nbsp;</th>
            <th class="nosort" 
                id="foldercontents-cc-column">
              &nbsp;<tal:cc i18n:domain="eduCommons" i18n:translate="">Flags</tal:cc>&nbsp;</th>
          </tr>
      </thead>

      <metal:block tal:condition="view/batch">
      <tbody>
          <tal:items tal:repeat="item view/batch">
              <tr tal:attributes="class item/table_row_class;
                                  id string:folder-contents-item-${item/id};" >

                 <tal:comment replace="nothing">
                      * We have to check if the browserDefault stuff is really necessary
                      * Create title_or_id metadata in the catalog (why not just use item.Title or item.getId? (alecm))
                 </tal:comment>

                 <td class="notDraggable">
                     <input type="checkbox"
                            class="noborder"
                            name="paths:list" id="#"
                            value="#"
                            tal:attributes="value   item/path;
                                            id      string:cb_${item/id};
                                            checked item/checked;
                                            alt     string:Select ${item/title_or_id};
                                            title   string:Select ${item/title_or_id}" />
                <input type="hidden" name="selected_obj_paths:list" value="#"
                       tal:attributes="value item/relative_url" />
                <label tal:content="item/title_or_id"
                       tal:attributes="for string:cb_${item/id}" 
                       class="hiddenStructure">
                  Item Title
                </label>
              </td>
              <td>
                  <span tal:attributes="class item/type_class">
                      <img tal:replace="structure item/icon" />
                      <a href="#" tal:attributes="href  item/view_url;
                                                title string: ${item/obj_type}: ${item/brain/Description};
                                                class item/state_class;">
                        <strong tal:omit-tag="not: item/is_browser_default"
                            tal:content="item/title_or_id"/>
                      </a>
                  </span>

                  <span class="state-expired"
                        tal:condition="item/is_expired"
                        i18n:translate="time_expired">expired</span>
              </td>

              <td>
                <span tal:condition="not: item/size"> &nbsp; </span>
                <span tal:condition="item/size"
                      tal:content="item/size"
                      tal:attributes="class item/state_class"> size </span>
              </td>
              <td tal:content="item/modified"
                  tal:attributes="class item/state_class">
                  08/19/2001 03:01 AM
              </td>
              <td>
                  <span i18n:translate=""
                        tal:condition="item/state_title"
                        tal:content="item/state_title"
                        tal:attributes="class item/state_class" />
                  <span tal:condition="not: item/state_title">&nbsp;</span>
              </td>
              <td tal:define="copyright_status item/brain/getCopyrightCleared|nothing;
			      access_status item/brain/getAccessibilityCompliant|nothing" 
		  width="15px" 
		  align="center">
		<span tal:condition="copyright_status" style="color: green;">c</span>
		<span tal:condition="access_status" style="color: blue;">a</span>
              </td>
             </tr>
          </tal:items>
      </tbody>
    </metal:block>
  </table>
  <div tal:replace="structure view/batching"/>
  <tal:buttons tal:repeat="button view/buttons">
    <input class="context"
           type="submit"
           name=""
           value=""
           i18n:attributes="value"
           tal:attributes="value button/title; name button/url; class button/cssclass" />
  </tal:buttons>
  </metal:listing>
</div>
