Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#647 #784

Merged
merged 5 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,10 @@ class OpusController extends OpusBaseController {
render template: "editAboutPage"
}

def editDeleteCollectionPanel = {
render template: "editDeleteCollectionPage"
}

def reportPanel = {
render template: "report"
}
Expand Down
23 changes: 23 additions & 0 deletions grails-app/views/opus/_editDeleteCollectionPage.gsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="panel panel-default" ng-controller="OpusController as opusCtrl" ng-form="DeleteCollectionForm" ng-cloak>
<div class="panel-heading">
<a name="deleteCollection">
<h4 class="section-panel-heading">Delete Collection</h4>
</a>
</div>

<div class="panel-body">
<div class="row">
<div class="col-sm-12">
<p class="bg-info alert alert-danger">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>Please note clicking delete button will delete this collection. All data of the collection will be lost and cannot be recovered. Only proceed if you are absolutely sure.
</p>
</div>
<div class="col-sm-12">
<button ng-click="opusCtrl.deleteOpus()" class="btn btn-danger" target="_self">
<i class="fa fa-trash-o"></i> Delete this collection
</button>
</div>
</div>
</div>
</div>
9 changes: 3 additions & 6 deletions grails-app/views/opus/edit.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
<a href="${request.contextPath}/opus/{{opusCtrl.opus.shortName ? opusCtrl.opus.shortName : opusCtrl.opus.uuid}}"
class="btn btn-default" target="_self" ng-show="opusCtrl.opus.uuid"><i
class="fa fa-eye"></i> Public View</a>
<g:if test="${params.isALAAdmin}">
<button ng-click="opusCtrl.deleteOpus()" class="btn btn-danger" target="_self"
ng-show="opusCtrl.opus.uuid"><i
class="fa fa-trash-o"></i> Delete this collection
</button>
</g:if>
</div>
</div>
</div>
Expand Down Expand Up @@ -127,7 +121,10 @@
<g:include controller="opus" action="editAboutPanel" params="[opusId: params.opusId]"/>

<additional-statuses opus="opusCtrl.opus"></additional-statuses>

<g:include controller="opus" action="editDeleteCollectionPanel" params="[opusId: params.opusId]"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a check if user is alaAdmin before displaying this.

</g:if>

</div>
</div>

Expand Down
Loading