Skip to content
This repository has been archived by the owner on Feb 23, 2018. It is now read-only.

Commit

Permalink
#27 collection info view
Browse files Browse the repository at this point in the history
  • Loading branch information
Hetal Patel committed Jan 26, 2018
1 parent 78b9c42 commit 55379f0
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 84 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";
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 21 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 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 @@ -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
169 changes: 128 additions & 41 deletions src/emc-metalnx-shared/src/main/resources/views/collections/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,136 @@

<th:block th:fragment="summaryView">

<div class="col-xs-12 col-md-12 col-lg-12" id="summary">
<div class="panel panel-default">
<div class="panel-body">
<div class="panel-info">
<div class="row">
<div class="col-md-9 col-sm-8 col-xs-8">
<a href="#" onclick="showPreview();"><i th:class="${ iconToDisplay }"></i></a>
<span th:text="${ dataProfile.getChildName() }"></span> <a
id="breadcrumbStar" class="btn-favorite" href="#"
data-toggle="popover" data-placement="left"
data-trigger="manual" data-content=""
th:title="${dataProfile.starred}?#{collections.favorite.unmark.button.tooltip}:#{collections.favorite.button.tooltip}">
<i
th:class="${dataProfile.starred}? 'fa fa-star bm-checked' : 'fa fa-star bm-unchecked'"
aria-hidden="true"></i>
</a>
</div>
</div>
<div class="row">
<span><b th:text="${ dataProfile.getParentPath() }"></b></span>
<!-- <span class="resulting-permission" th:text="${ '[' + collectionAndDataObject.getMostPermissiveAccessForCurrentUser() + ' access]'}"></span> -->
</div>
<div class="row">
<div class="text-right col-md-1 col-sm-4 col-xs-4">
<label>Shared</label>
</div>
<div class="col-md-9 col-sm-8 col-xs-8">
<span th:text="${dataProfile.shared}?'This is Shared':'This is not shared'"></span>
</div>
</div>
<div class="row">
<div class="text-right col-md-1 col-sm-4 col-xs-4">
<label>Has Tickets</label>
</div>
<div class="col-md-9 col-sm-8 col-xs-8">
<span th:text="${ dataProfile.hasTicket}?'This has Tickets':'This has no Tickets'"></span>
</div>
</div>

</div>
<div id="summary">
<div class="col-md-12 col-sm-6 col-xs-12 pull-left">
<h4 id="collManagement" class="collection-header pull-left"
th:data-content="#{collection.title.popover}">Collections</h4>
<a aria-label="page help" id="collections-page-title" href="#"
class="page-hint pull-left" data-original-title="" title=""> <i
class="fa fa-question-circle" />
</a>
</div>

<div class="col-md-12 col-sm-6 col-xs-12 pull-left">
<span><h1 th:text="${ dataProfile.getChildName() }" ></h1></span>
</div>

<div class="col-md-9 col-sm-9 col-xs-12 pull-left">
<a href="#"><i class="fa fa-home"></i></a>


<th:block th:each="pathItem, iterStat: ${dataProfile.pathComponents}">
<th:block
th:if="${iterStat.index lt (dataProfile.pathComponents.size()-1)}">
<a href="#" th:text="${ pathItem }" th:title="${ pathItem }"
th:onclick="'javascript:getSubDirectories(/zone1/home);'"><i
class="color-blue"></i> </a>
<span class="fa fa-angle-double-right "></span>
</th:block>

<th:block
th:if="${iterStat.index eq (dataProfile.pathComponents.size()-1)}">
<span th:text="${ pathItem }" th:title="${ pathItem }"> </span>

</th:block>

</th:block>

</div>


<div class="col-sm-12 collection-margin" />

<div class="col-xs-12 col-md-10 col-sm-9 ">
<div>
<span><b>Summary</b></span>
</div>
<div>
<span>The root interface in the collection hierarchy. A
collection represents a group of objects, known as its elements.
Some collections allow duplicate elements and others do not. Some
are ordered and others unordered. The JDK does not provide any
direct implementations of this interface:</span>
</div>
<!-- <span class="resulting-permission" th:text="${ '[' + collectionAndDataObject.getMostPermissiveAccessForCurrentUser() + ' access]'}"></span> -->

