Skip to content

Commit 42f95eb

Browse files
committed
Moved Remove button from list of subcollections in collection on the listing page to the collection page to be consistent with datasets.
1 parent 2244437 commit 42f95eb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

app/views/collections/listchildcollection.scala.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ <h3><a href="@(routes.Collections.collection(collection.id))">@Html(collection.n
5353
<span class='glyphicon glyphicon-star-empty'></span> Unfollow</a>
5454
</div>
5555
}
56-
<!-- If user can delete, the button is enabled, otherwise the button is present but disabled to provide consistent UE. -->
57-
@if( user.get.id.equals(collection.author.id) || Permission.checkPermission(Permission.RemoveResourceFromCollection, ResourceRef(ResourceRef.collection, collection.id))){
58-
<button onclick="confirmRemoveResourceFromResource('collection','collection','@(parent.id)','collection','@(collection.id)','@(collection.name)',true,'@(redirect)')"
59-
class="btn btn-link" title="Remove the child collection from the collection @parent.name">
60-
<span class="glyphicon glyphicon-remove"></span> Remove</button>
61-
} else {
62-
<div class="inline" title="No permission to delete the child collection">
63-
<button class="btn btn-link btn-sm disabled"><span class="glyphicon glyphicon-remove"></span> Remove</button>
64-
</div>
65-
}
6656
}
6757
</div>
6858
</div>

app/views/collections/parentAllocation.scala.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ <h4>Parent collections</h4>
2626
} else {
2727
@p.childCollectionsCount collections
2828
}
29+
<!-- If the user can edit the collection, the elements are enabled, otherwise they are present but disabled to provide consistent UE. -->
30+
@if(Permission.checkPermission(Permission.RemoveResourceFromCollection, ResourceRef(ResourceRef.collection, currentCollection.id))){
31+
| <button onclick="confirmRemoveResourceFromResource('collection','collection','@(p.id)','collection','@(currentCollection.id)','@(currentCollection.name)',true,'@(routes.Collections.collection(currentCollection.id))')"
32+
class="btn btn-link btn-xs" title="Remove the child collection from the collection @p.name">
33+
<span class="glyphicon glyphicon-remove"></span> Remove</button>
34+
} else {
35+
| <div class="inline" title="No permission to delete the child collection">
36+
<button class="btn btn-link btn-xs disabled"><span class="glyphicon glyphicon-remove"></span> Remove</button>
37+
</div>
38+
}
2939
</div>
3040
</div>
3141
</div>

0 commit comments

Comments
 (0)