From dd59b6e022e8a62067291dbdd239e7bc601cc9da Mon Sep 17 00:00:00 2001 From: aina-esokia Date: Mon, 5 Mar 2018 18:02:44 +0400 Subject: [PATCH] modif on tools when multiple record selection --- .../web/prod/actions/Tools/index.html.twig | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig index e380dc77d0..19d20b74a9 100644 --- a/templates/web/prod/actions/Tools/index.html.twig +++ b/templates/web/prod/actions/Tools/index.html.twig @@ -407,20 +407,22 @@ }; - $(document).ready(function(){ - $('.tool-metadata').click(function(e){ - $.ajax({ - "url": "{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document'}) }}", - "type": "GET", - beforeSend: function(){ - $('#metadata-content').empty(); - $('#metadata-load').removeClass('hidden').addClass('loading'); - }, - success: function (data) { - $('#metadata-load').removeClass('loading').addClass('hidden'); - $('#metadata-content').append(data); - } + {% if record is not null %} + $(document).ready(function(){ + $('.tool-metadata').click(function(e){ + $.ajax({ + "url": "{{ path('prod_subdefs_metadata', {'databox_id': record.get_sbas_id(), 'record_id': record.get_record_id, 'subdef_name': 'document'}) }}", + "type": "GET", + beforeSend: function(){ + $('#metadata-content').empty(); + $('#metadata-load').removeClass('hidden').addClass('loading'); + }, + success: function (data) { + $('#metadata-load').removeClass('loading').addClass('hidden'); + $('#metadata-content').append(data); + } + }); }); }); - }); + {% endif %}