<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      tal:omit-tag="">
  <head tal:replace="nothing"><title></title></head>
  <body tal:omit-tag="">
    <h1 tal:replace="structure here/manage_page_header">Header</h1>

    <h2 tal:define="manage_tabs_message request/manage_tabs_message | options/manage_tabs_message | nothing;
                    management_view options/management_view|nothing"
        tal:replace="structure here/manage_tabs">
      Tabs
    </h2>

    <h3 tal:define="form_title string:Installable Products"
        tal:replace="structure here/manage_form_title">
      Form Title
    </h3>

    <form action="installProducts"
          tal:attributes="action string:${context/absolute_url}/installProducts"
          method="POST">

      <table>
        <tr class="form-help">
          <td></td>
          <td>Product Name</td>
          <td></td>
          <td>Version</td>
        </tr>
        <tr tal:repeat="product here/listInstallableProducts">
          <td class="form-element">
            <input type="checkbox"
                   name="products:list"
                   tal:attributes="value product/id"
                   />
          </td>
          <td tal:content="product/id"
              class="form-label">
            product name
          </td>
          <td>
            <a tal:condition="product/hasError"
               tal:attributes="href string:${product/id}/manage_workspace"
               class="form-help">
              <img src="/misc_/PageTemplates/exclamation.gif"
                   alt=""
                   />
            </a>
          </td>
          <td tal:content="python:here.getProductVersion(product['id'])"
              class="form-help">
          </td>
        </tr>
        <tr>
          <td></td>
          <td class="form-element">
            <input type="submit"
                   class="form-element"
                   i18n:attributes="value"
                   value="Install"
                   />
          </td>
          <td></td>
          <td></td>
        </tr>
      </table>
    </form>

    <h3 tal:define="form_title string:Installed Products"
        tal:replace="structure here/manage_form_title">
      Form Title
    </h3>

    <form action="uninstallProducts"
          tal:attributes="action here/absolute_url"
          method="POST">

      <table>
        <tr class="form-help">
          <td></td>
          <td>Product</td>
          <td>Version at Install time</td>
          <td>Product version</td>
        </tr>
        <tal:block tal:repeat="product here/listInstalledProducts" >
          <tr tal:define="prodver python:here.getProductVersion(product['id'])">
            <td class="form-element">
              <input tal:condition="not:product/isLocked"
                     type="checkbox"
                     name="products:list"
                     tal:attributes="value product/id"
                     />
            </td>
            <td class="form-label">
              <a tal:attributes="href string:${context/absolute_url}/${product/id}/manage_workspace"
                 tal:content="product/id">
                product name
              </a>
            </td>
            <td tal:content="product/installedVersion"
                class="form-help">
              product version
            </td>
            <td tal:condition="python:here.isProductAvailable(product['id'])"
                class="form-help">
              <font tal:attributes="color python:test(prodver != product['installedVersion'],'#ff0000','#000000')"
                    tal:content="prodver">
                product version
              </font>
            </td>
            <td tal:condition="python:not here.isProductAvailable(product['id'])"
                class="form-help">
              <font color="#ff0000">
                removed from Products folder
              </font>
            </td>
          </tr>
        </tal:block>
        <tr>
          <td></td>
          <td class="form-element">
            <input type="submit"
                   class="form-element"
                   i18n:attributes="value"
                   value="Uninstall"
                   name="uninstallProducts:method"
                   />
          <input type="submit"
                   class="form-element"
                   i18n:attributes="value"
                   value="Reinstall"
                   name="reinstallProducts:method"
                   />

          </td>
        </tr>
      </table>
    </form>
  </body>
</html>
