[Erp5-report] r32493 ivan - in /erp5/trunk/bt5/erp5_knowledge_pad: SkinTemplateItem/portal_...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Feb 12 13:56:12 CET 2010


Author: ivan
Date: Fri Feb 12 13:56:09 2010
New Revision: 32493

URL: http://svn.erp5.org?rev=32493&view=rev
Log:
Handle better server side failures like gadget edit, view form being not available.

Modified:
    erp5/trunk/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePad_viewColumnWidget.xml
    erp5/trunk/bt5/erp5_knowledge_pad/bt/revision

Modified: erp5/trunk/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePad_viewColumnWidget.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePad_viewColumnWidget.xml?rev=32493&r1=32492&r2=32493&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePad_viewColumnWidget.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/KnowledgePad_viewColumnWidget.xml [utf8] Fri Feb 12 13:56:09 2010
@@ -94,7 +94,6 @@
              title="Minimize"></a>\n
         </tal:block>\n
         <span class="gadget_title" \n
-              tal:define="dummy python:context.log(box)"\n
               tal:content="python: here.Base_translateString(box.getProperty(\'preferred_header_title\', None) or gadget.getTitle())"/>\n
         </span>\n
       </h3>\n
@@ -105,74 +104,93 @@
 \n
           <!-- Edit form -->\n
           <div class="edit-form" \n
-               tal:condition="python: not isAnon and edit_form_id is not None and not isKnowledgePadTemplateUsed"\n
+               tal:condition="python: not isAnon and edit_form_id is not None and box is not None and not isKnowledgePadTemplateUsed"\n
                tal:attributes="id edit_form_dom_id"\n
                style="display: none;">\n
 \n
