Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Add "when" parameter in a few GET API endpoints to enable pagination [#266](https://github.com/clowder-framework/clowder/issues/266)
- Extractors can now specify an extractor_key and an owner (email address) when sending a
registration or heartbeat to Clowder that will restrict use of that extractor to them.
- Added a dropdown menu to select all spaces, your spaces and also the spaces you have access to. [#374](https://github.com/clowder-framework/clowder/issues/374)

## Fixed
- Updated lastModifiesDate when updating file or metadata to a dataset, added lastModified to UI [386](https://github.com/clowder-framework/clowder/issues/386)
Expand Down
8 changes: 6 additions & 2 deletions app/views/main.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<li><a href="@routes.Datasets.list(showPublic=false)"><span class="glyphicon glyphicon-briefcase"></span> @Messages("datasets.title")</a></li>
<li><a href="@routes.Collections.list(showPublic=false)"><span class="glyphicon glyphicon-th-large"></span> @Messages("collections.title")</a></li>
} else {
<li><a href="@routes.Spaces.list(owner=Some(user.get.id.stringify))"><span class="glyphicon glyphicon-hdd"></span> @Messages("spaces.title")</a></li>
<li onclick="setMySpaceTypeSessionStorage()"><a href="@routes.Spaces.list(owner=Some(user.get.id.stringify))"><span class="glyphicon glyphicon-hdd"></span> @Messages("spaces.title")</a></li>
<li><a href="@routes.Datasets.list(owner=Some(user.get.id.stringify))"><span class="glyphicon glyphicon-briefcase"></span> @Messages("datasets.title")</a></li>
<li><a href="@routes.Collections.list(owner=Some(user.get.id.stringify))"><span class="glyphicon glyphicon-th-large"></span> @Messages("collections.title")</a></li>
}
Expand All @@ -96,7 +96,7 @@
Explore <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="@routes.Spaces.list()"><span class="glyphicon glyphicon-hdd"> </span> @Messages("spaces.title")</a></li>
<li><a href="@routes.Spaces.list(showAll=false)"><span class="glyphicon glyphicon-hdd"> </span> @Messages("spaces.title")</a></li>
@user match {
case Some(x) => {
@if(play.Play.application().configuration().getBoolean("verifySpaces") && api.Permission.checkServerAdmin(user)) {
Expand Down Expand Up @@ -324,6 +324,10 @@
$.cookie("superAdmin", $.cookie("superAdmin") != "true", { path: '/' });
location.reload();
}

function setMySpaceTypeSessionStorage (){
sessionStorage.setItem("#spacesOwnership", "2");
}
</script>

<script>
Expand Down
7 changes: 7 additions & 0 deletions app/views/spaces/listSpaces.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ <h1>@title</h1>
}
case (_,_) => {}
}
<div class="btn-group btn-group-sm" id="spacesOwnership-displayed-dropdown">
<select id="spacesOwnership" class="form-control" onchange="getSpaceType('@user.get.id')">
<option value="1">Joined Spaces</option>
<option value="2">My Spaces</option>
<option value="3">All Spaces</option>
</select>
</div>
<div class="btn-group btn-group-sm" id="number-displayed-dropdown">
<select id="numPageItems" class="form-control" onchange="getValue()">
<option value="12">12</option>
Expand Down
19 changes: 19 additions & 0 deletions public/javascripts/displayPanels.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ window.onload = function(){
if (pageSize){
document.getElementById('numPageItems').value = pageSize;
}
var spaceType = sessionStorage.getItem("#spacesOwnership");
if (spaceType)
document.getElementById('spacesOwnership').value = spaceType;
};

function getValue(){
Expand All @@ -20,6 +23,22 @@ function getValue(){
window.location.href = updateQueryStringParameter(url, "size", pageItems);
};

function getSpaceType(owner){
var type =$("#spacesOwnership").val();
var url = window.location.href;
if (type == 1) {
window.location.href = updateQueryStringParameter(url, "showAll", false);
sessionStorage.setItem("#spacesOwnership", "1");
} else if (type == 2) {
window.location.href = updateQueryStringParameter(url, "owner", owner);
sessionStorage.setItem("#spacesOwnership", "2");
} else {
window.location.href = url.substring(0, url.indexOf("?"));
sessionStorage.setItem("#spacesOwnership", "3");
}
updatePage();
};

function updateQueryStringParameter(uri, key, value) {
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)", "i");
if( value === undefined ) {
Expand Down