mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 16:22:20 +02:00
Rename all the attributes for navigation in list with basket
This commit is contained in:
30
templates/base/components/basket/layout.html.twig
Normal file
30
templates/base/components/basket/layout.html.twig
Normal file
@@ -0,0 +1,30 @@
|
||||
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
<div id='{{ oUIBlock.GetId() }}'
|
||||
class='{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {{ oUIBlock.GetCSSColorClass() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %} ibo-is-opened' data-role='ibo-basket'>
|
||||
{% block ibobasket %}
|
||||
<form id='ibo-form-basket' class='ibo-basket-form' method='post'>
|
||||
<input type='hidden' name='basket_list_basket' value='{{ oUIBlock.GetList() }}'/>
|
||||
<input type='hidden' name='basket_class' value='{{ oUIBlock.GetClass() }}'/>
|
||||
<input type='hidden' name='basket_filter' value='{{ oUIBlock.GetFilter() }}'/>
|
||||
<input type='hidden' name='basket_back_posted_fields' value='{{ oUIBlock.GetPostedFields()|raw }}'/>
|
||||
<input type='hidden' name='basket_back_url' value='{{ oUIBlock.GetBackUrl()|raw }}'/>
|
||||
<div class='ibo-form-basket--nav fas fa-angle-up' id='{{ oUIBlock.GetId() }}-back' data-tooltip-content='{{ 'UI:Basket:Back'|dict_s }}'></div>
|
||||
{% if oUIBlock.HasPrec() %}
|
||||
<div class='ibo-form-basket--nav fas fa-angle-double-left' id='{{ oUIBlock.GetId() }}-first' data-tooltip-content='{{ 'UI:Basket:First'|dict_s }}'></div>
|
||||
<div class='ibo-form-basket--nav fas fa-angle-left' id='{{ oUIBlock.GetId() }}-prev' data-tooltip-content='{{ 'UI:Basket:Previous'|dict_s }}'></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
<div class='ibo-form-basket--total'>{{ oUIBlock.GetIdx() }} /
|
||||
<span id='{{ oUIBlock.GetId() }}-total' class='ibo-form-basket--total--link' data-tooltip-content='{{ 'UI:Basket:Back'|dict_s }}'>{{ oUIBlock.GetCount() }}</span>
|
||||
</div>
|
||||
{% if oUIBlock.HasNext() %}
|
||||
<div class='ibo-form-basket--nav fas fa-angle-right' id='{{ oUIBlock.GetId() }}-next' data-tooltip-content='{{ 'UI:Basket:Next'|dict_s }}'></div>
|
||||
<div class='ibo-form-basket--nav fas fa-angle-double-right' id='{{ oUIBlock.GetId() }}-last' data-tooltip-content='{{ 'UI:Basket:Last'|dict_s }}'></div>
|
||||
{% else %}
|
||||
   
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
</div>
|
||||
55
templates/base/components/basket/layout.js.twig
Normal file
55
templates/base/components/basket/layout.js.twig
Normal file
@@ -0,0 +1,55 @@
|
||||
{# @copyright Copyright (C) 2010-2021 Combodo SARL #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
function backToBasket() {
|
||||
$('#ibo-form-basket').attr('action', '{{ oUIBlock.GetBackUrl() | raw }}');
|
||||
$('#ibo-form-basket').attr('method', 'post');
|
||||
$('#ibo-form-basket').find('[name=basket_filter]').val('');
|
||||
|
||||
if ('{{ oUIBlock.GetPostedFields() | raw }}' != '')
|
||||
{
|
||||
JSON.parse('{{ oUIBlock.GetPostedFields() | raw }}', (key, value) => {
|
||||
$('#ibo-form-basket').append($('<input/>').attr({'type': 'hidden', 'name': key, 'value': value}));
|
||||
});
|
||||
}
|
||||
|
||||
$('#ibo-form-basket').submit();
|
||||
|
||||
}
|
||||
$('#{{ oUIBlock.GetId() }}-back').on('click', function () {
|
||||
backToBasket();
|
||||
});
|
||||
$('#{{ oUIBlock.GetId() }}-total').on('click', function () {
|
||||
backToBasket();
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-first').on('click', function () {
|
||||
$('#ibo-form-basket').attr('action', ' {{ oUIBlock.GetUrlFirst() | raw }} ');
|
||||
$('#ibo-form-basket').submit();
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-prev').on('click', function () {
|
||||
$('#ibo-form-basket').attr('action', ' {{ oUIBlock.GetUrlPrev()| raw }} ');
|
||||
$('#ibo-form-basket').submit();
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-next').on('click', function () {
|
||||
$('#ibo-form-basket').attr('action', ' {{ oUIBlock.GetUrlNext() | raw }} ');
|
||||
$('#ibo-form-basket').submit();
|
||||
});
|
||||
|
||||
$('#{{ oUIBlock.GetId() }}-last').on('click', function () {
|
||||
$('#ibo-form-basket').attr('action', ' {{ oUIBlock.GetUrlLast() | raw }} ');
|
||||
$('#ibo-form-basket').submit()
|
||||
});
|
||||
|
||||
/*a first try but not the good solution to keep basket in edit mode */
|
||||
$('.ibo-panel--toolbar a').each(function (idx, elt) {
|
||||
var onclick = $(this).attr("onClick");
|
||||
if (typeof onclick == 'undefined' && onclick == false)
|
||||
{
|
||||
$(this).on('click', function () {
|
||||
$('#ibo-form-basket').attr('action', $this.attr('href'));
|
||||
$('#ibo-form-basket').submit();
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user