diff --git a/js/arche_detail.js b/js/arche_detail.js index 4b2fd21..28be732 100644 --- a/js/arche_detail.js +++ b/js/arche_detail.js @@ -50,7 +50,6 @@ jQuery(function ($) { * @returns {undefined} */ function checkUserPermission() { - console.log("https://invalid:credentials@" + baseApiUrl + "/user/logout?redirect=" + apiUrl); if ($('div').hasClass('download-login-div')) { let resourceId = $("#resId").val(); let aclRead = $("#resource-acl-read").val(); @@ -78,30 +77,19 @@ jQuery(function ($) { if (data.length === 0 || data.access == 'login') { $('#download-not-logged').removeClass('d-none'); } else { - if (data.access == 'authorized' || (acdhType.toLowerCase() === 'collection' || acdhType.toLowerCase() === 'topcollection')) { - $('#download-resource-section').removeClass('d-none'); - $('#download-logged').removeClass('d-none'); - $('#download-not-logged').addClass('d-none'); - $('#user-logged-text').html(data.username + ' : ' + data.roles); - $('#download-logout').removeClass('d-none'); + if (data.access == 'authorized' || (acdhType.toLowerCase() === 'collection' || acdhType.toLowerCase() === 'topcollection')) { $('#download-restricted').addClass('d-none'); - if (data.loginMethod == 'shibboleth') { - $('.gui-shibboleth-logout').removeClass('d-none'); - } else { - $('.gui-https-logout').removeClass('d-none'); - } + $('#download-not-logged').addClass('d-none'); + $('#download-logged').removeClass('d-none'); + $('#download-not-authorized').addClass('d-none'); + $('#download-resource-section').removeClass('d-none'); + $('#user-logged-text').html(data.username + ' : ' + data.roles); } else if (data.access == 'not authorized') { $('#download-restricted').addClass('d-none'); - $('#download-logged').removeClass('d-none'); + $('#download-not-logged').addClass('d-none'); + $('#download-logged').addClass('d-none'); $('#download-not-authorized').removeClass('d-none'); - $('#user-logged-not-auth-text').html(data.username + ' : ' + data.roles); - $('#user-not-authorized-text').html(Drupal.t("You don't have enough rights!")); - $('#download-logout').removeClass('d-none'); - if (data.loginMethod == 'shibboleth') { - $('.gui-shibboleth-logout').removeClass('d-none'); - } else { - $('.gui-https-logout').removeClass('d-none'); - } + $('#user-logged-not-auth-text').html(data.username + ' : ' + data.roles); } else if (data.access == 'login') { $('#download-not-logged').removeClass('d-none'); } diff --git a/templates/blocks/download-card-block.html.twig b/templates/blocks/download-card-block.html.twig index 253e491..37ed67c 100644 --- a/templates/blocks/download-card-block.html.twig +++ b/templates/blocks/download-card-block.html.twig @@ -48,46 +48,46 @@ + -
-
-
-
- {{ "You are not authorized to download this data!"|trans }}

-
-
- {{ "You are logged in as"|trans }}: -
- +
+
+
+
+ {{ "You are not authorized to download this data!"|trans }}

+
+
+ {{ "You are logged in as"|trans }}:
+
+
- {% set resourceApiUrl = data.getRepoUrl() %} + {% set resourceApiUrl = data.getRepoUrl() %} -
+
- {% if data.isBinary %} - + {% if data.isBinary %} + - {% endif %} - {% if data.acdhType|lower == "collection" or data.acdhType|lower == "topcollection" %} - - - {% elseif data.acdhType|lower == "resource" %} - {% endif %} + {% endif %} + {% if data.acdhType|lower == "collection" or data.acdhType|lower == "topcollection" %} + + + {% elseif data.acdhType|lower == "resource" %} + {% endif %} -
- +
-
\ No newline at end of file +