[Checkins] SVN: Products.GenericSetup/trunk/ - moved sorting to the listContextInfos method

Yvo Schubbe y.2011 at wcm-solutions.de
Thu Mar 10 03:49:04 EST 2011


Log message for revision 120837:
  - moved sorting to the listContextInfos method
  - fixed some HTML issues

Changed:
  U   Products.GenericSetup/trunk/Products/GenericSetup/tool.py
  U   Products.GenericSetup/trunk/Products/GenericSetup/www/sutExportSteps.zpt
  U   Products.GenericSetup/trunk/Products/GenericSetup/www/sutImportSteps.zpt
  UU  Products.GenericSetup/trunk/Products/GenericSetup/www/sutManage.zpt
  U   Products.GenericSetup/trunk/Products/GenericSetup/www/sutSnapshots.zpt
  U   Products.GenericSetup/trunk/docs/CHANGES.rst

-=-
Modified: Products.GenericSetup/trunk/Products/GenericSetup/tool.py
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/tool.py	2011-03-10 08:14:55 UTC (rev 120836)
+++ Products.GenericSetup/trunk/Products/GenericSetup/tool.py	2011-03-10 08:49:03 UTC (rev 120837)
@@ -17,6 +17,7 @@
 import os
 import time
 from cgi import escape
+from operator import itemgetter
 
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from Acquisition import aq_base
@@ -657,11 +658,13 @@
                      'type': 'snapshot',
                    }
                     for info in self.listSnapshotInfo()]
+        s_infos.sort(key=itemgetter('title'))
         p_infos = [{'id': 'profile-%s' % info['id'],
                     'title': info['title'],
                     'type': readableType(info['type']),
                    }
                    for info in self.listProfileInfo()]
+        p_infos.sort(key=itemgetter('title'))
 
         return tuple(s_infos + p_infos)
 

Modified: Products.GenericSetup/trunk/Products/GenericSetup/www/sutExportSteps.zpt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/www/sutExportSteps.zpt	2011-03-10 08:14:55 UTC (rev 120836)
+++ Products.GenericSetup/trunk/Products/GenericSetup/www/sutExportSteps.zpt	2011-03-10 08:49:03 UTC (rev 120837)
@@ -1,5 +1,5 @@
-<h1 tal:replace="structure here/manage_page_header"> PAGE HEADER </h1>
-<h2 tal:replace="structure here/manage_tabs"> PAGE HEADER </h2>
+<h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
+<h2 tal:replace="structure context/manage_tabs">TABS</h2>
 
 <h3> Site Configuration Export Steps </h3>
 
@@ -10,8 +10,7 @@
 
 <h3>Available Export Steps</h3>
 
-<form action="." method="POST"
-      tal:attributes="action here/absolute_url" >
+<form action="." method="post" tal:attributes="action context/absolute_url">
 <input type="hidden" name="ids:default:tokens" value="" />
 
 <table cellspacing="0" cellpadding="4">
@@ -25,11 +24,11 @@
   </tr>
  </thead>
 
- <tbody tal:define="step_ids here/listExportSteps;
+ <tbody tal:define="step_ids context/listExportSteps;
                    ">
   <tal:loop tal:repeat="step_id step_ids">
   <tr valign="top"
-      tal:define="info python: here.getExportStepMetadata( step_id );"
+      tal:define="info python: context.getExportStepMetadata(step_id);"
       tal:attributes="class python:
                      repeat[ 'step_id' ].odd and 'row-normal' or 'row-hilite'" >
    <td class="list-item" width="16">
@@ -58,11 +57,11 @@
     <input class="form-element" type="submit"
            name="manage_exportSelectedSteps:method"
            value=" Export selected steps " />
-      
+
     <input class="form-element" type="submit"
            name="manage_exportAllSteps:method"
            value=" Export all steps " />
-      
+
    </td>
   </tr>
  </tbody>
@@ -70,5 +69,4 @@
 </table>
 </form>
 
-
-<h1 tal:replace="structure here/manage_page_footer"> PAGE FOOTER </h1>
+<h1 tal:replace="structure context/manage_page_footer">PAGE FOOTER</h1>

Modified: Products.GenericSetup/trunk/Products/GenericSetup/www/sutImportSteps.zpt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/www/sutImportSteps.zpt	2011-03-10 08:14:55 UTC (rev 120836)
+++ Products.GenericSetup/trunk/Products/GenericSetup/www/sutImportSteps.zpt	2011-03-10 08:49:03 UTC (rev 120837)
@@ -6,13 +6,11 @@
                    context_title python:[c['title'] for c in contexts if c['id']==context_id];
                    context_title python:context_title and context_title[0] or 'UNKNOWN';
                    extension_contexts python:[c for c in contexts if c['type'] in ['extension','snapshot']];
-                   dummy python:extension_contexts.sort(key=lambda x: x['title'])
                    ">
 <h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
-<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
-    tal:replace="structure context/manage_tabs">TABS</h2>
+<h2 tal:replace="structure context/manage_tabs">TABS</h2>
 
-<h2> Site Configuration Import Steps </h2>
+<h3>Site Configuration Import Steps</h3>
 
 <p class="form-help">
 This tool allows one to re-run individual steps of the site setup
@@ -21,7 +19,7 @@
 
 <h3>Select Profile or Snapshot</h3>
 
-<form action="." method="POST" id="profileform" tal:attributes="action string:${context/absolute_url}/manage_importSteps">
+<form action="." method="post" id="profileform" tal:attributes="action string:${context/absolute_url}/manage_importSteps">
 <select name="context_id"
         onchange="document.getElementById('profileform').submit();">
  <option value=""
