Remove the tag grid, and start laying out the details properly
authorAndy Allan <gravitystorm@gmail.com>
Wed, 24 Nov 2010 14:06:52 +0000 (14:06 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Wed, 24 Nov 2010 14:06:52 +0000 (14:06 +0000)
net/systemeD/potlatch2/panels/BugPanel.mxml

index 3ac5b0e..771944b 100644 (file)
@@ -5,14 +5,20 @@
 -->
 
 <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" height="100%">
-  <mx:Text id="markerPanelText" text="You have selected a BUG!!1!." width="100%" styleName="helpInfo" />
-  <mx:DataGrid editable="false" id="markerPanelDG" width="100%" height="50%">
-    <mx:columns>
-      <mx:DataGridColumn editable="false" dataField="key" headerText="key" />
-      <mx:DataGridColumn editable="false" dataField="value" headerText="value" />
-    </mx:columns>
-  </mx:DataGrid>
+  <mx:HBox>
+    <mx:Image source="{bugImage}"/>
+    <mx:Text text="{bugTitle}"/>
+  </mx:HBox>
+  <mx:Text text="Description:" />
+  <mx:TextArea editable="false" text="{bugDescription}" width="100%" />
+  <mx:HBox>
+    <mx:Text text="Type of bug: " />
+    <mx:Text text="{bugType}" fontWeight="bold"/>
+  </mx:HBox>
   <mx:ViewStack id="bugControlStack" resizeToContent="true">
+    <mx:HBox id="bugClosed">
+      <mx:Text text="This bug has been marked as (fixed/Invalid)" />
+    </mx:HBox>
     <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;" />
       import mx.collections.*;
 
       private var selectedEntity:Entity;
-      private var tagDataProvider:ArrayCollection;
       private var layer:VectorLayer;
 
+      [Bindable] private var bugId:String;
+      [Bindable] private var bugStatus:String;
+      [Bindable] private var bugDescription:String;
+      [Bindable] private var bugType:String;
+      [Bindable] private var bugImage:String;
+      [Bindable] private var bugTitle:String;
+
       public function init(entity:Entity, layer:VectorLayer):void {
             this.layer = layer;
-            if ( tagDataProvider == null ) {
-                tagDataProvider = new ArrayCollection();
-                markerPanelDG.dataProvider = tagDataProvider;
-            }
-
             selectedEntity=entity;
-            updateTagDataProvider();
+
+            bugId = selectedEntity.getTag("bug_id");
+            bugTitle = "Bug "+bugId;
+            bugStatus = selectedEntity.getTag("status");
+            bugDescription = selectedEntity.getTag("description");
+            bugType = selectedEntity.getTag("type").replace(/_/g, " ");
+            bugImage = 'features/bugs/'+bugStatus+'.png';
+
             if (layer is BugLayer) {
               bugControl.visible = true;
             }
       }
 
-      private function updateTagDataProvider():void {
-            tagDataProvider.removeAll();
-            if (selectedEntity==null) { return; }
-            var tags:Array = selectedEntity.getTagArray();
-            tags.sortOn("key");
-            for each(var tag:Tag in tags) { tagDataProvider.addItem(tag); }
-      }
-
       private function closeBug():void {
             if (layer is BugLayer) {
               BugLayer(layer).closeBug(selectedEntity as Marker, nickName.text, closeComment.text);
             }
+            bugStatus = selectedEntity.getTag("status");
       }
+
       ]]>
   </mx:Script>
 </mx:VBox>
\ No newline at end of file