Author: jcouteau Date: 2014-01-02 11:45:53 +0100 (Thu, 02 Jan 2014) New Revision: 395 Url: http://chorem.org/projects/chorem/repository/revisions/395 Log: fixes #938 : [Tableau de budget] Rajouter un moyen visuel pour voir les factures pr?\195?\169visionnelles - Un icone warning est rajout?\195?\169 en cas de facture pr?\195?\169visionnelle (regexp sur le pattern PREV) refs #939 : [Tableau de budget] Refonte du pop-up de d?\195?\169tail - Clic dans toute la cellule pour afficher le pop-up. D?\195?\169but de tentative de refonte plus profonde du comportement sans succ?\195?\168s (d?\195?\169sactiv?\195?\169) Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp trunk/chorem-webmotion/src/main/webapp/css/chorem.less trunk/chorem-webmotion/src/main/webapp/js/chorem.js Modified: trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp =================================================================== --- trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2013-12-17 10:55:59 UTC (rev 394) +++ trunk/chorem-webmotion/src/main/webapp/WEB-INF/jsp/dashboardBudget.jsp 2014-01-02 10:45:53 UTC (rev 395) @@ -81,17 +81,26 @@ </c:url> <c:choose> <c:when test="${data.getInvoices(d, c.userObject).isEmpty()}"> - <span class="withPopover" - title='Aucune entrée <span><a href="${addDebtUrl}"><li class="icon-plus"></li>Debt</a><span> <span><a href="${addIncomeUrl}"><li class="icon-plus"></li>Income</a><span>'> + <div class="withPopover" + title='Aucune entrée <span><a href="${addDebtUrl}"><li class="icon-plus"></li>Debt</a><span> <span><a href="${addIncomeUrl}"><li class="icon-plus"></li>Income</a><span>'> <f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/> - </span> + </div> </c:when> <c:otherwise> - <span class="withPopover" - title='Detail pour <f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/> <span><a href="${addDebtUrl}"><li class="icon-plus"></li>Debt</a><span> <span><a href="${addIncomeUrl}"><li class="icon-plus"></li>Income</a><span>' - data-content='<w:display wikitties="${data.getInvoices(d, c.userObject)}" toString="<span class=\"withTooltip\" title=\"%FinancialTransaction.category$s: %FinancialTransaction.payer$s -> %FinancialTransaction.beneficiary$s\">%FinancialTransaction.reference|noref$s: %FinancialTransaction.amount|0.0$,.2f</span>"/>'> + <c:set var="prev" value="0"/> + <c:forEach var="invoice" items="${data.getInvoices(d, c.userObject)}}"> + <c:if test='${invoice.matches("(.*)PREV(.*)")}'> + <c:set var="prev" value="1"/> + </c:if> + </c:forEach> + <div class="withPopover" + title='Detail pour <f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/> <span><a href="${addDebtUrl}"><li class="icon-plus"></li>Debt</a><span> <span><a href="${addIncomeUrl}"><li class="icon-plus"></li>Income</a><span>' + data-content='<w:display wikitties="${data.getInvoices(d, c.userObject)}" toString="<span class=\"withTooltip\" title=\"%FinancialTransaction.category$s: %FinancialTransaction.payer$s -> %FinancialTransaction.beneficiary$s\">%FinancialTransaction.reference|noref$s: %FinancialTransaction.amount|0.0$,.2f</span>"/>'> + <c:if test="${prev==1}"> + <i class="icon-warning-sign icon-black"></i> + </c:if> <f:formatNumber type="currency" value="${data.getAmount(d, c.userObject)}"/> - </span> + </div> </c:otherwise> </c:choose> </td> Modified: trunk/chorem-webmotion/src/main/webapp/css/chorem.less =================================================================== --- trunk/chorem-webmotion/src/main/webapp/css/chorem.less 2013-12-17 10:55:59 UTC (rev 394) +++ trunk/chorem-webmotion/src/main/webapp/css/chorem.less 2014-01-02 10:45:53 UTC (rev 395) @@ -134,6 +134,11 @@ .calendar em:before{left:13px;} .calendar em:after{right:13px;} +.prev{ + border-color:red; + border-width:thin; +} + /* Les differents niveaux pour le tableau de budget*/ .categorylevel (@level) { margin-left: @level * 10px; Modified: trunk/chorem-webmotion/src/main/webapp/js/chorem.js =================================================================== --- trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2013-12-17 10:55:59 UTC (rev 394) +++ trunk/chorem-webmotion/src/main/webapp/js/chorem.js 2014-01-02 10:45:53 UTC (rev 395) @@ -31,12 +31,39 @@ } $(function() { - $('.withTooltip').tooltip({html:true}); -}); + $('.withTooltip').tooltip({html:true}); + }); +var enterShow = function (popover) { + if (popover.data('state') === 'hover') { + popover.popover('show'); + } +}; +var exitHide = function (popover) { + if (popover.data('state') === 'hover') { + popover.popover('hide'); + } +}; + +var clickToggle = function (popover) { + if (popover.data('state') === 'hover') { + popover.data('state', 'pinned'); + } else { + popover.data('state', 'hover') + popover.popover('hover'); + } +}; + +/*$(function() { + $('.withPopover').data('state','hover').popover({trigger: 'manual'}) + .on('mouseenter', enterShow($(this))) + .on('mouseleave', exitHide($(this))) + .on('click', clickToggle($(this))); +});*/ + $(function() { - $('.withPopover').popover({trigger: 'click', html:true}); -}); + $('.withPopover').popover({html:true}); + }); $(function () { $.datepicker.setDefaults($.datepicker.regional['fr']);