Skip to content

Commit

Permalink
#27 action and design
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetal Patel committed Jan 30, 2018
1 parent 69a14dc commit d8a772c
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 148 deletions.
47 changes: 47 additions & 0 deletions src/emc-metalnx-shared/src/main/resources/static/js/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,53 @@ function unstarPath(path){
console.log("UnstarPath() ends");
}

function positionBrowserToPath(path) {
window.location.href = '/emc-metalnx-web/collections' + path; //relative to domain
}

function fileDownload(path){
console.log("File Download");

var prepareDownloadURL = "/emc-metalnx-web/fileOperation/prepareFilesForDownload/";
var paths = [];
paths.push(path);
ajaxEncapsulation(prepareDownloadURL, "GET", {paths: paths}, handleDownload, null);
//$("#actions button").prop("disabled", true);
}

function deleteInfoAction(path){
console.log("Ready for deletion");
$("#actionmenu button").prop("disabled", true);
$('#actionsWait').show();

var paths = [];
paths.push(path);
var url = "/emc-metalnx-web/fileOperation/delete/";

ajaxEncapsulation(
url,
"POST",
{paths: paths},
function (data) {
$("#tree-view-panel-body").html(data);

}
);
window.location.href = "/emc-metalnx-web/browse/home";
}

function editInfo(path){

}

function handleDownload() {
window.location.href = "/emc-metalnx-web/fileOperation/download/";
}

/*function handleDownloadFailure() {
console.log(handleDownloadFailure);
}
*/
/*
function ChangeUrl(title, urlVal) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<body>
<div aria-labelledby="collManagement" layout:fragment="content">
<h1 id="collManagement" class="page-header pull-left" th:text="#{collections.management.page.title}" th:data-content="#{collection.title.popover}"></h1>
<h4 id="collManagement" class="collection-header pull-left" th:text="#{collections.management.page.title}" th:data-content="#{collection.title.popover}"></h4>
<a aria-label="page help" id="collections-page-title" href="#" class="page-hint pull-left"><i class="fa fa-question-circle"></i></a>
<ol class="breadcrumb mlx" th:if="${cameFromMetadataSearch} == true"
id="backToMetadataSearch">
Expand Down Expand Up @@ -729,7 +729,9 @@ <h4 id="uploadModalLabel" class="modal-title" th:text="#{upload.label}"></h4>
if (cbChecked > 1) return;

var url = [[ ${ urlMap.URL_MODIFY_COLLECTION_USER } ]];
//alert(url);
var path = $('input[name="collectionPathCheckboxes"]:checked').val();
//alert(path);
ajaxEncapsulation(url, "GET", {path: path}, displayModifyForm, null, null, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,18 @@
~ limitations under the License.
-->
<div class="breadcrumb-wrapper">
<!-- History button -->
<div class="btn-group history" xmlns:th="http://www.w3.org/1999/xhtml">
<button id="historyBtn" type="button" class="btn btn-lg btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">

<li class="active"><a href="#" th:text="${collectionAndDataObject.path}"></a></li>
<li><a aria-label="user home directory" class="home" th:href="@{${urlMap.URL_HOME_COLLECTION_USER}}" th:text="'Home ('+${homeCollectionName}+')'"></a>
</li>
</ul>
</div>

<div id="editable-path">
<!-- Current Collections Table -->
<div id="current-path">
<ol class="breadcrumb">

<ol class="breadcrumb">
<a th:href="@{${urlMap.URL_HOME_COLLECTION_USER}}"><i class="fa fa-home"></i></a>
<th:block th:if="${breadcrumb.items.size()} le 3" th:each="breadcrumbItem, iterStat: ${breadcrumb.items}">
<th:block th:if="${iterStat.index lt (breadcrumb.items.size()-1)}">
<li class="hidden-xs hidden-sm">
<a href="#" aria-label="'path breadcrumb for:' + ${ breadcrumbItem.path }"
th:text="${breadcrumbItem.name}"
th:title="${breadcrumbItem.path}"
th:onclick="'javascript:positionBrowserToPath(\'' + ${ breadcrumbItem.path } + '\');'"
>
th:onclick="'javascript:positionBrowserToPath(\'' + ${ breadcrumbItem.path } + '\');'">
</a>
</li>
</li>
</th:block>
<th:block th:if="${iterStat.index eq (breadcrumb.items.size()-1)}">
<li class="collections-view">
Expand All @@ -58,18 +42,16 @@
<a href="#" aria-label="'path breadcrumb for:' + ${breadcrumb.items[breadcrumb.items.size()-3].name}"
th:text="${breadcrumb.items[breadcrumb.items.size()-3].name}"
th:title="${breadcrumb.items[breadcrumb.items.size()-3].path}"
th:onclick="'javascript:positionBrowserToPath(\'' + ${ breadcrumb.items[breadcrumb.items.size()-3].path } + '\');'"
>
th:onclick="'javascript:positionBrowserToPath(\'' + ${ breadcrumb.items[breadcrumb.items.size()-3].path } + '\');'">
</a>
</li>
</li>
<li class="hidden-xs hidden-sm">
<a href="#"
th:text="${breadcrumb.items[breadcrumb.items.size()-2].name}"
th:title="${breadcrumb.items[breadcrumb.items.size()-2].path}"
th:onclick="'javascript:positionBrowserToPath(\'' + ${ breadcrumb.items[breadcrumb.items.size()-2].path } + '\');'"
>
th:onclick="'javascript:positionBrowserToPath(\'' + ${ breadcrumb.items[breadcrumb.items.size()-2].path } + '\');'">
</a>
</li>
</li>
<li class="collections-view">
<span th:if="${collectionAndDataObject.path != '/'}"
th:text="${ collectionAndDataObject.name }"
Expand All @@ -78,7 +60,7 @@
</li>
</th:block>
</ol>
</div>

<div id="current-path-property" class="hidden">
<ol class="breadcrumb info">
<th:block th:if="${collectionAndDataObject.isCollection()}">
Expand All @@ -93,49 +75,6 @@
</th:block>
</ol>
</div>
<div class="hidden" id="navigationBar"><input type="text" id="navigationInput" th:value="${collectionAndDataObject.path}" placeholder="Enter a non-empty valid path" />
</div>
<button href="#" class="pull-right btn btn-sm btn-primary hidden" id="navigationBarGo"><i class="fa fa-check" aria-hidden="true"></i></button>
<button href="#" class="pull-right btn btn-sm btn-default hidden" id="navigationBarCancel"><i class="fa fa-remove" aria-hidden="true"></i></button>
</div>

<div class="btn-group pull-right" role="group" data-placement="top" id="breadcrumbOptions">
<a id="breadcrumbOptionsMenu" href="#" class="btn btn-properties btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="breadcrumb options">
<i class="fa fa-bars"></i>
</a>
<ul class="dropdown-menu">
<li>
<a href="#" th:onclick="'javascript:getSubDirectories(\'' + ${collectionAndDataObject.path} + '\');'">
<th:block th:if="${collectionAndDataObject.isCollection()}">
<span><i class="fa fa-folder"></i></span>
<span title="Browse collection">Browse</span>
</th:block>
<th:block th:unless="${collectionAndDataObject.isCollection()}">
<span><i class="fa fa-info-circle"></i></span>
<span title="File information">Info</span>
</th:block>
</a>
</li>
<li>
<a href="#" th:onclick="'javascript:getMetadata(\'' + ${collectionAndDataObject.path} + '\');'" aria-label="get metadata">
<span><i class="fa fa-tags"></i></span>
<span title="Metadata">Metadata</span>
</a>
</li>
<li>
<a href="#" id="permissions" th:onclick="'javascript:getPermDetails(\'' + ${collectionAndDataObject.path} + '\');'" aria-label="get permissions">
<span><i class="fa fa-lock"></i></span>
<span title="Permissions">Permissions</span>
</a>
</li>
</ul>
</div>

<!-- <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> -->

</div>
<script th:inline="javascript">
/*<![CDATA[*/
Expand Down Expand Up @@ -171,15 +110,15 @@
});
});

