From: Johan Cwiklinski Date: Sat, 9 Nov 2019 07:08:45 +0000 (+0100) Subject: Fix translation domain, fix icons display X-Git-Tag: 0.9.3~43 X-Git-Url: https://git.agnieray.net/?a=commitdiff_plain;h=6cc584d80c1f17d0e61edf85c6c6edd2d03bdbba;p=galette.git Fix translation domain, fix icons display Rework the tooltip content guess --- diff --git a/galette/templates/default/ajouter_contribution.tpl b/galette/templates/default/ajouter_contribution.tpl index 90594ccd1..3f5b82e9d 100644 --- a/galette/templates/default/ajouter_contribution.tpl +++ b/galette/templates/default/ajouter_contribution.tpl @@ -42,13 +42,26 @@

{_T string="NB : The mandatory fields are in"} {_T string="red"}

- {if $type eq {_T string="fee" domain="routes"}} + {if $type eq "fee"} {_T string="Select contributor and membership fee type"} - {_T string="fee" domain="routes"}, "action" => {_T string="add" domain="routes"}]}?trans_id={$transaction->id}" class="button notext fright" id="btnadd" title="{_T string="Create a new fee that will be attached to the current transaction"}">{_T string="New attached fee"} {else} - {_T string="Select contributor and donation type"} - - {_T string="donation" domain="routes"}, "action" => {_T string="add" domain="routes"}]}?trans_id={$transaction->id}" class="button notext fright" id="btnadddon" title="{_T string="Create a new donation that will be attached to the current transaction"}">{_T string="New attached donation"} + {_T string="Select contributor and donation type"} + {/if} + {if $contribution->id && $contribution->transaction->getMissingAmount() > 0} + "fee", "action" => "add"]}?trans_id={$contribution->transaction->id}" + class="button fright tooltip" + title="{_T string="Create a new fee that will be attached to the current transaction"}"> + + {_T string="New attached fee"} + + "donation", "action" => "add"]}?trans_id={$contribution->transaction->id}" + class="button fright tooltip" + title="{_T string="Create a new donation that will be attached to the current transaction"}"> + + {_T string="New attached donation"} + {/if}

diff --git a/galette/webroot/js/common.js b/galette/webroot/js/common.js index 8666015cc..c93d2ae4d 100644 --- a/galette/webroot/js/common.js +++ b/galette/webroot/js/common.js @@ -157,17 +157,32 @@ var _initTooltips = function(selector) { items: selector + ".tooltip, a[title]", content: function(event, ui) { var _this = $(this); + var _content; + //first, value from @class=tip element var _next = _this.nextAll('.tip'); - if (_next.length == 0) { - _next = _this.find('.sr-only'); + if (_next.length > 0) { + _content = _next.html(); } - if (_next.length == 0) { - return _this.attr('title'); - } else { - return _next.html(); + //second, value from @title + if (typeof _content == 'undefined') { + var _title = _this.attr('title'); + if (typeof _title != 'undefined') { + _content = _title; + } + } + + //and finally, value from @class=sr-only element + if (typeof _content == 'undefined') { + var _sronly = _this.find('.sr-only'); + console.log(_sronly); + if (_sronly.length > 0) { + _content = _sronly.html(); + } } + + return _content; } }); }