summaryrefslogtreecommitdiffstats
path: root/idrop-web
diff options
context:
space:
mode:
authorMike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-05-06 10:42:31 (GMT)
committer Mike Conway <mikeconway@Mike-Conways-MacBook-Pro.local>2011-05-06 10:42:31 (GMT)
commitd8576489f2fe6bdada9efa143a6ce9bdffab88a5 (patch)
treec74010c1ad85365ed492646c8d6e4a5f63487426 /idrop-web
parent5471b16aa79f00b8c2d5c5d330af0802e3b40d51 (diff)
downloadQCG-Data-d8576489f2fe6bdada9efa143a6ce9bdffab88a5.zip
QCG-Data-d8576489f2fe6bdada9efa143a6ce9bdffab88a5.tar.gz
QCG-Data-d8576489f2fe6bdada9efa143a6ce9bdffab88a5.tar.bz2
work in progress ACL edit and layout
Diffstat (limited to 'idrop-web')
-rw-r--r--idrop-web/grails-app/views/common/_topbar.gsp12
-rw-r--r--idrop-web/grails-app/views/home/index.gsp10
-rw-r--r--idrop-web/grails-app/views/layouts/main.gsp6
-rw-r--r--idrop-web/grails-app/views/sharing/aclDetails.gsp4
-rw-r--r--idrop-web/web-app/css/main.css44
-rw-r--r--idrop-web/web-app/js/mydrop/home.js114
6 files changed, 123 insertions, 67 deletions
diff --git a/idrop-web/grails-app/views/common/_topbar.gsp b/idrop-web/grails-app/views/common/_topbar.gsp
index a7d9d7a..ffaba4b 100644
--- a/idrop-web/grails-app/views/common/_topbar.gsp
+++ b/idrop-web/grails-app/views/common/_topbar.gsp
@@ -28,7 +28,8 @@
</div>
</g:ifAuthenticated>
-<script type="text/javascript">var menuShown = true;
+<script type="text/javascript">
+var menuShown = true;
function showMenu() {
if (menuShown) {
@@ -37,14 +38,21 @@ function showMenu() {
menuShown = false;
$("#mainDiv").width="100%";
$("#mainDivCol1").width="100%";
- $("#mainDivCol1").removeClass()
+ $("#mainDivCol1").removeClass();
+ dataLayout.resizeAll();
+ //$("#dataTreeView").layout.resizeContent("center");
+ //$("#infoDiv").width="100%";
} else {
$("#secondaryDiv").show('slow');
$("#mainDiv").width="80%";
$("#mainDivCol1").width="80%";
$("#secondaryDiv").width="20%";
$("#mainDivCol1").addClass("yui-u first");
+ dataLayout.resizeAll();
+ //$("#dataTreeView").layout.resizeContent("center");
+
+ //$("#infoDiv").width="100%";
menuShown = true;
}
}
diff --git a/idrop-web/grails-app/views/home/index.gsp b/idrop-web/grails-app/views/home/index.gsp
index bef9191..8ea2797 100644
--- a/idrop-web/grails-app/views/home/index.gsp
+++ b/idrop-web/grails-app/views/home/index.gsp
@@ -71,9 +71,9 @@
<div id="browse">
<div id="browser" class="wrapper" style="width: 100%">
- <div id="browseToolbar" class="xui-layout-north"
- style="height: 30px; position: relative; display: block;">
- <div id="headerSearchBox" class="ui-widget-header fg-toolbar">
+ <div id="browseToolbar" class=""
+ style="height: 30px; position: relative; display: block; width: auto;">
+ <div id="browseToolbarSubBox" class="ui-widget-header fg-toolbar">
<div id="browseMenu" class="fg-buttonset fg-buttonset-multi"
style="float: left">
@@ -119,9 +119,9 @@ $(document).ready(function() {
dataLayout = $("#dataTreeView").layout({
applyDefaultStyles: true,
+ size: "auto",
west__minSize: 100,
- west__resizable: true,
-
+ west__resizable: true
});
tabs = $( "#tabs" ).tabs();
diff --git a/idrop-web/grails-app/views/layouts/main.gsp b/idrop-web/grails-app/views/layouts/main.gsp
index c7cbed2..a45c4ca 100644
--- a/idrop-web/grails-app/views/layouts/main.gsp
+++ b/idrop-web/grails-app/views/layouts/main.gsp
@@ -41,10 +41,6 @@
<div class="yui-b">
<div id="mainDiv" class="yui-ge">
<div id="mainDivCol1" class="yui-u first"><!-- PUT MAIN COLUMN 1 CODE HERE -->
-<div id="spinner" class="spinner" style="display: none;"><img
- src="${resource(dir:'images',file:'spinner.gif')}"
- alt="${message(code:'spinner.alt',default:'Loading...')}" />
-</div>
<g:layoutBody />
</div>
<div id="secondaryDiv" class="yui-u"><!-- PUT MAIN COLUMN 2 CODE HERE -->
@@ -56,7 +52,7 @@
</div>
</div>
</div>
-<div class="yui-b"><!-- PUT SECONDARY COLUMN CODE HERE --></div>
+
</div>
<div id="ft"><!-- PUT FOOTER CODE HERE -->
<g:render template="/common/footer" />
diff --git a/idrop-web/grails-app/views/sharing/aclDetails.gsp b/idrop-web/grails-app/views/sharing/aclDetails.gsp
index 83e6c1a..653b69b 100644
--- a/idrop-web/grails-app/views/sharing/aclDetails.gsp
+++ b/idrop-web/grails-app/views/sharing/aclDetails.gsp
@@ -59,18 +59,16 @@
</div>
<script type="text/javascript">
-
var messageAreaSelector="#aclMessageArea";
$(function() {
+ lcPrepareForCall();
dataTable = lcBuildTableInPlace("#aclDetailsTable", null, null);
$('.forSharePermission', dataTable.fnGetNodes()).editable(function(value, settings) {
var userName = this.parentNode.getAttribute('id');
return aclUpdate(value,settings, userName);}, {
"callback": function( sValue, y ) {
- setMessageInArea(messageAreaSelector, "File sharing update successful");
-
var aPos = dataTable.fnGetPosition( this );
dataTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
diff --git a/idrop-web/web-app/css/main.css b/idrop-web/web-app/css/main.css
index 68c0037..506de33 100644
--- a/idrop-web/web-app/css/main.css
+++ b/idrop-web/web-app/css/main.css
@@ -64,19 +64,27 @@ div.scroll {
}
div#tabs {
- overflow: auto;
- width: 100%;
+ /*width: 100%;
+ height: 100%;
display: inline-block;
+ clear: both;*/
+ clear: both;
+ overflow; auto;
+ display: block;
+ position: relative;
}
+/*
.wrapper {
text-align: left;
margin: 0px auto;
padding: 0px;
border: 0;
display: inline-block;
- overflow: auto;
-}
+ position: relative;
+ width: auto;
+ height: auto;
+}*/
.colRight {
position: relative;
@@ -136,6 +144,13 @@ div#tabs {
float: left;
}
+#mainDivColl {
+ clear:both;
+ width: auto;
+ height: auto;
+ position: relative;
+}
+
/* NAVIGATION MENU */
.nav {
background: #aabbc2 bottom repeat-x;
@@ -615,17 +630,15 @@ th.desc a {
}
/* browser */
+/*
#browse {
background: #ffffff;
padding: 0;
-}
-
-#browse {
height: 95%;
width: 100%;
margin: 0;
padding: 0;
-}
+} */
#secondaryDiv {
height: 400px;
@@ -649,17 +662,22 @@ th.desc a {
overflow: auto;
}
+
#dataTreeView {
- height: 100%;
+ height: 90%;
width: 100%;
- background: #ffffff;
- overflow: auto;
+ clear: both;
+ /*background: #ffffff;
+ overflow: auto;*/
}
+
+
#infoDiv {
float: right;
- height: 100%;
- background: #f4f4f4;
+ width: auto;
+ /*height: 100%;*/
+ /*background: #f4f4f4;*/
}
#detailsToolbar {
diff --git a/idrop-web/web-app/js/mydrop/home.js b/idrop-web/web-app/js/mydrop/home.js
index afbc66b..a2f23a8 100644
--- a/idrop-web/web-app/js/mydrop/home.js
+++ b/idrop-web/web-app/js/mydrop/home.js
@@ -13,7 +13,6 @@ var selectedPath = null;
var fileUploadUI = null;
var aclDialogMessageSelector = "#aclDialogMessageArea";
-
/**
* presets for url's
*/
@@ -123,7 +122,7 @@ function nodeLoadedCallback() {
*/
function nodeSelected(event, data) {
// given the path, put in the node data
-
+ lcPrepareForCall();
var id = data[0].id;
selectedPath = id;
updateBrowseDetailsForPathBasedOnCurrentModel(id);
@@ -136,6 +135,7 @@ function nodeSelected(event, data) {
* the right hand pane
*/
function setBrowseMode() {
+ lcPrepareForCall();
browseOptionVal = $("#browseDisplayOption").val();
updateBrowseDetailsForPathBasedOnCurrentModel(selectedPath);
}
@@ -147,6 +147,8 @@ function setBrowseMode() {
*/
function updateBrowseDetailsForPathBasedOnCurrentModel(absPath) {
+ lcPrepareForCall();
+
if (absPath == null) {
return;
}
@@ -168,9 +170,8 @@ function updateBrowseDetailsForPathBasedOnCurrentModel(absPath) {
"/metadata/listMetadata?absPath=" + absPath, "#infoDiv",
"#infoDiv", null);
} else if (browseOptionVal == "sharing") {
- lcSendValueAndCallbackHtmlAfterErrorCheck(
- "/sharing/listAcl?absPath=" + absPath, "#infoDiv",
- "#infoDiv", null);
+ lcSendValueAndCallbackHtmlAfterErrorCheck("/sharing/listAcl?absPath="
+ + absPath, "#infoDiv", "#infoDiv", null);
}
}
@@ -203,6 +204,8 @@ function showUploadDialog() {
*/
function fillInUploadDialog(data) {
+ lcPrepareForCall();
+
if (data == null) {
return;
}
@@ -223,6 +226,8 @@ function fillInUploadDialog(data) {
}
function initializeUploadDialogAjaxLoader() {
+ lcPrepareForCall();
+
if (fileUploadUI != null) {
$("#fileUploadForm").remove;
}
@@ -248,7 +253,8 @@ function initializeUploadDialogAjaxLoader() {
return $('<tr><td>' + file.name + '<\/td><\/tr>');
},
onError : function(event, files, index, xhr, handler) {
- $("#upload_message_area").html("an error occurred:" + xhr);
+ $("#upload_message_area").html(
+ "an error occurred:" + xhr);
$("#upload_message_area").addClass("message");
}
});
@@ -260,30 +266,36 @@ function initializeUploadDialogAjaxLoader() {
*/
function aclUpdate(value, settings, userName) {
// lcShowBusyIconInDiv("#aclMessageArea");
-
+
// var aPos = dataTable.fnGetPosition( this );
// alert("apos =" + aPos);
+ lcPrepareForCall();
+
if (selectedPath == null) {
throw "no collection or data object selected";
}
lcShowBusyIconInDiv(messageAreaSelector);
-
+
var params = {
absPath : selectedPath,
acl : value,
- userName: userName
+ userName : userName
}
- var jqxhr = $.post(context + aclUpdateUrl, params, function(data, status, xhr) {
- lcClearDivAndDivClass(messageAreaSelector);
-
- }, "html").error(function() {
+ var jqxhr = $.post(context + aclUpdateUrl, params,
+ function(data, status, xhr) {
+ lcClearDivAndDivClass(messageAreaSelector);
+ }, "html").error(function() {
setMessageInArea(messageAreaSelector, "Error sharing file");
- });
+ }).complete(
+ function() {
+ setMessageInArea(messageAreaSelector,
+ "File sharing update successful");
+ });
return value;
-
+
}
/**
@@ -314,46 +326,70 @@ function prepareAclDialog() {
* @param data
*/
function showAclDialog(data) {
+ lcPrepareForCall();
+
$("#aclDialogArea").html(data);
- $("#aclDialogArea").dialog({
- "width" : 400,
- "modal" : true,
- "buttons" : { "Ok": function() { submitAclDialog(); }, "Cancel": function() { $(this).dialog("close"); } },
- "title" : "Edit Share Permission"
- });
-
+ $("#aclDialogArea").dialog({
+ "width" : 400,
+ "modal" : true,
+ "buttons" : {
+ "Ok" : function() {
+ submitAclDialog();
+ },
+ "Cancel" : function() {
+ $(this).dialog("close");
+ }
+ },
+ "title" : "Edit Share Permission"
+ });
+
}
function submitAclDialog() {
-
- var userName = $('[name=userName]').val();
+
+ lcPrepareForCall();
+
+ var userName = $('[name=userName]').val();
if (userName == null || userName == "") {
- setMessageInArea(aclDialogMessageSelector, "Please select a user to share data with");
+ setMessageInArea(aclDialogMessageSelector,
+ "Please select a user to share data with");
return false;
}
- var permissionVal = $('[name=acl]').val();
- if (permissionVal == null || permissionVal == "" || permissionVal== "NONE") {
- setMessageInArea(aclDialogMessageSelector, "Please select a permission value in the drop-down");
+ var permissionVal = $('[name=acl]').val();
+ if (permissionVal == null || permissionVal == "" || permissionVal == "NONE") {
+ setMessageInArea(aclDialogMessageSelector,
+ "Please select a permission value in the drop-down");
return false;
}
-
+
if (selectedPath == null) {
throw "no collection or data object selected";
}
-
+
lcShowBusyIconInDiv(aclDialogMessageSelector);
-
+
var params = {
absPath : selectedPath,
acl : permissionVal,
- userName: userName
+ userName : userName
}
- var jqxhr = $.post(context + aclUpdateUrl, params, function(data, status, xhr) {
- lcClearDivAndDivClass(aclDialogMessageSelector);
-
- }, "html").error(function() {
- setMessageInArea(aclDialogMessageSelector, "Error saving sharing permissions");
- }).success(function() {$("#aclDialogArea").dialog("close"); setMessage("Sharing permission saved successfully") });
-
+ var jqxhr = $.post(context + aclUpdateUrl, params,
+ function(data, status, xhr) {
+ lcClearDivAndDivClass(aclDialogMessageSelector);
+
+ }, "html").error(
+ function() {
+ setMessageInArea(aclDialogMessageSelector,
+ "Error saving sharing permissions");
+ }).success(function() {
+ $("#aclDialogArea").dialog("close");
+
+ // FIXME: add new row in table
+
+ // updateBrowseDetailsForPathBasedOnCurrentModel(selectedPath);
+ setMessage("Sharing permission saved successfully")
+
+ });
+
}