<tal:header tal:replace="structure context/manage_page_header|nothing">Header</tal:header>
<tal:message tal:define="manage_tabs_message options/manage_tabs_message | request/manage_tabs_message | nothing"
             tal:replace="structure context/manage_tabs">Tabs</tal:message>
<tal:body 
   tal:define="portal context/portal_url/getPortalObject;
               canonical_url_value request/canonical_url_value | python:portal.getProperty('canonical_url');
               hasCanonicalURL request/hasCanonicalURL | python:portal.hasProperty('canonical_url');
               button request/submit | nothing;
               submitted request/submitted | nothing;">
   <div tal:condition="submitted"
        tal:omit-tag="">
      <tal:common>
         <div tal:condition="python:button=='Update' and hasCanonicalURL">
            <tal:block define="result python:portal.manage_changeProperties(canonical_url=canonical_url_value)"/>
         </div>
         <div tal:condition="python:button=='Add' and not hasCanonicalURL">
            <tal:block define="result python:portal.manage_addProperty('canonical_url', canonical_url_value, 'string')"/>
         </div>
      </tal:common>
   </div>

   <h3>Overview</h3>
   <p>
      <strong>portal_pingtool</strong> is symple tool to enable pinging of external feed agregators.
   </p>
   <div tal:omit-tag=""
        tal:define="hasCanonicalURL request/hasCanonicalURL | python:portal.hasProperty('canonical_url');
                    action python:test(hasCanonicalURL, 'Update', 'Add');">
      <h3 tal:content="string:$action Canonical URL">Update Canonical URL</h3>
      <p tal:condition="not:hasCanonicalURL">Until you setup canonical_url - Ping Tool will not work.</p>

      <form method="post" action="" tal:attributes="action template/getId">
         <input type="hidden" name="submitted" value="1" />
         <p class="form-help"
            tal:content="string:To $action the property, enter a canonical URL value and click the &quot;$action&quot; button">
            To Add/Update the property, enter a canonical URL value and click the &quot;Add/Update&quot; button.
         </p>

         <table>
            <tr>
               <td align="left" valign="top">
                  <div class="form-label">Canonical URL</div>
               </td>
               <td align="left" valign="top">
                  <input type="text" size="30" value="" name="canonical_url_value"
                     tal:attributes="value canonical_url_value | nothing"/>
            </tr>
            <tr>
               <td align="right" valign="top">
                  <div class="form-element">
                     <input class="form-element" type="submit" name="submit" value="Save"
                        tal:attributes="value string:$action;" />
                  </div>
               </td>
            </tr>
         </table>
      </form>
   </div>
</tal:body>
<tal:footer tal:replace="structure context/manage_page_footer|nothing">footer</tal:footer>