</div>
</div>
<div class="col-xs-12 col-md-2 col-sm-3 pull-right">
<a href="#" class="pull-right"><i th:class="${ iconToDisplay }"></i></a>
</div>


<div class="col-sm-12 collection-margin" />

<div class="col-xs-12 col-md-3 col-sm-3">
<span><b>Collection Name</b></span> <br /> <span
th:text="${ dataProfile.getChildName() }"></span>
</div>
<div class="col-xs-12 col-md-3 col-sm-3">
<span><b>Root</b></span> <br /> <span
th:text="${ dataProfile.getParentPath() }"></span>
<!-- <span class="resulting-permission" th:text="${ '[' + collectionAndDataObject.getMostPermissiveAccessForCurrentUser() + ' access]'}"></span> -->
</div>


<div class="col-sm-12 collection-margin" />




<div class="col-sm-3 col-md-3 col-xs-12 pull-right">
<div id="actionmenu" class="pull-right">

<button type="button" class="btn btn-default dropdown-toggle"
data-toggle="dropdown" aria-expanded="false">
<span>Action</span>
<span class="caret" /> <span class="sr-only">Toggle Dropdown</span>
<span> | </span>
</button>
<ul class="dropdown-menu">
<li><a href="#"> <span>add</span>
</a></li>
<li><a href="#"> <span>delete</span>
</a></li>
</ul>

<button type="button" class="btn btn-default dropdown-toggle"
data-toggle="dropdown" aria-expanded="false">
<span class="fa fa-ticket" />
<span class="caret" /> <span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li><a href="#"> <span>option1</span>
</a></li>
<li><a href="#"> <span>option2</span>
</a></li>
</ul>

<a id="breadcrumbStar" class="btn btn-default" href="#"
data-toggle="popover" data-trigger="manual" data-content=""
th:title="${dataProfile.starred}?#{collections.favorite.unmark.button.tooltip}:#{collections.favorite.button.tooltip}">
<i
th:class="${dataProfile.starred}? 'fa fa-star bm-checked' : 'fa fa-star bm-unchecked'"
aria-hidden="true"></i>
</a> <a id="breadcrumbShared" role="button" class="btn btn-default"
href="#" data-toggle="popover" data-trigger="manual"
data-content=""> <i
th:class="${dataProfile.shared}? 'fa fa-share-alt bm-checked' : 'fa fa-share-alt bm-unchecked'"
aria-hidden="true"></i>
</a>
</div>
</div>




<div class="col-sm-12" />
<div class="col-sm-12" />
<div class="col-sm-12" />
<div class="col-sm-12" />
<div class="col-sm-12" />
<div class="col-sm-12" />

</div>
</th:block>

Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ <h4 class="property-title "><i class="fa fa-tags"></i><span th:text="#{metadata.
</th:block>
</th:block>

<script type="text/javascript" th:src="@{/js/collection.js}"></script>
<script th:inline="javascript">
/*<![CDATA[*/
function deleteMetadataList(){
Expand Down Expand Up @@ -239,7 +240,7 @@ <h4 class="property-title "><i class="fa fa-tags"></i><span th:text="#{metadata.
}

function addMetadataModal(path){
alert("adding metadata model");
console.log("adding metadata model");
$('#newAttrModal').parent().removeClass('has-feedback has-error');
$('#newValModal').parent().removeClass('has-feedback has-error');
$('.emptyAttrMetadata').addClass('hideElement');
Expand All @@ -256,6 +257,7 @@ <h4 class="property-title "><i class="fa fa-tags"></i><span th:text="#{metadata.
}

function saveNewMetadata(){
console.log("saving new metadata");
var path = $('#pathModal').val();
var attr = $('#newAttrModal').val();
var val = $('#newValModal').val();
Expand Down
Loading

0 comments on commit 55379f0

Please sign in to comment.