Add button to message users
authorAndy Allan <gravitystorm@gmail.com>
Fri, 25 Feb 2011 19:53:18 +0000 (19:53 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 9 Mar 2011 10:57:58 +0000 (10:57 +0000)
net/systemeD/potlatch2/history/HistoryDialog.mxml

index c7f11a4..3f0648d 100644 (file)
           <mx:DataGridColumn editable="false" dataField="version" headerText="version" width="45"/>
           <mx:DataGridColumn editable="false" dataField="timestamp" headerText="timestamp"/>
           <mx:DataGridColumn editable="false" dataField="uid" headerText="uid"/>
+          <mx:DataGridColumn editable="false" dataField="user" headerText="username" />
+          <mx:DataGridColumn editable="false">
+            <mx:itemRenderer>
+              <mx:Component>
+                <mx:VBox>
+                  <mx:Button label="Contact User"
+                    click="parentDocument.message(data)"/>
+                </mx:VBox>
+              </mx:Component>
+            </mx:itemRenderer>
+          </mx:DataGridColumn>
         </mx:columns>
       </mx:DataGrid>
     </mx:HBox>
@@ -26,7 +37,6 @@
 
   <mx:ControlBar>
     <mx:Button label="Revert" enabled="false" styleName="titleWindowButton" />
-    <mx:Button label="Mail" enabled="false" styleName="titleWindowButton" />
     <mx:Spacer width="100%"/>
     <mx:Button label="More Details..." enabled="{entity.id >= 0}" click="openEntityPage()" styleName="titleWindowButton" />
     <mx:Button label="Cancel" click="PopUpManager.removePopUp(this);" styleName="titleWindowButton" />
@@ -65,7 +75,7 @@
     private function openEntityPage():void {
         if (entity != null && entity.id >= 0) {
             // This is slightly hard-coded, but not drastically. The ../s could be changed for string manipulation of the apiBase
-            var urlBase:String = Connection.getConnectionInstance().apiBase + '../../browse/'
+            var urlBase:String = Connection.getConnectionInstance().apiBase + '../../browse/';
             navigateToURL(new URLRequest(urlBase+entity.getType()+'/'+entity.id), "potlatch_browse");
         }
     }
         // todo sorting or somesuch
         entityStates = results;
     }
+
+    public function message(entity:Entity):void {
+        if (entity.user != null) {
+            var urlBase:String = Connection.getConnectionInstance().apiBase + '../../message/new/';
+            navigateToURL(new URLRequest(urlBase+entity.user), "potlatch_message");
+        }
+    }
     ]]>
   </mx:Script>