Changeset 1243

Show
Ignore:
Timestamp:
09/12/08 11:48:41
Author:
liebster
Message:

fixed add/update canonical_url

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPingTool/trunk/PingTool.py

    r697 r1243  
    101101            url = canonical_url + url 
    102102        else: 
     103            status = 'failed' 
    103104            return status, 'Ping is impossible.See portal_pingtool.' 
    104105 
     
    108109        result = 'ok' 
    109110        if not pingProp['enable_ping']: 
    110            message = 'Ping is dissabled' 
    111            return status, message 
     111            status = 'failed' 
     112            message = 'Ping is dissabled' 
     113            return status, message 
    112114        if ps.isSyndicationAllowed(blog): 
    113115            sites = pingProp['ping_sites'] 
  • qPingTool/trunk/adapter.py

    r697 r1243  
    2020class CanonicalURL(object): 
    2121    """ CanonicalURL adapter 
     22 
     23    >>> ICanonicalURL.implementedBy(CanonicalURL) 
     24    True 
     25    >>> ICanonicalURL(CanonicalURL(object)) is not None 
     26    True 
    2227    """ 
     28 
    2329    implements(ICanonicalURL) 
    2430 
  • qPingTool/trunk/www/overview.zpt

    r697 r1243  
    11<tal:header tal:replace="structure here/manage_page_header|nothing">Header</tal:header> 
    22<tal:message tal:define="manage_tabs_message options/manage_tabs_message | request/manage_tabs_message | nothing" 
    3     tal:replace="structure here/manage_tabs">Tabs</tal:message> 
     3             tal:replace="structure here/manage_tabs">Tabs</tal:message> 
    44<tal:body  
    5    tal:define="canonical_url_value request/canonical_url_value | python:modules['Products.qPingTool.util'].getCanonicalURL(here)
    6                hasCanonicalURL request/hasCanonicalURL | python:test(canonical_url_value, 1, 0); 
    7                action python:test(hasCanonicalURL, 'Update', 'Add'); 
     5   tal:define="portal here/portal_url/getPortalObject
     6               canonical_url_value request/canonical_url_value | python:portal.getProperty('canonical_url'); 
     7               hasCanonicalURL request/hasCanonicalURL | python:portal.hasProperty('canonical_url'); 
    88               button request/submit | nothing; 
    99               submitted request/submitted | nothing;"> 
     10   <div tal:condition="submitted" 
     11        tal:omit-tag=""> 
     12      <tal:common> 
     13         <div tal:condition="python:button=='Update' and hasCanonicalURL"> 
     14            <tal:block define="result python:portal.manage_changeProperties(canonical_url=canonical_url_value)"/> 
     15         </div> 
     16         <div tal:condition="python:button=='Add' and not hasCanonicalURL"> 
     17            <tal:block define="result python:portal.manage_addProperty('canonical_url', canonical_url_value, 'string')"/> 
     18         </div> 
     19      </tal:common> 
     20   </div> 
    1021 
    11 <div tal:condition="submitted" 
    12      tal:omit-tag="string:"> 
    13   <tal:common 
    14     define="portal here/portal_url/getPortalObject;"> 
    15     <div tal:condition="python:button=='Update'"> 
    16         <tal:block define="result python:portal.manage_changeProperties(canonical_url=canonical_url_value)"/> 
    17     </div> 
    18     <div tal:condition="python:button=='Add'"> 
    19         <tal:block define="result python:portal.manage_addProperty('canonical_url', canonical_url_value, 'string')"/> 
    20     </div> 
    21   </tal:common> 
    22 </div> 
     22   <h3>Overview</h3> 
     23   <p> 
     24      <strong>portal_pingtool</strong> is symple tool to enable pinging of external feed agregators. 
     25   </p> 
     26   <div tal:omit-tag="" 
     27        tal:define="hasCanonicalURL request/hasCanonicalURL | python:portal.hasProperty('canonical_url'); 
     28                    action python:test(hasCanonicalURL, 'Update', 'Add');"> 
     29      <h3 tal:content="string:$action Canonical URL">Update Canonical URL</h3> 
     30      <p tal:condition="not:hasCanonicalURL">Until you setup canonical_url - Ping Tool will not work.</p> 
    2331 
    24 <h3>Overview</h3> 
     32      <form method="post" action="" tal:attributes="action python:'manage_'+template.getId()"> 
     33         <input type="hidden" name="submitted" value="1" /> 
     34         <p class="form-help" 
     35            tal:content="string:To $action the property, enter a canonical URL value and click the &quot;$action&quot; button"> 
     36            To Add/Update the property, enter a canonical URL value and click the &quot;Add/Update&quot; button. 
     37         </p> 
    2538 
    26 <p> <strong>portal_pingtool</strong> is symple tool to enable pinging of external feed agregators. 
    27 </p> 
    28  
    29  
    30 <h3 tal:content="string:$action Canonical URL">Update Canonical URL</h3> 
    31  
    32   <p tal:condition="not:hasCanonicalURL">Until you setup canonical_url - Ping Tool will not work.</p> 
    33  
    34   <form method="put" action="" tal:attributes="action template/getId"> 
    35     <input type="hidden" name="submitted" value="1" /> 
    36  
    37     <p class="form-help" 
    38        tal:content="string:To $action the property, enter a canonical URL value and click the &quot;$action&quot; button"> 
    39     To Add/Update the property, enter a canonical URL value 
    40     and click the &quot;Add/Update&quot; button. 
    41     </p> 
    42  
    43     <table> 
    44       <tr> 
    45         <td align="left" valign="top"> 
    46           <div class="form-label">Canonical URL</div> 
    47         </td> 
    48         <td align="left" valign="top"> 
    49           <input type="text" size="30" value="" name="canonical_url_value" 
    50               tal:attributes="value canonical_url_value | nothing"/> 
    51       </tr> 
    52       <tr> 
    53         <td align="right" valign="top"> 
    54           <div class="form-element"> 
    55             <input class="form-element" type="submit" name="submit" value="Save" 
    56                     tal:attributes="value string:$action;" /> 
    57           </div> 
    58         </td> 
    59       </tr> 
    60     </table> 
    61   </form> 
     39         <table> 
     40            <tr> 
     41               <td align="left" valign="top"> 
     42                  <div class="form-label">Canonical URL</div> 
     43               </td> 
     44               <td align="left" valign="top"> 
     45                  <input type="text" size="30" value="" name="canonical_url_value" 
     46                     tal:attributes="value canonical_url_value | nothing"/> 
     47            </tr> 
     48            <tr> 
     49               <td align="right" valign="top"> 
     50                  <div class="form-element"> 
     51                     <input class="form-element" type="submit" name="submit" value="Save" 
     52                        tal:attributes="value string:$action;" /> 
     53                  </div> 
     54               </td> 
     55            </tr> 
     56         </table> 
     57      </form> 
     58   </div> 
    6259</tal:body> 
    6360<tal:footer tal:replace="structure here/manage_page_footer|nothing">footer</tal:footer>