Skip to content

Commit

Permalink
Merge branch 'niehs-development' into renci-2-0-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetal Patel committed Jan 29, 2018
2 parents f8f62a1 + 58af9f7 commit da24a71
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ public String getIconToDisplayFile(String mimeType) {
switch (mimeType) {

case "application/pdf":
icon = "fa fa-file-pdf-o";
icon = "fa fa-file-pdf-o fa-4x";
break;

case "image/jpg":
case "image/jpeg":
case "image/png":
case "image/gif":
icon = "fa fa-file-image-o";
icon = "fa fa-file-image-o fa-4x";
break;

default:
icon = "fa fa-file";
icon = "fa fa-file fa-4x";
break;
}

Expand All @@ -39,7 +39,7 @@ public String getIconToDisplayFile(String mimeType) {
@Override
public String getIconToDisplayCollection() {
// TODO Auto-generated method stub
return "fa fa-folder";
return "fa fa-folder fa-4x";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ private void setBreadcrumbToModel(final Model model, final DataGridCollectionAnd
model.addAttribute("collectionForwardHistory", collectionHistoryForward);
model.addAttribute("collectionAndDataObject", obj);
model.addAttribute("breadcrumb", new DataGridBreadcrumb(obj.getPath()));

System.out.println("Path :: " +obj.getPath());
model.addAttribute("homeCollectionName", irodsServices.getCurrentUser());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

Expand Down Expand Up @@ -33,6 +34,8 @@
import com.emc.metalnx.controller.utils.LoggedUserUtils;
import com.emc.metalnx.core.domain.exceptions.DataGridConnectionRefusedException;
import com.emc.metalnx.core.domain.exceptions.DataGridException;
import com.emc.metalnx.modelattribute.breadcrumb.DataGridBreadcrumb;
import com.emc.metalnx.modelattribute.breadcrumb.DataGridBreadcrumbItem;
import com.emc.metalnx.services.interfaces.CollectionService;
import com.emc.metalnx.services.interfaces.IRODSServices;
import com.emc.metalnx.services.interfaces.IconService;
Expand Down Expand Up @@ -85,6 +88,10 @@ public String getTestCollectionInfo(final Model model, HttpServletRequest reques

model.addAttribute("iconToDisplay", iconToDisplay);
model.addAttribute("dataProfile", dataProfile);
model.addAttribute("breadcrumb", new DataGridBreadcrumb(dataProfile.getAbsolutePath()));
DataGridBreadcrumb bc = new DataGridBreadcrumb(dataProfile.getAbsolutePath());

System.out.println("Absolute Path :: " +dataProfile.getAbsolutePath());
String template = "";

if(!dataProfile.isFile())
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 61 additions & 7 deletions src/emc-metalnx-shared/src/main/resources/static/js/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ function getInfoDetails(path){
}

function getMetadata(path){
//$("#metadata").hide();
//$("#table-loader").show();
$("#metadata").hide();
$("#table-loader").show();
console.log("Collection getMetadata() :: " +path);
window.location.hash = "metadata";
var url = "/emc-metalnx-web/metadata/getMetadata/";
ajaxEncapsulation(url , "POST", {path: path}, displayMetadata, null, null, null);
}

function getPermissionDetails(path){
//$("#permission").hide();
//$("#table-loader").show();
$("#permission").hide();
$("#table-loader").show();
console.log("Collection getPermDetails() :: " +path);
window.location.hash = "permission";
var url = "/emc-metalnx-web/permissions/getPermissionDetails/";
Expand All @@ -47,18 +47,32 @@ function displayInfoDetails(data){
}

function displayMetadata(data){
//$("#table-loader").hide();
console.log("display Metadata");
$('#table-loader').hide();
$('#table-loader').after(data);
/*$("#uploadIcon").prop("disabled", true);
$("#uploadIcon").addClass("disabled");
$("#showCollectionFormBtn").prop("disabled", true);
$("#showCollectionFormBtn").addClass("disabled");*/
$("#metadata").html(data);
//$("#metadata").show();
}

function displayPermissionDetails(data){
console.log("display Permission");
//$("#table-loader").hide();
$('#table-loader').hide();
$("#table-loader").after(data);
/*$("#uploadIcon").prop("disabled", true);
$("#uploadIcon").addClass("disabled");
$("#showCollectionFormBtn").prop("disabled", true);
$("#showCollectionFormBtn").addClass("disabled");*/
$('#permission').html(data);
//alert('showing content menu');
//$("#permission").show();
}

function getTestSubDirectories(){
alert("get directories");
}
function showPreview(){
alert("Show Preview");

Expand All @@ -79,6 +93,46 @@ function showPreview(){
}
});
}

function starPath(path){
console.log("StarPath() starts");
//$('#breadcrumbStar').attr('onclick', '');
var url = "/emc-metalnx-web/favorites/addFavoriteToUser/";
ajaxEncapsulation(url, "GET", {path: path},
function(data){
if(data.indexOf("OK") >= 0){
$('#breadcrumbStar i').removeClass('bm-unchecked').addClass('bm-checked');
$('#breadcrumbStar').attr('onclick', 'unstarPath("'+path+'")');
//$('#breadcrumbStar').tooltip('hide').attr('data-original-title',[[#{collections.favorite.unmark.button.tooltip}]]);
}else{
$('#breadcrumbStar').attr('data-content', 'Could not add path to favorites.')
$('#breadcrumbStar').popover("show");
$('#breadcrumbStar').attr('onclick', 'starPath("'+path+'")');
}

}, null, null, null);
console.log("StarPath() ends");
}

function unstarPath(path){
console.log("UnstarPath() starts !!");
//$('#breadcrumbStar').attr('onclick', '');
var url = "/emc-metalnx-web/favorites/removeFavoriteFromUser/";
ajaxEncapsulation(url, "GET", {path: path},
function(data){
if(data.indexOf("OK") >= 0){
$('#breadcrumbStar i').removeClass('bm-checked').addClass('bm-unchecked');
$('#breadcrumbStar').attr('onclick', 'starPath("'+path+'")');
//$('#breadcrumbStar').tooltip('hide').attr('data-original-title',[[#{collections.favorite.button.tooltip}]]);
}else{
$('#breadcrumbStar').attr('data-content', 'Could not remove path from favorites.')
$('#breadcrumbStar').popover("show");
$('#breadcrumbStar').attr('onclick', 'unstarPath("'+path+'")');
}
}, null, null, null);
console.log("UnstarPath() ends");
}

/*
function ChangeUrl(title, urlVal) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var dtPatternForMetadata = '<"row"<" pull-left col-sm-12 col-md-12">>'+
var dtPatternMlxCollections = '<"row"<"col-md-12 col-lg-12 col-xs-12"<"col-md-8 col-sm-8 col-xs-8"l<"toolbar">><"col-md-4 col-sm-4 col-xs-4"f>><"col-md-12 col-xs-12"<"msg">i>>'+
'<"row"<"col-md-12 col-lg-12 col-xs-12"tr>>'+
'<"row"<"col-md-12 col-lg-12 col-xs-12"p>>';
var dtPatternMlxStandard = '<"row"<"col-md-12 col-lg-12 col-xs-12"<"col-md-3 col-xs-4"l<"toolbar">><"col-md-6 col-xs-4"><"col-md-3 col-xs-4"f>><"col-md-12 col-xs-12"i>>'+
var dtPatternMlxStandard = '<"row"<"col-md-12 col-lg-12 col-xs-12"<"col-md-4 col-xs-4"l<"toolbar">><"col-md-5 col-xs-4"><"col-md-3 col-xs-4"f>><"col-md-12 col-xs-12"i>>'+
'<"row"<"col-md-12 col-lg-12 col-xs-12"tr>>'+
'<"row"<"col-md-12 col-lg-12 col-xs-12"p>>';
var dtPatternMlxTemplatesList = '<"row"<"col-md-12 col-lg-12 col-xs-12"<"col-md-6 col-xs-6"l<"toolbar">><"col-md-6 col-xs-6"f>><"col-md-12 col-xs-12"i>>'+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<th:block th:include="collections/summary :: summaryView"></th:block>
</div>

<div id="tabs">
<div class="row">
<div id="tabs">
<ul>
<li><a href="#info"
th:onclick="'javascript:getInfoDetails(\'' + ${dataProfile.absolutePath} + '\');'">
Expand All @@ -29,35 +30,24 @@
<span><i class="fa fa-lock"></i></span> <span title="Permissions">Permissions</span>
</a></li>

<li th:unless="${dataProfile.file}"><a href="#collection">
<span><i class="fa fa-lock"></i></span> <span title="Collection">collection</span>
</a></li>

</ul>



<div class="content_menu">

<div id="table-loader" class="table-loader hideElement">
<img class="center-block" th:src="@{/images/ajax_loader.gif}" />
<p class="text-center" th:text="#{loading.list.label}"></p>
</div>


<div id="info">
<th:block th:include="collections/info :: infoView"></th:block>
<!-- <th:block th:unless="${dataProfile.file}" th:include="collections/collectionInfo :: collectionInfoView"></th:block> -->
</div>
<div id="metadata"></div>

<div id="permission"></div>

<div id="collection">
<span>This is Collection tab.</span>
</div>


</div>
</div>
</div>



<!-- JQuery UI CSS -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ <h4 id="uploadModalLabel" class="modal-title" th:text="#{upload.label}"></h4>


function getSubDirectories(path) {
//alert("getSubDirectories")
alert("getSubDirectories")
console.log("Collection managemnet - getSubDirectories()");
$("#table-loader").show();
$("#tree-view-panel-body").hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@
</ul>
</div>

<a id="breadcrumbStar" class="btn-favorite" th:onclick="${starredPath}? 'javascript:unstarPath(\'' + ${collectionAndDataObject.path} + '\');' : 'javascript:starPath(\'' + ${collectionAndDataObject.path} + '\');'" href="#"
<!-- <a id="breadcrumbStar" class="btn-favorite" th:onclick="${starredPath}? 'javascript:unstarPath(\'' + ${collectionAndDataObject.path} + '\');' : 'javascript:starPath(\'' + ${collectionAndDataObject.path} + '\');'" href="#"
aria-label="starred object" data-toggle="popover" data-placement="left" data-trigger="manual" data-content="" th:title="${starredPath}?#{collections.favorite.unmark.button.tooltip}:#{collections.favorite.button.tooltip}" >
<i th:class="${starredPath}? 'fa fa-star bm-checked' : 'fa fa-star bm-unchecked'" aria-hidden="true"></i>
</a>
</a> -->
</div>
<script th:inline="javascript">
/*<![CDATA[*/
$(document).ready(function(){
// Add tooltip on Favorite button
$('#breadcrumbStar').tooltip({
/* $('#breadcrumbStar').tooltip({
trigger: 'hover',
placement:'top',
});
}); */
$('#breadcrumbHome').tooltip();
// Add tooltip on Options menu
$('#breadcrumbOptionsMenu').tooltip({
Expand Down Expand Up @@ -183,7 +183,7 @@

$(document).click(function(e){
if(!$(e.target).is('.breadcrumb i.fa.fa-star')){
$('#breadcrumbStar').popover("hide");
//$('#breadcrumbStar').popover("hide");
}else{
e.stopPropagation();
e.preventDefault();
Expand All @@ -192,7 +192,7 @@
$('.breadcrumb').click(function(e){
if(!$(e.target).is('ol.breadcrumb li a') && !$(e.target).is('i.fa.fa-star') && !$(e.target).is('i.fa.fa-home') && !$(e.target).parents('#breadcrumbOptions').length){
$('#current-path').addClass("hidden");
$('#breadcrumbStar').addClass("hidden");
//$('#breadcrumbStar').addClass("hidden");
$('#breadcrumbOptionsMenu').addClass("hidden");
$('#navigationBar').removeClass("hidden");
$('#navigationBarGo').removeClass("hidden");
Expand All @@ -211,7 +211,7 @@
$('#navigationBar').addClass("hidden");
$('#navigationBarCancel').addClass("hidden");
$('#navigationBarGo').addClass("hidden");
$('#breadcrumbStar').removeClass("hidden").addClass("visible");
//$('#breadcrumbStar').removeClass("hidden").addClass("visible");
$('#breadcrumbOptionsMenu').removeClass("hidden").addClass("visible");

}
Expand All @@ -232,7 +232,7 @@
$('#navigationBarGo').addClass("hidden");
$('#navigationBarCancel').addClass("hidden");
$(".current-path .breadcrumb").css("background-color", "#ffffff");
$('#breadcrumbStar').removeClass("hidden").addClass("visible");
//$('#breadcrumbStar').removeClass("hidden").addClass("visible");
$('#breadcrumbOptionsMenu').removeClass("hidden").addClass("visible");
});
$("#editable-path").mouseover(function(e) {
Expand All @@ -245,43 +245,6 @@
$("#current-path .breadcrumb").css("background-color", "#ffffff");
}
});
function starPath(path){
$('#breadcrumbStar').attr('onclick', '');
ajaxEncapsulation(
'/emc-metalnx-web/favorites/addFavoriteToUser/',
"GET",
{path: path},
function(data){
if(data.indexOf("OK") >= 0){
$('#breadcrumbStar i').removeClass('bm-unchecked').addClass('bm-checked');
$('#breadcrumbStar').attr('onclick', 'unstarPath("'+path+'")');
$('#breadcrumbStar').tooltip('hide').attr('data-original-title',[[#{collections.favorite.unmark.button.tooltip}]]);
}else{
$('#breadcrumbStar').attr('data-content', 'Could not add path to favorites.')
$('#breadcrumbStar').popover("show");
$('#breadcrumbStar').attr('onclick', 'starPath("'+path+'")');
}
}, null, null, null
);
}
function unstarPath(path){
$('#breadcrumbStar').attr('onclick', '');
ajaxEncapsulation(
'/emc-metalnx-web/favorites/removeFavoriteFromUser/',
"GET",
{path: path},
function(data){
if(data.indexOf("OK") >= 0){
$('#breadcrumbStar i').removeClass('bm-checked').addClass('bm-unchecked');
$('#breadcrumbStar').attr('onclick', 'starPath("'+path+'")');
$('#breadcrumbStar').tooltip('hide').attr('data-original-title',[[#{collections.favorite.button.tooltip}]]);
}else{
$('#breadcrumbStar').attr('data-content', 'Could not remove path from favorites.')
$('#breadcrumbStar').popover("show");
$('#breadcrumbStar').attr('onclick', 'unstarPath("'+path+'")');
}
}, null, null, null
);
}

/*]]>*/
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
<span><i class="fa fa-lock"></i></span> <span title="Permissions">Permissions</span>
</a></li>

<li th:if="${dataProfile.file}"><a href="#file"> <span><i
class="fa fa-lock"></i></span> <span title="File">File</span>
<li><a href="#replica"> <span><i
class="fa fa-lock"></i></span> <span title="replica">Replica</span>
</a></li>

<li><a href="#preview"> <span><i
class="fa fa-lock"></i></span> <span title="preview">Preview</span>
</a></li>

</ul>

<div class="content_menu">

<div id="table-loader" class="table-loader hideElement">
<img class="center-block" th:src="@{/images/ajax_loader.gif}" />
<p class="text-center" th:text="#{loading.list.label}"></p>
</div>

<div id="info">
<th:block th:include="collections/info :: infoView"></th:block>
<!-- <th:block th:unless="${dataProfile.file}" th:include="collections/collectionInfo :: collectionInfoView"></th:block> -->
Expand All @@ -50,10 +50,14 @@

<div id="permission"></div>

<div id="file">
<span>This is File tab.</span>
<div id="replica">
<img class="center-block" th:src="@{/images/comingsoon.png}" />
<span><p>This feature is under construction. Please come back soon!</p></span>
</div>
<div id="preview">
<img class="center-block" th:src="@{/images/comingsoon.png}" />
<span><p>This feature is under construction. Please come back soon!</p></span>
</div>


</div>
</div>
Expand Down
Loading

0 comments on commit da24a71

Please sign in to comment.