-            <form action="KnowledgeBox_baseEdit"\n
-                  tal:condition="not: is_asynchronous_gadget"\n
-                  tal:define="box_relative_url python: box.getRelativeUrl();">\n
-              <div>\n
-                <span tal:replace="structure python: getattr(box, edit_form_id)()"/>\n
-                <input type="hidden" \n
-                       name="box_relative_url" \n
-                       tal:attributes="value box_relative_url"/>\n
-                <input type="hidden" \n
-                       name="cancel_url" \n
-                       tal:attributes="value cancel_url;\n
-                         name python: \'%s_cancel_url\' \n
-                                       %box_relative_url.replace(\'/\', \'_\')"/> \n
-                <button type="submit"\n
-                       i18n:translate="" \n
-                       i18n:domain="ui" \n
-                       name="KnowledgeBox_baseEdit:method">Save</button>\n
-              </div>\n
-            </form>\n
-\n
-            <tal:block tal:condition="is_asynchronous_gadget">\n
-              <span tal:replace="structure python: getattr(box, edit_form_id)()"/>\n
-              <button type="button" \n
-                i18n:translate="" \n
-                i18n:domain="ui"\n
-                tal:attributes="onclick python: \n
-                               \'sendPreferencesToServer(\\\'%s\\\', \\\'%s\\\', \\\'%s\\\', \\\'%s\\\')\'\n
-                                                         %(edit_form_dom_id, \n
-                                                           view_form_id, \n
-                                                           box.getRelativeUrl(), \n
-                                                           view_form_dom_id)">\n
-               Save</button>\n
+            <tal:block tal:define="edit_form_object python: getattr(box, edit_form_id, None);">\n
+\n
+              <tal:block tal:condition="python: edit_form_object is None">\n
+                <span i18n:translate="" \n
+                      i18n:domain="ui">Server side error.</span>\n
+              </tal:block>\n
+\n
+              <tal:block tal:condition="python: edit_form_object is not None">\n
+                <form action="KnowledgeBox_baseEdit"\n
+                      tal:condition="not: is_asynchronous_gadget"\n
+                      tal:define="box_relative_url python: box.getRelativeUrl();">\n
+                  <div>\n
+                    <span tal:replace="structure python: edit_form_object()"/>\n
+                    <input type="hidden" \n
+                           name="box_relative_url" \n
+                           tal:attributes="value box_relative_url"/>\n
+                    <input type="hidden" \n
+                           name="cancel_url" \n
+                           tal:attributes="value cancel_url;\n
+                             name python: \'%s_cancel_url\' \n
+                                         %box_relative_url.replace(\'/\', \'_\')"/> \n
+                    <button type="submit"\n
+                            i18n:translate="" \n
+                            i18n:domain="ui" \n
+                            name="KnowledgeBox_baseEdit:method">Save</button>\n
+                  </div>\n
+                </form>\n
+\n
+                <tal:block tal:condition="is_asynchronous_gadget">\n
+                  <span tal:replace="structure python: edit_form_object()"/>\n
+                  <button type="button" \n
+                          i18n:translate="" \n
+                          i18n:domain="ui"\n
+                          tal:attributes="onclick python: \n
+                                 \'sendPreferencesToServer(\\\'%s\\\', \\\'%s\\\', \\\'%s\\\', \\\'%s\\\')\'\n
+                                                           %(edit_form_dom_id, \n
+                                                             view_form_id, \n
+                                                             box.getRelativeUrl(), \n
+                                                             view_form_dom_id)">Save</button>\n
+                </tal:block>\n
+              </tal:block>\n
             </tal:block>\n
-\n
           </div>\n
   \n
-          <!-- Content render -->\n
-          <div class="content" \n
-              tal:condition="not: is_asynchronous_gadget">\n
-\n
-            <div tal:attributes="id view_form_dom_id"\n
-                 class="box_inner_content" \n
-                 tal:content="structure python: getattr(real_context,\n
-                                                        view_form_id)(box=box)"/>\n
-          </div>\n
-  \n
-          <div class="content"\n
-              tal:condition="is_asynchronous_gadget">\n
-            <div tal:attributes="id view_form_dom_id" \n
-                 class="box_inner_content"\n
-                 i18n:translate="" \n
-                 i18n:domain="ui">Loading ...</div>\n
-            <script type="text/javascript"\n
-              tal:content="structure python:\n
-                            here.KnowledgePad_generateAjaxCall(\'%s/%s\' %(current_web_section.absolute_url(),view_form_id),\n
-                                                               box,\n
-                                                               view_form_dom_id,\n
-                                                               ignore_security_check=1)">\n
-            </script>\n
-\n
-          </div>\n
-        </div>\n
-\n
-\n
+          <!-- Content render (view form) -->\n
+          <tal:block \n
+                tal:define="exists_view_form python: view_form_id is not None and \n
+                                  getattr(real_context, view_form_id, None) is not None">\n
+\n
+            <div class="content"\n
+                 tal:condition="not: exists_view_form">\n
+              <span i18n:translate="" \n
+                    i18n:domain="ui">Server side error.</span>\n
+            </div>\n
+\n
+            <tal:block tal:condition="exists_view_form">\n
+              <div class="content"\n
+                   tal:define="view_form_object python: getattr(real_context, view_form_id);">\n
+\n
+                <!-- Synchronous Gadget -->\n
+                <div tal:condition="not: is_asynchronous_gadget"\n
+                     tal:attributes="id view_form_dom_id"\n
+                     class="box_inner_content" \n
+                     tal:content="structure python: view_form_object(box=box)"/>\n
+ \n
+                <!-- Asynchronous Gadget -->\n
+                <tal:block tal:condition="is_asynchronous_gadget">\n
+                  <div tal:attributes="id view_form_dom_id" \n
+                       class="box_inner_content"\n
+                       i18n:translate="" \n
+                       i18n:domain="ui">Loading ...</div>\n
+                    <script type="text/javascript"\n
+                            tal:content="structure python:\n
+                                  here.KnowledgePad_generateAjaxCall(\'%s/%s\' %(current_web_section.absolute_url(),view_form_id),\n
+                                                                   box,\n
+                                                                   view_form_dom_id,\n
+                                                                   ignore_security_check=1)"/>\n
+                </tal:block>\n
+              </div>\n
+\n
+            </tal:block>\n
+          </tal:block>\n
+        </div>  \n
   </div>\n
   </tal:block>\n
 </tal:block>\n

Modified: erp5/trunk/bt5/erp5_knowledge_pad/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_knowledge_pad/bt/revision?rev=32493&r1=32492&r2=32493&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_knowledge_pad/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_knowledge_pad/bt/revision [utf8] Fri Feb 12 13:56:09 2010
@@ -1,1 +1,1 @@
-450
+451




More information about the Erp5-report mailing list