Add nickname (with character restrictions) and comment fields when closing bug
[potlatch2.git] / net / systemeD / potlatch2 / panels / BugPanel.mxml
index a1762561ebf2b6b7ce1d7e30427e37cc215f029b..3ac5b0e60513b0dc7c8cd68eae9dfec0651c5ac5 100644 (file)
       <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
     </mx:columns>
   </mx:DataGrid>
       <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
     </mx:columns>
   </mx:DataGrid>
-  <mx:HBox id="bugControl" horizontalAlign="right" width="100%" visible="false">
-    <mx:LinkButton label="Add Comment" enabled="false" />
-    <mx:LinkButton label="Close Bug" click="closeBug()" />
-  </mx:HBox>
+  <mx:ViewStack id="bugControlStack" resizeToContent="true">
+    <mx:HBox id="bugControl" horizontalAlign="right" width="100%" visible="false">
+      <mx:LinkButton label="Add Comment" enabled="false" />
+      <mx:LinkButton label="Close Bug" click="bugControlStack.selectedChild=closeBugVBox;" />
+    </mx:HBox>
+
+    <mx:VBox id="closeBugVBox" visible="false">
+      <mx:Text><mx:text>Add your comment and close the bug</mx:text></mx:Text>
+      <mx:Label><mx:text>NickName</mx:text></mx:Label>
+      <mx:TextInput id="nickName" restrict="a-zA-Z0-9.\-_"/>
+      <mx:Text><mx:text>Comment form</mx:text></mx:Text>
+      <mx:TextArea id="closeComment" />
+      <mx:HBox horizontalAlign="right" width="100%">
+          <mx:LinkButton label="Cancel" click="bugControlStack.selectedChild=bugControl;" />
+          <mx:LinkButton label="Close Bug" click="closeBug()" />
+      </mx:HBox>
+    </mx:VBox>
+  </mx:ViewStack>
   <mx:Script><![CDATA[
 
       import net.systemeD.halcyon.connection.*;
   <mx:Script><![CDATA[
 
       import net.systemeD.halcyon.connection.*;
@@ -51,7 +65,7 @@
 
       private function closeBug():void {
             if (layer is BugLayer) {
 
       private function closeBug():void {
             if (layer is BugLayer) {
-              BugLayer(layer).closeBug(selectedEntity as Marker);
+              BugLayer(layer).closeBug(selectedEntity as Marker, nickName.text, closeComment.text);
             }
       }
       ]]>
             }
       }
       ]]>