cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject svn commit: rev 54694 - cocoon/trunk/src/blocks/forms/samples/swan/forms
Date Tue, 12 Oct 2004 20:33:58 GMT
Author: tim
Date: Tue Oct 12 13:33:57 2004
New Revision: 54694

Modified:
   cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_model.xml
   cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_template.xml
Log:
Fix some bugs in the swan sitemap editor and make it pretty.


Modified: cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_model.xml
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_model.xml	(original)
+++ cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_model.xml	Tue Oct 12 13:33:57
2004
@@ -23,11 +23,6 @@
       CVS $Id$
     -->
 
-    <!--
-    TODO:
-      Add features to "items-class" (e.g. move-up, move-down, add-before, add-after).
-    -->
-
     <fd:messages id="messages"/>
 
     <fd:new id="items-class"/>
@@ -41,24 +36,17 @@
           </fd:widgets>
         </fd:repeater>
         <fd:repeater-action id="addItem" action-command="add-row" repeater="items">
-          <fd:label>+</fd:label>
+          <fd:label>Add Child</fd:label>
           <fd:on-action>
             <javascript>
               var repeater = event.getSourceWidget().lookupWidget("../items");
-              repeater.getRow(repeater.getSize() - 1).getChild("view-selector").setValue("edit");
+              var view = repeater.getRow(repeater.getSize() - 1).getChild("view-selector");
+              view.setValue("edit");
+              view.setProcessRequests(false);
               //print(widget.getRequestParameterName());
             </javascript>
           </fd:on-action>
         </fd:repeater-action>
-        <fd:repeater-action id="removeItems" action-command="delete-rows" repeater="items"
select="select">
-          <fd:label>-</fd:label>
-        </fd:repeater-action>
-      </fd:widgets>
-    </fd:class>
-
-    <fd:class id="select-class">
-      <fd:widgets>
-        <fd:booleanfield id="select"><fd:label>Select</fd:label></fd:booleanfield>
       </fd:widgets>
     </fd:class>
 
@@ -78,6 +66,7 @@
               var union = widget.lookupWidget("../union");
               var type = widget.lookupWidget("../type-selector");
               var stuff = union.lookupWidget(union.getValue() + "/stuff");
+              print("View set to: " + widget.getValue() + " for: " + widget.getRequestParameterName());
               if("edit".equals(widget.getValue())) {
                 if(stuff != null) {
                   stuff.setProcessRequests(true);
@@ -154,7 +143,18 @@
 
     <fd:class id="item-row-class">
       <fd:widgets>
-        <fd:new id="select-class"/>
+        <fd:row-action id="down" action-command="move-down">
+          <fd:label>v</fd:label>
+        </fd:row-action>
+        <fd:row-action id="up" action-command="move-up">
+          <fd:label>^</fd:label>
+        </fd:row-action>
+        <fd:row-action id="delete" action-command="delete">
+          <fd:label>X</fd:label>
+        </fd:row-action>
+        <fd:row-action id="add" action-command="add-after">
+          <fd:label>+</fd:label>
+        </fd:row-action>
         <fd:new id="view-selector-class"/>
         <fd:new id="type-selector-class"/>
         <fd:union id="union" default="" case="type-selector">

Modified: cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_template.xml
==============================================================================
--- cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_template.xml	(original)
+++ cocoon/trunk/src/blocks/forms/samples/swan/forms/sitemap_template.xml	Tue Oct 12 13:33:57
2004
@@ -30,6 +30,34 @@
     li {
       list-style-type: none
     }
+
+    /* The actions buttons, placed on the right */
+    .actions {
+      float: right;
+      padding-top: 0.2em;
+    }
+
+    /* A "section" contains stuff, related actions and substuff */
+    div.section {
+      padding-top: 0.4em;
+      padding-bottom: 0.4em;
+      padding-left: 0.4em;
+      border: 1px dotted black;
+      mmargin-top: 0.4em;
+      margin-bottom: -1px;
+    }
+
+    /* Indent sub-sections (recursively) */
+    div.section div.section {
+      margin-left: 3em;
+      border-right: none;
+    }
+
+    /* Change bg color depending on nesting depth */
+    div.section div.section { background-color: #F0F0F0; }
+    div.section div.section div.section { background-color: #E0E0E0; }
+    div.section div.section div.section div.section { background-color: #D0D0D0; }
+    div.section div.section div.section div.section div.section { background-color: #C0C0C0;
}
   </style>
 
   <title>Sitemap Editor</title>
@@ -441,11 +469,6 @@
       </ft:class>
 
       <ft:class id="view-selector-class">
-        <!--
-        <ft:widget id="view-selector">
-          <fi:styling list-type="dropdown" submit-on-change="true"/>
-        </ft:widget>
-        -->
         <ft:choose path="view-selector">
           <ft:when value="fold">
             <ft:widget id="view-view"><fi:styling type="image" src="resources/BtnGrey.gif"/></ft:widget>
@@ -463,21 +486,23 @@
       </ft:class>
 
       <ft:class id="item-row-class">
-          <ft:widget id="select"/>
-          <ft:new id="view-selector-class"/>
-          <ft:new id="type-selector-class"/>
-          <ft:new id="union-class"/>
+        <span class="actions">
+          <ft:widget id="down"><fi:styling type="image" src="resources/move_down.gif"/></ft:widget>
+          <ft:widget id="up"><fi:styling type="image" src="resources/move_up.gif"/></ft:widget>
+          <ft:widget id="delete"><fi:styling type="image" src="resources/delete.gif"/></ft:widget>
+          <ft:widget id="add"><fi:styling type="image" src="resources/new.gif"/></ft:widget>
+        </span>
+        <ft:new id="view-selector-class"/>
+        <ft:new id="type-selector-class"/>
+        <ft:new id="union-class"/>
       </ft:class>
 
       <ft:class id="items-class">
-        <ft:repeater-size id="items"/>
-        <ul>
-          <ft:repeater-widget id="items">
-            <li><ft:new id="item-row-class"/></li>
-          </ft:repeater-widget>
-        </ul>
         <ft:widget id="addItem"/>
-        <ft:widget id="removeItems"/><br/>
+        <ft:repeater-size id="items"/>
+        <ft:repeater-widget id="items">
+          <div class="section"><ft:new id="item-row-class"/></div>
+        </ft:repeater-widget>
       </ft:class>
 
       <!--

Mime
View raw message