@@ -44,7 +42,7 @@
 
 <h3>Available Import Steps for "<span tal:replace="context_title">Base profile</span>"</h3>
 
-<form action="." method="POST" enctype="multipart/form-data"
+<form action="." method="post" enctype="multipart/form-data"
       tal:attributes="action context/absolute_url" >
 <tal:dummy define="dummy python:context.applyContextById(context_id)"/>
 <input type="hidden" name="ids:default:tokens" value="" />
@@ -101,11 +99,11 @@
     <input class="form-element" type="submit"
            name="manage_importSelectedSteps:method"
            value=" Import selected steps " />
-      
+
     <input class="form-element" type="submit"
            name="manage_importAllSteps:method"
            value=" Import all steps " />
-      
+
     <input class="form-element" type="file"
            name="tarball" />
     <input class="form-element" type="submit"
@@ -138,4 +136,3 @@
 
 <h1 tal:replace="structure context/manage_page_footer">PAGE FOOTER</h1>
 </tal:block>
-

Modified: Products.GenericSetup/trunk/Products/GenericSetup/www/sutManage.zpt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/www/sutManage.zpt	2011-03-10 08:14:55 UTC (rev 120836)
+++ Products.GenericSetup/trunk/Products/GenericSetup/www/sutManage.zpt	2011-03-10 08:49:03 UTC (rev 120837)
@@ -1,12 +1,5 @@
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
-      xmlns:tal="http://xml.zope.org/namespaces/tal"
-      xmlns:metal="http://xml.zope.org/namespaces/metal"
-      xml:lang="en" lang="en">
-
 <h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
-<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
-    tal:replace="structure context/manage_tabs">TABS</h2>
+<h2 tal:replace="structure context/manage_tabs">TABS</h2>
 
 <h2>Manage steps registry</h2>
 
@@ -30,7 +23,7 @@
   <tal:block condition="invalid_steps">
     <h3>Steps with invalid step handlers</h3>
 
-    <form action="." method="POST"
+    <form action="." method="post"
       tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
       <input type="hidden" name="registry" value="import"/>
       <table cellspacing="0" cellpadding="4">
@@ -81,7 +74,7 @@
       persistent step registry.
     </p>
 
-    <form action="." method="POST"
+    <form action="." method="post"
       tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
       <input type="hidden" name="registry" value="import"/>
       <table cellspacing="0" cellpadding="4">
@@ -134,7 +127,7 @@
   <tal:block condition="invalid_steps">
     <h3>Steps with invalid step handlers</h3>
 
-    <form action="." method="POST"
+    <form action="." method="post"
       tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
       <input type="hidden" name="registry" value="export"/>
       <table cellspacing="0" cellpadding="4">
@@ -185,7 +178,7 @@
       persistent step registry.
     </p>
 
-    <form action="." method="POST"
+    <form action="." method="post"
       tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
       <input type="hidden" name="registry" value="export"/>
       <table cellspacing="0" cellpadding="4">
@@ -222,5 +215,5 @@
     </form>
   </tal:block>
 </tal:block>
+
 <h1 tal:replace="structure context/manage_page_footer">PAGE FOOTER</h1>
-</html>


Property changes on: Products.GenericSetup/trunk/Products/GenericSetup/www/sutManage.zpt
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: Products.GenericSetup/trunk/Products/GenericSetup/www/sutSnapshots.zpt
===================================================================
--- Products.GenericSetup/trunk/Products/GenericSetup/www/sutSnapshots.zpt	2011-03-10 08:14:55 UTC (rev 120836)
+++ Products.GenericSetup/trunk/Products/GenericSetup/www/sutSnapshots.zpt	2011-03-10 08:49:03 UTC (rev 120837)
@@ -1,5 +1,5 @@
-<h1 tal:replace="structure here/manage_page_header"> PAGE HEADER </h1>
-<h2 tal:replace="structure here/manage_tabs"> PAGE HEADER </h2>
+<h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
+<h2 tal:replace="structure context/manage_tabs">TABS</h2>
 
 <h3> Site Configuration Snapshots </h3>
 
@@ -10,12 +10,11 @@
 
 <h3>Available Snapshots</h3>
 
-<form action="." method="POST"
-      tal:attributes="action here/absolute_url" >
+<form action="." method="post" tal:attributes="action context/absolute_url">
 <input type="hidden" name="ids:default:tokens" value="" />
 
 <table cellspacing="0" cellpadding="4"
-       tal:define="snapshot_info here/listSnapshotInfo;"
+       tal:define="snapshot_info context/listSnapshotInfo;"
 >
 
  <thead tal:condition="not: snapshot_info">
@@ -60,5 +59,4 @@
 </table>
 </form>
 
-
-<h1 tal:replace="structure here/manage_page_footer"> PAGE FOOTER </h1>
+<h1 tal:replace="structure context/manage_page_footer">PAGE FOOTER</h1>

Modified: Products.GenericSetup/trunk/docs/CHANGES.rst
===================================================================
--- Products.GenericSetup/trunk/docs/CHANGES.rst	2011-03-10 08:14:55 UTC (rev 120836)
+++ Products.GenericSetup/trunk/docs/CHANGES.rst	2011-03-10 08:49:03 UTC (rev 120837)
@@ -9,7 +9,8 @@
 
 - Removed ``five.formlib`` dependency. ``zope.formlib`` is now used directly.
 
-- Import form: Sort the list of extension profiles alphabetically by title.
+- tool: 'listContextInfos' now returns profile infos sorted by type and title.
+  This makes it easier to select profiles on the "Import" and "Comparison" tab. 
 
 - Property import/export: Fixed two 'date' property issues.
   Naive 'date' values are now exported without time zone. And purging



More information about the checkins mailing list