Unverified Commit 2e0d7ad0 authored by Jerome Boucher's avatar Jerome Boucher
Browse files

feat/13448 : discovering archives adapt result list menu

parent 502452fb
Pipeline #13855 failed with stages
in 59 seconds
......@@ -3119,7 +3119,8 @@ tbody.collapse.in {
overflow: hidden;
background-color: #e5e5e5;
}
.dropdown-menu > li > a {
.dropdown-menu > li > a,
.dropdown-menu > span > li > a {
display: block;
padding: 3px 20px;
clear: both;
......@@ -3129,14 +3130,19 @@ tbody.collapse.in {
white-space: nowrap;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
.dropdown-menu > li > a:focus,
.dropdown-menu > span > li > a:hover,
.dropdown-menu > span > li > a:focus {
text-decoration: none;
color: #262626;
background-color: #f5f5f5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
.dropdown-menu > .active > a:focus,
.dropdown-menu > .active > span > a,
.dropdown-menu > .active > span > a:hover,
.dropdown-menu > .active > span > a:focus {
color: #ffffff;
text-decoration: none;
outline: 0;
......@@ -3144,11 +3150,16 @@ tbody.collapse.in {
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
.dropdown-menu > .disabled > a:focus,
.dropdown-menu > .disabled > span > a,
.dropdown-menu > .disabled > span > a:hover,
.dropdown-menu > .disabled > span > a:focus {
color: #999999;
}
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
.dropdown-menu > .disabled > a:focus,
.dropdown-menu > .disabled > span > a:hover,
.dropdown-menu > .disabled > span > a:focus {
text-decoration: none;
background-color: transparent;
background-image: none;
......
......@@ -115,6 +115,7 @@ var ArchivesAction = {
var relevant = null;
var ids = [];
var names = [];
var hasNoRightsCount = 0;
if (status == '') {
dataSelector.push('[data-archive-status]');
......@@ -146,6 +147,9 @@ var ArchivesAction = {
$.each(relevant, function () {
ids.push($(this).val());
id = '#'+ $(this).val();
if ($(id).attr('data-hasRights') == 'false') {
hasNoRightsCount++;
}
names.push($(id).attr('name'));
});
......@@ -153,7 +157,8 @@ var ArchivesAction = {
selected: $('input[data-archive-status]:checked').length,
relevant: relevant.length,
ids: ids,
names: names
names: names,
hasNoRightsCount: hasNoRightsCount
};
if (selectedArchives.selected == 0) {
......
<ul data-translate-catalog="recordsManagement/messages" class="dropdown-menu actionMenu" data-archiveid='[?merge .archiveId?]' aria-labelledby="actionsModify">
<?merge hasModificationPrivilege.bool() ?>
<li class="editRetentionRule" data-type="retentionRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify retention rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="editAccessRule" data-type="accessRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify access rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="freeze [?merge .status.ifeq('frozen').then('hide', '') ?]" data-type="freeze"><a href="#"><i class="fa fa-lock">&nbsp;</i>&nbsp;Freeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="unfreeze [?merge .status.ifne('frozen').then('hide', '') ?]" data-type="unfreeze"><a href="#"><i class="fa fa-unlock">&nbsp;</i>&nbsp;Unfreeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="divider"></li>
<?merge hasDeliveryPrivilege.bool() ?>
<?merge .hasRights.bool() ?>
<span>
<?merge hasModificationPrivilege.bool() ?>
<li class="editRetentionRule" data-type="retentionRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify retention rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="editAccessRule" data-type="accessRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify access rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="freeze [?merge .status.ifeq('frozen').then('hide', '') ?]" data-type="freeze"><a href="#"><i class="fa fa-lock">&nbsp;</i>&nbsp;Freeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="unfreeze [?merge .status.ifne('frozen').then('hide', '') ?]" data-type="unfreeze"><a href="#"><i class="fa fa-unlock">&nbsp;</i>&nbsp;Unfreeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="divider"></li>
<?merge hasModificationRequestPrivilege.bool() ?>
<li class="requestModification" data-type="requestModification"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Request a modification</a></li>
<?merge hasRestitutionPrivilege.bool() ?>
<li class="flagForRestitution" data-type="flagForRestitution"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for restitution</a></li>
<?merge hasDestructionPrivilege.bool() ?>
<li class="flagForDestruction [?merge .status.ifeq('disposable').then('hide', '') ?]" data-type="flagForDestruction"><a href="#"><i class="fa fa-trash">&nbsp;</i>&nbsp;Flag for destruction</a></li>
<?merge hasDestructionCancelPrivilege.bool() ?>
<li class="cancelDestruction [?merge .status.ifne('disposable').then('hide', '') ?]" data-type="cancelDestruction"><a href="#"><i class="fa fa-undo">&nbsp;</i>&nbsp;Cancel destruction request</a></li>
<?merge hasTransferPrivilege.bool() ?>
<li class="flagForTransfer" data-type="flagForTransfer"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for transfer</a></li>
<li class="divider"></li>
<?merge hasIntegrityCheckPrivilege.bool() ?>
<li class="checkHash" data-type="checkHash"><a href="#"><i class="fa fa-database">&nbsp;</i>&nbsp;Verify integrity</a></li>
<li class="divider"></li>
</span>
<li class="requestDelivery" data-type="requestCommunication"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Request of communication</a></li>
<?merge hasModificationRequestPrivilege.bool() ?>
<li class="requestModification" data-type="requestModification"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Request a modification</a></li>
<?merge hasRestitutionPrivilege.bool() ?>
<li class="flagForRestitution" data-type="flagForRestitution"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for restitution</a></li>
<?merge hasDestructionPrivilege.bool() ?>
<li class="flagForDestruction [?merge .status.ifeq('disposable').then('hide', '') ?]" data-type="flagForDestruction"><a href="#"><i class="fa fa-trash">&nbsp;</i>&nbsp;Flag for destruction</a></li>
<?merge hasDestructionCancelPrivilege.bool() ?>
<li class="cancelDestruction [?merge .status.ifne('disposable').then('hide', '') ?]" data-type="cancelDestruction"><a href="#"><i class="fa fa-undo">&nbsp;</i>&nbsp;Cancel destruction request</a></li>
<?merge hasTransferPrivilege.bool() ?>
<li class="flagForTransfer" data-type="flagForTransfer"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for transfer</a></li>
<li class="divider"></li>
<?merge hasIntegrityCheckPrivilege.bool() ?>
<li class="checkHash" data-type="checkHash"><a href="#"><i class="fa fa-database">&nbsp;</i>&nbsp;Verify integrity</a></li>
<li class="divider"></li>
</ul>
......@@ -38,9 +38,8 @@
</thead>
<tbody>
<?merge archive ?>
<tr id="[?merge .archiveId ?]" name="[?merge .archiveName ?]" class="[?merge .disposable.bool().then('danger') ?]" data-iscommunicable="[?merge .isCommunicable ?]">
<tr id="[?merge .archiveId ?]" name="[?merge .archiveName ?]" class="[?merge .disposable.bool().then('danger') ?] [?merge .hasRights.bool().not().then('text-muted') ?]" data-iscommunicable="[?merge .isCommunicable ?]" data-hasRights="[?merge .hasRights.bool().then('true', 'false') ?]">
<td>
<?merge .hasRights.bool() ?>
<input type="checkbox"
data-archive-status="[?merge .status ?]"
data-final-disposition='[?merge .finalDisposition ?]'
......@@ -58,8 +57,7 @@
<td>
<div class="btn-group pull-right">
<!--button type="button" class="btn btn-success btn-sm requestDelivery" id="requestCom" data-archiveid='[?merge .archiveId?]' title="Request of communication"><span class="fa fa-cloud-upload">&nbsp;</span></button-->
<button type="button" class="btn btn-success btn-sm viewArchive" title="Info"><span class="fa fa-info-circle">&nbsp;</span></button>
<?merge .hasRights.bool().not() @disabled ?>
<button type="button" class="btn btn-success btn-sm viewArchive [?merge .hasRights.bool().not().then('disabled') ?]" title="Info"><span class="fa fa-info-circle">&nbsp;</span></button>
<button class="btn btn-warning btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-edit">&nbsp;</i>&nbsp;
<span class="caret"></span>
......@@ -98,4 +96,14 @@
$("#archiveList_actions").prop('disabled', true);
}
});
$('#archiveList_actions').on('click', function () {
//use addToCollection because it includes all differents types
var archivesSelected = ArchivesAction.getSelectedArchives('addToCollection');
if (archivesSelected.hasNoRightsCount > 0) {
$('#resultListHtmlAuthorizedMenu').hide();
} else {
$('#resultListHtmlAuthorizedMenu').show();
}
});
</script>
<ul data-translate-catalog="recordsManagement/messages" class="dropdown-menu multipleActionMenu" role="menu" aria-labelledby="actions">
<?merge hasModificationPrivilege.bool() ?>
<li class="editRetentionRule" data-type="retentionRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify retention rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="editAccessRule" data-type="accessRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify access rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="freeze" data-type="freeze"><a href="#"><i class="fa fa-lock">&nbsp;</i>&nbsp;Freeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="unfreeze" data-type="unfreeze"><a href="#"><i class="fa fa-unlock">&nbsp;</i>&nbsp;Unfreeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="divider"></li>
<?merge hasDeliveryPrivilege.bool() ?>
<span id="resultListHtmlAuthorizedMenu">
<?merge hasModificationPrivilege.bool() ?>
<li class="editRetentionRule toto" data-type="retentionRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify retention rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="editAccessRule" data-type="accessRule"><a href="#"><i class="fa fa-edit">&nbsp;</i>&nbsp;Modify access rule</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="freeze" data-type="freeze"><a href="#"><i class="fa fa-lock">&nbsp;</i>&nbsp;Freeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="unfreeze" data-type="unfreeze"><a href="#"><i class="fa fa-unlock">&nbsp;</i>&nbsp;Unfreeze</a></li>
<?merge hasModificationPrivilege.bool() ?>
<li class="divider"></li>
<?merge hasModificationRequestPrivilege.bool() ?>
<li class="requestModification" data-type="requestModification"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Request a modification</a></li>
<?merge hasDestructionPrivilege.bool() ?>
<li class="flagForDestruction" data-type="flagForDestruction"><a href="#"><i class="fa fa-trash">&nbsp;</i>&nbsp;Flag for destruction</a></li>
<?merge hasDestructionCancelPrivilege.bool() ?>
<li class="cancelDestruction" data-type="cancelDestruction"><a href="#"><i class="fa fa-undo">&nbsp;</i>&nbsp;Cancel destruction request</a></li>
<?merge hasRestitutionPrivilege.bool() ?>
<li class="flagForRestitution" data-type="flagForRestitution"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for restitution</a></li>
<?merge hasTransferPrivilege.bool() ?>
<li class="flagForTransfer" data-type="flagForTransfer"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for transfer</a></li>
<?merge hasDestructionPrivilege.bool() ?>
<li class="divider"></li>
<?merge hasIntegrityCheckPrivilege.bool() ?>
<li class="checkHash" data-type="checkHash"><a href="#"><i class="fa fa-database">&nbsp;</i>&nbsp;Verify integrity</a></li>
<?merge hasDeliveryPrivilege.bool() ?>
<li class="divider"></li>
</span>
<li class="requestDelivery" data-type="requestCommunication"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Request of communication</a></li>
<?merge hasModificationRequestPrivilege.bool() ?>
<li class="requestModification" data-type="requestModification"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Request a modification</a></li>
<?merge hasDestructionPrivilege.bool() ?>
<li class="flagForDestruction" data-type="flagForDestruction"><a href="#"><i class="fa fa-trash">&nbsp;</i>&nbsp;Flag for destruction</a></li>
<?merge hasDestructionCancelPrivilege.bool() ?>
<li class="cancelDestruction" data-type="cancelDestruction"><a href="#"><i class="fa fa-undo">&nbsp;</i>&nbsp;Cancel destruction request</a></li>
<?merge hasRestitutionPrivilege.bool() ?>
<li class="flagForRestitution" data-type="flagForRestitution"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for restitution</a></li>
<?merge hasTransferPrivilege.bool() ?>
<li class="flagForTransfer" data-type="flagForTransfer"><a href="#"><i class="fa fa-upload">&nbsp;</i>&nbsp;Flag for transfer</a></li>
<?merge hasDestructionPrivilege.bool() ?>
<li class="divider"></li>
<?merge hasIntegrityCheckPrivilege.bool() ?>
<li class="checkHash" data-type="checkHash"><a href="#"><i class="fa fa-database">&nbsp;</i>&nbsp;Verify integrity</a></li>
<li class="divider"></li>
</ul>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment