Merge pull request #3552 from alchemy-fr/PHRAS-3148_thesaurus_Guy

PHRAS-3148 Merge fix populate from Thesaurus GUI
This commit is contained in:
Nicolas Maillat
2020-07-02 14:42:21 +02:00
committed by GitHub
2 changed files with 56 additions and 74 deletions

View File

@@ -33,23 +33,17 @@
<a href="javascript:void(0)" id="delete_sy">{{ 'thesaurus:properties:: Mettre dans le stock' | trans }}</a> <a href="javascript:void(0)" id="delete_sy">{{ 'thesaurus:properties:: Mettre dans le stock' | trans }}</a>
</div> </div>
<div id="desktop" class="dialog"> <div id="desktop" class="dialog">
<div class="menu" id="flagsMenu" style="z-index:999">
{% for code, language in languages %}
<a id='flagMenu_{{ code }}' href='javascript:void(0)' class=''>
<img src='/assets/common/images/lng/{{ code }}_flag_18.gif' />{{ language }}</a>
{% endfor %}
</div>
<div style='text-align:right'> <H4>{{ fullpath | raw }}</H4>
<div style='float:right'>
<b>id:</b>&nbsp;{{ id }} <b>id:</b>&nbsp;{{ id }}
</div> </div>
<H4>{{ fullpath | raw }}</H4><br/>
{% if typ == "CT" %} {% if typ == "CT" %}
<br/> <br/>
{% elseif typ == "TH" %} {#{% elseif typ == "TH" %}
{% trans with {'%hits%' : hits} %}thesaurus:: %hits% reponses retournees{% endtrans %} {% trans with {'%hits%' : hits} %}thesaurus:: %hits% reponses retournees{% endtrans %}
<br/> <br/>
<br/> <br/>#}
{% endif %} {% endif %}
<div id="TSY" class="tableContainer" style="margin:10px; position:relative; top:0px; left:0px"> <div id="TSY" class="tableContainer" style="margin:10px; position:relative; top:0px; left:0px">
<div> <div>
@@ -295,8 +289,8 @@
// td.setAttribute("colSpan", "3"); // attention au 'S' majuscule !!! // td.setAttribute("colSpan", "3"); // attention au 'S' majuscule !!!
td.innerHTML = n.getAttribute("t"); td.innerHTML = n.getAttribute("t");
td = tr.appendChild(document.createElement("td")); /*td = tr.appendChild(document.createElement("td"));
td.innerHTML = n.getAttribute("hits"); td.innerHTML = n.getAttribute("hits");*/
td = tr.appendChild(document.createElement("td")); td = tr.appendChild(document.createElement("td"));
td.innerHTML = n.getAttribute("id"); td.innerHTML = n.getAttribute("id");
@@ -322,17 +316,6 @@
; ;
if(tr) if(tr)
myGUI.select(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; break;
case "MOUSEDOWN": case "MOUSEDOWN":

View File

@@ -169,10 +169,6 @@
<p><img id='flagMenu_{{ code }}' src='/assets/common/images/lng/{{ code }}_flag_18.gif' /> {{ language }}</p> <p><img id='flagMenu_{{ code }}' src='/assets/common/images/lng/{{ code }}_flag_18.gif' /> {{ language }}</p>
{% endfor %} {% endfor %}
{# {% for code, language in flags %}
<a id='flagMenu_{{ code }}' href='javascript:void(0)' class=''>
<img src='/assets/common/images/lng/{{ code }}_flag_18.gif' />{{ language }}</a>
{% endfor %}#}
</div> </div>
<div class="menu" id="kctermMenu" style="z-index:999; width:240px;"> <div class="menu" id="kctermMenu" style="z-index:999; width:240px;">
<a href="javascript:void(0)" class="" id="kcterm_properties" style="font-weight:700">{{ 'thesaurus::menu: proprietes' | trans }}</a> <a href="javascript:void(0)" class="" id="kcterm_properties" style="font-weight:700">{{ 'thesaurus::menu: proprietes' | trans }}</a>
@@ -1525,55 +1521,58 @@
*/ */
/**Populate btn action**/ $(document).ready(function () {
$('#populate_btn').click(function (e) { /**Populate btn action**/
e.preventDefault(); $('#populate_btn').bind('click', function (e) {
$("#confirm_populate").dialog({ e.preventDefault();
modal: true, $("#confirm_populate").dialog({
title: "{{ 'thesaurus: Populate title' | trans }}", modal: true,
autoOpen:false, title: "{{ 'thesaurus: Populate title' | trans }}",
width: 400, autoOpen:false,
open:function () { width: 400,
$(this).closest(".ui-dialog") open:function () {
.find(".ui-button:first") // the first button $(this).closest(".ui-dialog")
.addClass("close-dialog").hide(); .find(".ui-button:first") // the first button
$('.cancel_button').click(function () { .addClass("close-dialog").hide();
$('.close-dialog').trigger('click'); $('.cancel_button').click(function () {
}); $('.close-dialog').trigger('click');
$('#CTERMS').find('.OB').addClass('ob').removeClass('OB'); });
$('#THP_C').html('+'); $('#CTERMS').find('.OB').addClass('ob').removeClass('OB');
$('#THP_C').html('+');
} }
}); });
$("#confirm_populate").dialog('open'); $("#confirm_populate").dialog('open');
$('#confirm_populate_button').click(function () { $('#confirm_populate_button').unbind('click').bind('click', function (e) {
$.ajax({ e.preventDefault();
type: 'GET', $.ajax({
url: '/admin/worker-manager/populate-status', type: 'GET',
data: { url: '/admin/worker-manager/populate-status',
sbasIds: [{{ bid }}] data: {
}, sbasIds: [{{ bid }}]
success: function (data) { },
if (data == 0) { success: function (data) {
$.ajax({ if (data == 0) {
url: '/thesaurus/populate', $.ajax({
type: 'POST', url: '/thesaurus/populate',
data: { type: 'POST',
databox_id: {{ bid }} data: {
}, databox_id: {{ bid }}
success: function (data) { },
//humane.info('{{ "thesaurus::populate: success message" |trans }}'); success: function (data) {
$('.close-dialog').trigger('click'); //humane.info('{{ "thesaurus::populate: success message" |trans }}');
} $('.close-dialog').trigger('click');
}); }
} else { });
alert('{{ "thesaurus::populate: Warning populate is in process to indexing databox" |trans }}'); } else {
} alert('{{ "thesaurus::populate: Warning populate is in process to indexing databox" |trans }}');
} }
}); }
}) });
}); })
});
})
</script> </script>
</body> </body>