From e01daeed8ce778d07bd64e68e7d77edaac20f1b0 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Thu, 2 Jul 2020 12:23:25 +0400 Subject: [PATCH 1/3] PHRAS-3148 Properties remove Hits --- templates/web/thesaurus/properties.html.twig | 36 +++++++++----------- templates/web/thesaurus/thesaurus.html.twig | 4 --- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/templates/web/thesaurus/properties.html.twig b/templates/web/thesaurus/properties.html.twig index 78510851a1..bcb7e82ad0 100644 --- a/templates/web/thesaurus/properties.html.twig +++ b/templates/web/thesaurus/properties.html.twig @@ -33,23 +33,24 @@ {{ 'thesaurus:properties:: Mettre dans le stock' | trans }}
- #} -
+ +

{{ fullpath | raw }}

+
id: {{ id }}
-

{{ fullpath | raw }}


{% if typ == "CT" %}
- {% elseif typ == "TH" %} + {#{% elseif typ == "TH" %} {% trans with {'%hits%' : hits} %}thesaurus:: %hits% reponses retournees{% endtrans %}
-
+
#} {% endif %}
@@ -136,6 +137,14 @@ sy_list = ret.getElementsByTagName("sy_list").item(0); refresh_sy(sy_list); + /* $.ajax({ + type: "GET", + url: `${url}?${parms}`, + success: function(data){ + $('#DLG_PROPERTIES').html(''); + $('#DLG_PROPERTIES').append(data); + } + });*/ refresh = ret.getElementsByTagName("refresh"); @@ -295,8 +304,8 @@ // td.setAttribute("colSpan", "3"); // attention au 'S' majuscule !!! td.innerHTML = n.getAttribute("t"); - td = tr.appendChild(document.createElement("td")); - td.innerHTML = n.getAttribute("hits"); + /*td = tr.appendChild(document.createElement("td")); + td.innerHTML = n.getAttribute("hits");*/ td = tr.appendChild(document.createElement("td")); td.innerHTML = n.getAttribute("id"); @@ -322,17 +331,6 @@ ; if(tr) myGUI.select(tr); - /* switch(o.id.substr(0, 4)) - { - case "FLG_": // le drapeau - document.getElementById("flagsMenu").runAsMenu( evt, tr ); - break; - case "SYN_": // le synonyme - document.getElementById("syMenu").runAsMenu( evt, tr ); - $('.delete_term').html(''); - $('.delete_term', tr).append($('#syMenu').html()); - break; - }*/ } break; case "MOUSEDOWN": diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index dfcc12fdd1..d8149b0544 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -169,10 +169,6 @@

{{ language }}

{% endfor %} - {# {% for code, language in flags %} - - {{ language }} - {% endfor %}#}
@@ -1521,55 +1521,58 @@ */ - /**Populate btn action**/ - $('#populate_btn').click(function (e) { - e.preventDefault(); - $("#confirm_populate").dialog({ - modal: true, - title: "{{ 'thesaurus: Populate title' | trans }}", - autoOpen:false, - width: 400, - open:function () { - $(this).closest(".ui-dialog") - .find(".ui-button:first") // the first button - .addClass("close-dialog").hide(); - $('.cancel_button').click(function () { - $('.close-dialog').trigger('click'); - }); - $('#CTERMS').find('.OB').addClass('ob').removeClass('OB'); - $('#THP_C').html('+'); + $(document).ready(function () { + /**Populate btn action**/ + $('#populate_btn').bind('click', function (e) { + e.preventDefault(); + $("#confirm_populate").dialog({ + modal: true, + title: "{{ 'thesaurus: Populate title' | trans }}", + autoOpen:false, + width: 400, + open:function () { + $(this).closest(".ui-dialog") + .find(".ui-button:first") // the first button + .addClass("close-dialog").hide(); + $('.cancel_button').click(function () { + $('.close-dialog').trigger('click'); + }); + $('#CTERMS').find('.OB').addClass('ob').removeClass('OB'); + $('#THP_C').html('+'); - } - }); - $("#confirm_populate").dialog('open'); - $('#confirm_populate_button').click(function () { - $.ajax({ - type: 'GET', - url: '/admin/worker-manager/populate-status', - data: { - sbasIds: [{{ bid }}] - }, - success: function (data) { - if (data == 0) { - $.ajax({ - url: '/thesaurus/populate', - type: 'POST', - data: { - databox_id: {{ bid }} - }, - success: function (data) { - //humane.info('{{ "thesaurus::populate: success message" |trans }}'); - $('.close-dialog').trigger('click'); - } - }); - } else { - alert('{{ "thesaurus::populate: Warning populate is in process to indexing databox" |trans }}'); - } - } - }); - }) - }); + } + }); + $("#confirm_populate").dialog('open'); + $('#confirm_populate_button').unbind('click').bind('click', function (e) { + e.preventDefault(); + $.ajax({ + type: 'GET', + url: '/admin/worker-manager/populate-status', + data: { + sbasIds: [{{ bid }}] + }, + success: function (data) { + if (data == 0) { + $.ajax({ + url: '/thesaurus/populate', + type: 'POST', + data: { + databox_id: {{ bid }} + }, + success: function (data) { + //humane.info('{{ "thesaurus::populate: success message" |trans }}'); + $('.close-dialog').trigger('click'); + } + }); + } else { + alert('{{ "thesaurus::populate: Warning populate is in process to indexing databox" |trans }}'); + } + } + }); + }) + }); + }) From e7e1e08c331db77147d5907313c2414c3f120204 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Thu, 2 Jul 2020 14:32:42 +0400 Subject: [PATCH 3/3] PHRAS-3148 --- templates/web/thesaurus/properties.html.twig | 15 --------------- templates/web/thesaurus/thesaurus.html.twig | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/templates/web/thesaurus/properties.html.twig b/templates/web/thesaurus/properties.html.twig index bcb7e82ad0..7f8674b6e0 100644 --- a/templates/web/thesaurus/properties.html.twig +++ b/templates/web/thesaurus/properties.html.twig @@ -33,13 +33,6 @@ {{ 'thesaurus:properties:: Mettre dans le stock' | trans }}
- {##} -

{{ fullpath | raw }}

@@ -137,14 +130,6 @@ sy_list = ret.getElementsByTagName("sy_list").item(0); refresh_sy(sy_list); - /* $.ajax({ - type: "GET", - url: `${url}?${parms}`, - success: function(data){ - $('#DLG_PROPERTIES').html(''); - $('#DLG_PROPERTIES').append(data); - } - });*/ refresh = ret.getElementsByTagName("refresh"); diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index 62fce8f343..ed93f6a7c2 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -226,7 +226,7 @@

{{ 'thesaurus:: confirm populate' | trans }}

- +