$(document).click(function(e){
/* $(document).click(function(e){
if(!$(e.target).is('.breadcrumb i.fa.fa-star')){
//$('#breadcrumbStar').popover("hide");
}else{
e.stopPropagation();
e.preventDefault();
}
});
$('.breadcrumb').click(function(e){
}); */
/* $('.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");
Expand All @@ -189,8 +128,8 @@
$('#navigationBarCancel').removeClass("hidden");
$('#navigationInput').focus().select();
}
});
$('#navigationInput').keyup(function(e){
}); */
/* $('#navigationInput').keyup(function(e){
if(e.keyCode == 13){
if($('#navigationInput').val().trim() == '') return;
getSubDirectories($('#navigationInput').val());
Expand All @@ -205,9 +144,9 @@
$('#breadcrumbOptionsMenu').removeClass("hidden").addClass("visible");
}
});
}); */

$('#navigationBarGo').click(function(e){
/* $('#navigationBarGo').click(function(e){
e.stopPropagation();
e.preventDefault();
if($('#navigationInput').val().trim() == '') return;
Expand All @@ -234,7 +173,7 @@
if (!$(e.target).is('a')) {
$("#current-path .breadcrumb").css("background-color", "#ffffff");
}
});
}); */

/*]]>*/
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,9 @@ <h4 id="ticketCreateFormTitle" class="modal-title" th:text="#{ticket.form.title.
var paths = [];
$("input:checkbox[name='collectionPathCheckboxes']:checked").each(function(){
paths.push($(this).val());
alert($(this).val())
});

ajaxEncapsulation(prepareDownloadURL, "GET", {paths: paths}, handleDownload, handleDownloadFailure);
$("#actions button").prop("disabled", true);
});
Expand All @@ -684,12 +685,14 @@ <h4 id="ticketCreateFormTitle" class="modal-title" th:text="#{ticket.form.title.

if (collPath != "") {
var oldCollName = collPath.substring(parentPath.length + 1, collPath.length);

}

if(collPath == "" || oldCollName != newCollOrDataObjectName) {
validateCollectionNameAjax([[${urlMap.URL_COLLECTION_VALIDATE_NAME}]] + newCollOrDataObjectName, submitForm);

}
else {
else {
submitForm();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
<span><i class="fa fa-lock"></i></span> <span title="Permissions">Permissions</span>
</a></li>

<li><a href="#replica"> <span><i
<!-- <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>
class="fa fa-eye"></i></span> <span title="preview">Preview</span>
</a></li>

</ul>
Expand All @@ -50,10 +50,10 @@

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

<div id="replica">
<!-- <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> -->
<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>
Expand Down
Loading

0 comments on commit d8a772c

Please sign in to comment.