From 75841b9fb2029946789de529ef1f71661ab56cff Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Thu, 25 Feb 2021 21:48:19 +0100 Subject: [PATCH] Do not create compilation with no excerpts --- .../templates/freemarker/body/search/search-pagedResults.ftl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/src/main/webapp/templates/freemarker/body/search/search-pagedResults.ftl b/webapp/src/main/webapp/templates/freemarker/body/search/search-pagedResults.ftl index 981e4d626..cb22923c5 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/search/search-pagedResults.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/search/search-pagedResults.ftl @@ -135,6 +135,11 @@ $('input[type=checkbox]').removeAttr('checked'); } } function createNewCompilation() { + var excerpts = $('.virtualArticlePart').toArray(); + if (excerpts.length == 0){ + alert("Отрывков не найдено."); + return; + } var compilationName = window.prompt("Введите название подборки."); if (!compilationName){ alert("Для создания подоборки необходимо ввести её название.");