This is an automated email from the git hooks/post-receive script. New commit to branch feature/5651 in repository wao. See http://git.codelutin.com/wao.git commit 4bbbec41111d10e622113213ab733ec030a12bd7 Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Oct 14 17:05:27 2014 +0200 On montre les jours de mer dans la vue du plan d'échantillonnage obsmer --- .../fr/ifremer/wao/web/WaoJspActionSupport.java | 3 +- .../main/resources/i18n/wao-web_en_GB.properties | 2 + .../main/resources/i18n/wao-web_fr_FR.properties | 2 + .../WEB-INF/content/obsmer/sampling-plan.jsp | 106 +++++++++++++-------- .../WEB-INF/content/templates/td-effort-obsmer.jsp | 13 +++ .../webapp/WEB-INF/content/templates/td-effort.jsp | 2 +- wao-web/src/main/webapp/wao.css | 2 + 7 files changed, 89 insertions(+), 41 deletions(-) diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java b/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java index daf61a0..118f6a0 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/WaoJspActionSupport.java @@ -182,7 +182,8 @@ public class WaoJspActionSupport extends WaoActionSupport { return ImmutableMap.of( "version", (Object) "4.2", "samplingPlanFullView", isSamplingPlanFullViewByDefault(), - "contactsListFullView", isContactsListFullViewByDefault() + "contactsListFullView", isContactsListFullViewByDefault(), + "samplingPlanDaysView", false ); } diff --git a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties index 00a2f11..5ed97b4 100644 --- a/wao-web/src/main/resources/i18n/wao-web_en_GB.properties +++ b/wao-web/src/main/resources/i18n/wao-web_en_GB.properties @@ -79,7 +79,9 @@ wao.ui.action.save.success=Modifications saved wao.ui.action.showDetails=Show details wao.ui.action.showFilters=Show filters wao.ui.action.switchToCompactView=Switch to compact view +wao.ui.action.switchToDaysView=Switch to view in days wao.ui.action.switchToFullView=Switch to full view +wao.ui.action.switchToObservationsView=Swith to view in tides wao.ui.action.unvalidateContact=Unvalidate contact wao.ui.action.viewAssociatedContacts=View sample row contacts wao.ui.action.viewAssociatedContactsForBoat=View %s contacts for this boat diff --git a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties index 57ae1b2..5de8dc6 100644 --- a/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties +++ b/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties @@ -80,7 +80,9 @@ wao.ui.action.save.success=Les informations ont bien été enregistrées wao.ui.action.showDetails=Voir les détails wao.ui.action.showFilters=Afficher les filtres wao.ui.action.switchToCompactView=Réduire la vue +wao.ui.action.switchToDaysView=Basculer vers la vue en jours de mer wao.ui.action.switchToFullView=Étendre la vue +wao.ui.action.switchToObservationsView=Basculer vers la vue en nombre de marées wao.ui.action.unvalidateContact=Invalider le contact wao.ui.action.viewAssociatedContacts=Voir les contacts associés à cette ligne wao.ui.action.viewAssociatedContactsForBoat=Voir les %s contacts pour ce navire diff --git a/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp b/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp index 61e536c..d32e078 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp @@ -32,8 +32,7 @@ $(document).ready(function () { - // var sampleRowsFilterController = new FilterController(WAO.SAMPLE_ROWS_FILTER_VALUES_JSON_URL, $('#sampling-plan-filters-form')); - // sampleRowsFilterController.init(); + // gestion des filtres var sampleRowsFilterMappings = [ <s:if test="authenticatedWaoUser.authorizedToViewOtherCompanies"> @@ -80,18 +79,41 @@ sampleRowsFilterController2 = new FilterController2(sampleRowsFilterMappings, filter, WAO.SAMPLE_ROWS_FILTER_VALUES_JSON_URL, $('#sampling-plan-filters-form fieldset.extra-filters')); sampleRowsFilterController2.init(); + // gestion du mode estimé vs réel + $('#switch-estimated-real').click(function () { - $('#switch-estimated-real').toggleClass('show-estimated').toggleClass('show-real'); - $('table.sampling-plan').toggleClass('show-estimated').toggleClass('show-real'); + $('#switch-estimated-real, table.sampling-plan').toggleClass('show-estimated').toggleClass('show-real'); $('.estimated-differ-from-real').effect( "highlight", "slow" ) }); + // gestion du mode compact vs vue complète + var $views = $('#switch-compact-full-view, table.sampling-plan'); $views.toggleCompactFullView(WAO.getCookie().samplingPlanFullView); $('#switch-compact-full-view').click(function () { WAO.getCookie().samplingPlanFullView = ! WAO.getCookie().samplingPlanFullView; $views.toggleCompactFullView(WAO.getCookie().samplingPlanFullView); + }); + + // gestion du mode observations vs jours de mer + + $.fn.toggleObservationsDaysView = function (daysView) { + return this.each(function () { + if (daysView) { + $(this).addClass('days-view').removeClass('observations-view'); + } else { + $(this).addClass('observations-view').removeClass('days-view'); + } + }) + } + + var $views2 = $('#switch-observations-days-view, table.sampling-plan'); + $views2.toggleObservationsDaysView(WAO.getCookie().samplingPlanDaysView); + + $('#switch-observations-days-view').click(function () { + WAO.getCookie().samplingPlanDaysView = ! WAO.getCookie().samplingPlanDaysView; + $views2.toggleObservationsDaysView(WAO.getCookie().samplingPlanDaysView); }); }); @@ -161,6 +183,16 @@ </s:form> <div class="sticky-buttons"> + + <button type="button" id="switch-observations-days-view" class="btn"> + <span class="only-in-observations-view"> + <i class="fa fa-calendar"></i><span class="only-on-hover"> <s:text name="wao.ui.action.switchToDaysView" /></span> + </span> + <span class="only-in-days-view"> + <i class="fa fa-anchor"></i><span class="only-on-hover"> <s:text name="wao.ui.action.switchToObservationsView" /></span> + </span> + </button> + <button type="button" id="switch-compact-full-view" class="btn"> <span class="only-in-compact-view"> <i class="fa fa-expand"></i><span class="only-on-hover"> <s:text name="wao.ui.action.switchToFullView" /></span> @@ -180,6 +212,7 @@ </span> </button> </s:if> + </div> <s:if test="authenticatedWaoUser.authorizedToViewOtherCompanies"> @@ -190,7 +223,7 @@ </s:else> <s:set var="nbColumnsForProfessionInCompactView" value="5" /> <s:set var="nbColumnsForMonths" value="%{samplingPlan.months.size() + 1}" /> -<s:set var="nbColumnsForOther" value="6" /> +<s:set var="nbColumnsForOther" value="5" /> <s:set var="nbColumnsTotalInFullView" value="%{#nbColumnsForProfessionInFullView + #nbColumnsForMonths + #nbColumnsForOther}" /> <s:set var="nbColumnsTotalInCompactView" value="%{#nbColumnsForProfessionInCompactView + #nbColumnsForMonths + #nbColumnsForOther}" /> @@ -203,7 +236,7 @@ <th colspan="<s:property value="#nbColumnsForProfessionInCompactView" />" class="only-in-compact-view firstline"> <s:text name="wao.ui.samplingPlan.sampledProfessions" /> </th> - <th colspan="${nbColumnsForMonths}" class="firstline"> + <th colspan="${nbColumnsForMonths}" class="firstline only-in-observations-view"> <s:text name="wao.ui.samplingPlan.effort" /> <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> @@ -219,6 +252,21 @@ ] </s:if> </th> + <th colspan="${nbColumnsForMonths}" class="firstline only-in-days-view"> + <s:text name="wao.ui.samplingPlan.observationTimesInDays"/> + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + [ + <span class="estimated"> + (<s:text name="wao.ui.samplingPlan.actual" /> + <s:text name="wao.ui.samplingPlan.estimated" />) + </span> + <span class="real"> + <s:text name="wao.ui.samplingPlan.actual" /> + </span> + / + <s:text name="wao.ui.samplingPlan.expected"/> + ] + </s:if> + </th> <th colspan="${nbColumnsForOther}" class="firstline"><s:text name="wao.ui.misc.others" /></th> </tr> <tr> @@ -251,23 +299,9 @@ </th> </s:iterator> <th><s:text name="wao.ui.misc.total"/></th> + <!-- Other columns --> <th> - <s:text name="wao.ui.samplingPlan.observationTimesInDays"/> - <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> - [ - <span class="estimated"> - (<s:text name="wao.ui.samplingPlan.actual" /> + <s:text name="wao.ui.samplingPlan.estimated" />) - </span> - <span class="real"> - <s:text name="wao.ui.samplingPlan.actual" /> - </span> - / - <s:text name="wao.ui.samplingPlan.expected"/> - ] - </s:if> - </th> - <th> <s:text name="wao.ui.samplingPlan.averageTideTime"/> </th> <th> @@ -365,21 +399,18 @@ </td> <!-- Months columns --> <s:iterator value="samplingPlan.months" var="month"> - <s:set var="effort" value="#samplingPlanRow.effortInObservationsPerMonths.get(#month)"/> + <s:set var="effortInObservations" value="#samplingPlanRow.effortInObservationsPerMonths.get(#month)"/> + <s:set var="effortInDays" value="#samplingPlanRow.effortInDaysPerMonths.get(#month)"/> <s:set var="now" value="%{isCurrentMonth(#month)}"/> <s:set var="showPercentage" value="false"/> - <%@include file="../templates/td-effort.jsp" %> + <%@include file="../templates/td-effort-obsmer.jsp" %> </s:iterator> - <s:set var="effort" value="#samplingPlanRow.totalObservations"/> - <s:set var="now" value="false"/> - <s:set var="showPercentage" value="true"/> - <%@include file="../templates/td-effort.jsp" %> - - <s:set var="effort" value="#samplingPlanRow.totalDays"/> + <s:set var="effortInObservations" value="#samplingPlanRow.totalObservations"/> + <s:set var="effortInDays" value="#samplingPlanRow.totalDays"/> <s:set var="now" value="false"/> <s:set var="showPercentage" value="true"/> - <%@include file="../templates/td-effort.jsp" %> + <%@include file="../templates/td-effort-obsmer.jsp" %> <td class="align-center"><s:property value="averageTideTime" /></td> <td class="align-center"><s:property value="nbObservants" /></td> @@ -491,21 +522,18 @@ <!-- Months columns --> <s:iterator value="samplingPlan.months" var="month"> - <s:set var="effort" value="samplingPlan.totalEffortInObservationsPerMonths.get(#month)"/> + <s:set var="effortInObservations" value="samplingPlan.totalEffortInObservationsPerMonths.get(#month)"/> + <s:set var="effortInDays" value="samplingPlan.totalEffortInDaysPerMonths.get(#month)"/> <s:set var="now" value="%{isCurrentMonth(#month)}"/> <s:set var="showPercentage" value="true"/> - <%@include file="../templates/td-effort.jsp" %> + <%@include file="../templates/td-effort-obsmer.jsp" %> </s:iterator> - <s:set var="effort" value="samplingPlan.highTotalEffortInObservations"/> - <s:set var="now" value="false"/> - <s:set var="showPercentage" value="true"/> - <%@include file="../templates/td-effort.jsp" %> - - <s:set var="effort" value="samplingPlan.highTotalEffortInDays"/> + <s:set var="effortInObservations" value="samplingPlan.highTotalEffortInObservations"/> + <s:set var="effortInDays" value="samplingPlan.highTotalEffortInDays"/> <s:set var="now" value="false"/> <s:set var="showPercentage" value="true"/> - <%@include file="../templates/td-effort.jsp" %> + <%@include file="../templates/td-effort-obsmer.jsp" %> <th colspan="${nbColumnsForOther}"></th> diff --git a/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort-obsmer.jsp b/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort-obsmer.jsp new file mode 100644 index 0000000..27c5a80 --- /dev/null +++ b/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort-obsmer.jsp @@ -0,0 +1,13 @@ +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> +<%@taglib uri="/struts-tags" prefix="s" %> + +<%-- Pour le plan d'échantillonnage ObsMer, au lieu d'avoir une cellule d'effort, +on affiche deux td.effort : une pour les jours de mer et l'autre pour le nombre d'observations --%> + +<s:set var="effort" value="#effortInObservations"/> +<s:set var="tdCssClasses">only-in-observations-view</s:set> +<%@include file="td-effort.jsp" %> + +<s:set var="effort" value="#effortInDays"/> +<s:set var="tdCssClasses">only-in-days-view</s:set> +<%@include file="td-effort.jsp" %> diff --git a/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort.jsp b/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort.jsp index a0c1ff9..3296290 100644 --- a/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort.jsp +++ b/wao-web/src/main/webapp/WEB-INF/content/templates/td-effort.jsp @@ -7,7 +7,7 @@ <s:set var="estimated" value="#effort.estimated"/> <s:set var="real" value="#effort.real"/> -<td class="effort <s:if test="#now"> now</s:if><s:if test="#estimated != #real"> estimated-differ-from-real</s:if>"> +<td class="effort <s:if test="#now"> now</s:if><s:if test="#estimated != #real"> estimated-differ-from-real</s:if> <s:property value="#tdCssClasses"/>"> <s:if test="#expected != null"> <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> <span class="estimated<s:if test="#estimated < #expected"> lower-than-expected</s:if><s:if test="#estimated > #expected"> higher-than-expected</s:if>"> diff --git a/wao-web/src/main/webapp/wao.css b/wao-web/src/main/webapp/wao.css index 40a54ee..f4768ed 100644 --- a/wao-web/src/main/webapp/wao.css +++ b/wao-web/src/main/webapp/wao.css @@ -96,6 +96,8 @@ span[data-toggle="tooltip"] { max-width: 100px; } +.observations-view .only-in-days-view, +.days-view .only-in-observations-view, .compact-view .only-in-full-view, .full-view .only-in-compact-view, .show-estimated .real, -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.