r1768 - in trunk: wao-services/src/main/java/fr/ifremer/wao/services wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer wao-web/src/main/webapp/WEB-INF/content/obsmer wao-web/src/main/webapp/css
Author: bleny Date: 2014-03-27 17:23:08 +0100 (Thu, 27 Mar 2014) New Revision: 1768 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1768 Log: refs #4483 start styling and rethinking sampling plan Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp trunk/wao-web/src/main/webapp/css/wao.css Modified: trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java =================================================================== --- trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java 2014-03-27 13:34:21 UTC (rev 1767) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java 2014-03-27 16:23:08 UTC (rev 1768) @@ -212,4 +212,8 @@ return userProfile.isCoordinatorOrObserver(); } + public boolean isAuthorizedToViewSamplingPlanReal() { + return ! userProfile.isGuest(); + } + } Modified: trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java =================================================================== --- trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java 2014-03-27 13:34:21 UTC (rev 1767) +++ trunk/wao-web/src/main/java/fr/ifremer/wao/web/action/obsmer/SamplingPlanAction.java 2014-03-27 16:23:08 UTC (rev 1768) @@ -78,4 +78,9 @@ getSamplingPlan().getFilterValues()); return filterValues; } + + public boolean isFullView() { + boolean fullView = getAuthenticatedWaoUser().isAdmin() || getAuthenticatedWaoUser().isProfessional(); + return fullView; + } } Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-03-27 13:34:21 UTC (rev 1767) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/sampling-plan.jsp 2014-03-27 16:23:08 UTC (rev 1768) @@ -37,6 +37,12 @@ var sampleRowsFilterController = new SampleRowsFilterController(SAMPLE_ROWS_FILTER_VALUES_JSON_URL, $('#sampling-plan-filters-form')); sampleRowsFilterController.init(); + $('#switch-estimated-real').click(function () { + $('#switch-estimated-real').toggleClass('show-estimated').toggleClass('show-real'); + $('table.sampling-plan').toggleClass('show-estimated').toggleClass('show-real'); + $('.estimated-differ-from-real').effect( "highlight", "slow" ) + }); + }); </script> @@ -49,13 +55,6 @@ <s:text name="wao.ui.page.SamplingPlan.title" /> </h1> - <s:if test="authenticatedWaoUser.authorizedToEditSamplingPlan"> - <s:url action="edit-sample-row!input" id="createSampleRow" /> - <s:a href="%{createSampleRow}" cssClass="btn"> - <i class="icon-plus"></i> <s:text name="wao.ui.action.createSampleRow" /> - </s:a> - </s:if> - <s:form method="GET" id="sampling-plan-filters-form" cssClass="filters-form"> <fieldset> @@ -152,8 +151,23 @@ </s:form> + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + <button type="button" id="switch-estimated-real" class="btn show-estimated"> + <i class="icon-eye"></i> + <span class="estimated">Voir le réel</span> + <span class="real">Voir l'estimé</span> + </button> + </s:if> + + <s:if test="authenticatedWaoUser.authorizedToEditSamplingPlan"> + <s:url action="edit-sample-row!input" id="createSampleRow" /> + <s:a href="%{createSampleRow}" cssClass="btn"> + <i class="icon-plus"></i> <s:text name="wao.ui.action.createSampleRow" /> + </s:a> + </s:if> + <s:set var="estimatedTides" value="true"/> -<s:set var="fullView" value="true"/> +<s:set var="fullView" value="%{fullView}"/> <s:set var="displayTidesReal" value="true"/> <s:set var="nbColumnsForProfession" value="%{#fullView ? 13 : 5}"/> @@ -161,211 +175,253 @@ <s:set var="nbColumnsForOther" value="6"/> <s:set var="nbColumnsTotal" value="%{#nbColumnsForProfession + #nbColumnsForMonths + #nbColumnsForOther}"/> - <table class="large-table table-hover"> + <table id="sampling-plan" class="large-table sampling-plan show-estimated"> <thead> - <tr> - <th colspan="${nbColumnsForProfession}"> <s:text name="wao.ui.samplingPlan.sampledProfessions" /></th> - <th colspan="${nbColumnsForMonths}"> - <s:text name="wao.ui.samplingPlan.effort" /> + <tr> + <th colspan="${nbColumnsForProfession}"> <s:text name="wao.ui.samplingPlan.sampledProfessions" /></th> + <th colspan="${nbColumnsForMonths}"> + <s:text name="wao.ui.samplingPlan.effort" /> - [ <s:text name="wao.ui.samplingPlan.expected"/> <em> - ( <s:text name="wao.ui.samplingPlan.actual" /> - <s:if test="estimatedTides"> + <s:text name="wao.ui.samplingPlan.estimated" /> </s:if>)</em> ] - </th> - <th colspan="${nbColumnsForOther}"><s:text name="wao.ui.misc.others" /></th> - </tr> - <tr> - <!-- Profession columns --> - <td><s:text name="wao.ui.field.SampleRow.code"/></td> - <td><s:text name="wao.ui.samplingPlan.program"/></td> + <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}"><s:text name="wao.ui.misc.others" /></th> + </tr> + <tr> + <!-- Profession columns --> + <th><s:text name="wao.ui.field.SampleRow.code"/></th> + <th><s:text name="wao.ui.samplingPlan.program"/></th> <s:if test="fullView"> - <td class="only-visible-fullview"><s:text name="wao.ui.entity.Company"/></td> + <th class="only-visible-fullview"><s:text name="wao.ui.entity.Company"/></th> </s:if> - <td><s:text name="wao.ui.entity.FishingZone"/></td> + <th><s:text name="wao.ui.entity.FishingZone"/></th> <s:if test="fullView"> - <td class="only-visible-fullview"><s:text name="wao.ui.samplingPlan.fishingZoneInfo"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.dcf5Code"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.meshSize"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.size"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.other"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.libelle"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.species"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.field.SampleRow.periodBegin"/></td> - <td class="only-visible-fullview"><s:text name="wao.ui.field.SampleRow.periodEnd"/></td> + <th class="only-visible-fullview"><s:text name="wao.ui.samplingPlan.fishingZoneInfo"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.dcf5Code"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.meshSize"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.size"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.other"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.libelle"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.species"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.field.SampleRow.periodBegin"/></th> + <th class="only-visible-fullview"><s:text name="wao.ui.field.SampleRow.periodEnd"/></th> </s:if> <s:else> - <td class="only-visible-compactview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.dcf5Code"/></td> - <td class="only-visible-compactview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.libelle"/></td> + <th class="only-visible-compactview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.dcf5Code"/></th> + <th class="only-visible-compactview"><s:text name="wao.ui.misc.METIER"/> <br/> <s:text name="wao.ui.field.SampleRow.libelle"/></th> </s:else> - - <!-- Months columns --> - <s:iterator value="samplingPlan.months" var="month"> - <td<s:if test="@fr.ifremer.wao.WaoUtils@isCurrentMonth(#month)"> class="current-month"</s:if>><s:property value="%{formatMonth(#month)}"/></td> - </s:iterator> - <td><s:text name="wao.ui.misc.total"/></td> - <!-- Other columns --> - <td> - <s:text name="wao.ui.samplingPlan.observationTimesInDays"/> - [ <s:text name="wao.ui.samplingPlan.expected"/><em>(<s:text name="wao.ui.samplingPlan.actual"/><s:if test="estimatedTides"> + <s:text name="wao.ui.samplingPlan.estimated"/></s:if>)</em> ] - </td> - <td><s:text name="wao.ui.samplingPlan.averageTideTime"/></td> - <td><s:text name="wao.ui.samplingPlan.nbObservants"/></td> - <td><s:text name="wao.ui.field.SampleRow.appliedCoverageRate"/></td> - <td><s:text name="wao.ui.misc.comment"/></td> - <td><s:text name="wao.ui.samplingPlan.actions"/></td> - </tr> + + <!-- Months columns --> + <s:iterator value="samplingPlan.months" var="month"> + <th class="effort <s:if test="@fr.ifremer.wao.WaoUtils@isCurrentMonth(#month)"> now</s:if>"> + <s:property value="%{formatMonth(#month)}"/> + </th> + </s:iterator> + <th><s:text name="wao.ui.misc.total"/></th> + <!-- Other columns --> + <th> + <s:text name="wao.ui.samplingPlan.observationTimesInDays"/> + [ <s:text name="wao.ui.samplingPlan.expected"/><em>(<s:text name="wao.ui.samplingPlan.actual"/><s:if test="estimatedTides"> + <s:text name="wao.ui.samplingPlan.estimated"/></s:if>)</em> ] + </th> + <th> + <s:text name="wao.ui.samplingPlan.averageTideTime"/> + </th> + <th> + <s:text name="wao.ui.samplingPlan.nbObservants"/> + </th> + <th> + <s:text name="wao.ui.field.SampleRow.appliedCoverageRate"/> + </th> + <th><s:text name="wao.ui.misc.comment"/></th> + <th><s:text name="wao.ui.samplingPlan.actions"/></th> + </tr> </thead> <tbody> <%--Iterate on Facades--%> <s:iterator value="samplingPlan" var="samplingPlanFacade"> - <tr> - <td colspan="${nbColumnsTotal}" class="facade"><s:property value="%{#samplingPlanFacade.facade}"/></td> - </tr> + <tr class="facade-row"> + <th colspan="${nbColumnsTotal}" class="facade"><s:property value="%{#samplingPlanFacade.facade}"/></td> + </tr> <%--Iterate on Sectors --%> <s:iterator value="samplingPlanFacade" var="samplingPlanSector"> - <tr> - <td colspan="${nbColumnsTotal}" class="sector"><s:property value="%{#samplingPlanSector.sectors}"/></td> - </tr> + <tr class="sector-row"> + <th colspan="${nbColumnsTotal}" class="sector"><s:property value="%{#samplingPlanSector.sectors}"/></td> + </tr> <%--Iterate on SampleRows --%> <s:iterator value="samplingPlanSector" var="samplingPlanRow"> - <tr<s:if test="sampleRowToHighlightId.equals(topiaId)"> class="highlight"</s:if>> - <th> - <s:property value="code" /> - </th> - <td><s:property value="programName" /></td> + <tr class="sample-row-row<s:if test="sampleRowToHighlightId.equals(topiaId)"> highlight</s:if>"> + <th> + <s:property value="code" /> + </th> + <td><s:property value="programName" /></td> <s:if test="fullView"> - <td class="only-visible-fullview"><s:property value="companyName" /></td> + <td class="only-visible-fullview"><s:property value="companyName" /></td> </s:if> - <td class="only-visible-fullview"><s:property value="fishingZones" /></td> + <td class="only-visible-fullview"><s:property value="fishingZones" /></td> <s:if test="fullView"> - <td class="only-visible-fullview"><s:property value="fishingZonesInfos" /></td> - <td class="only-visible-fullview"> - <s:iterator value="dcf5CodesAndDescriptions"> - <span> - <s:property value="key"/> - </span> - </s:iterator> - </td> - <td class="only-visible-fullview"><s:property value="professionMeshSize" /></td> - <td class="only-visible-fullview"><s:property value="professionSize" /></td> - <td class="only-visible-fullview"><s:property value="professionOther" /></td> - <td class="only-visible-fullview"><s:property value="professionLibelle" /></td> - <td class="only-visible-fullview"><s:property value="professionSpecies" /></td> - <td class="only-visible-fullview"><s:property value="%{formatMonth(periodBegin)}" /></td> - <td class="only-visible-fullview"><s:property value="%{formatMonth(periodEnd)}" /></td> + <td class="only-visible-fullview"><s:property value="fishingZonesInfos" /></td> + <td class="only-visible-fullview"> + <s:iterator value="dcf5CodesAndDescriptions"> + <span> + <s:property value="key"/> + </span> + </s:iterator> + </td> + <td class="only-visible-fullview"><s:property value="professionMeshSize" /></td> + <td class="only-visible-fullview"><s:property value="professionSize" /></td> + <td class="only-visible-fullview"><s:property value="professionOther" /></td> + <td class="only-visible-fullview"><s:property value="professionLibelle" /></td> + <td class="only-visible-fullview"><s:property value="professionSpecies" /></td> + <td class="only-visible-fullview"><s:property value="%{formatMonth(periodBegin)}" /></td> + <td class="only-visible-fullview"><s:property value="%{formatMonth(periodEnd)}" /></td> </s:if> <s:else> - <td class="only-visible-compactview"> - <s:iterator value="dcf5CodesAndDescriptions"> - <span> - <s:property value="key"/> - </span> - </s:iterator> - <s:property value="professionDescriptionWithoutDCF5" /> - </td> - <td class="only-visible-compactview"> - <s:property value="professionLibelle" /> - </td> + <td class="only-visible-compactview"> + <s:iterator value="dcf5CodesAndDescriptions"> + <span> + <s:property value="key"/> + </span> + </s:iterator> + <s:property value="professionDescriptionWithoutDCF5" /> + </td> + <td class="only-visible-compactview"> + <s:property value="professionLibelle" /> + </td> </s:else> - <!-- Months columns --> + <!-- Months columns --> <s:iterator value="samplingPlan.months" var="month"> - <td<s:if test="@fr.ifremer.wao.WaoUtils@isCurrentMonth(#month)"> class="current-month"</s:if>> - <s:property value="%{getNbTidesExpected(#month)}"/> - <span<s:if test="hasNbTidesReal(#month) && !#authenticatedWaoUser.guest"> class="display-tides-real"</s:if>> - <em>(<s:property value="%{getNbTidesReal(#month)}"/>) - </em> - </span> - </td> + <s:set var="expected" value="%{getNbTidesExpected(#month)}"/> + <s:set var="estimated" value="%{getNbTidesEstimated(#month)}"/> + <s:set var="real" value="%{getNbTidesReal(#month)}"/> + <td class="effort <s:if test="@fr.ifremer.wao.WaoUtils@isCurrentMonth(#month)"> now</s:if><s:if test="#estimated != #real"> estimated-differ-from-real</s:if>"> + <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>"> + <s:property value="#estimated"/> + </span> + <span class="real<s:if test="#real < #expected"> lower-than-expected</s:if><s:if test="#real > #expected"> higher-than-expected</s:if>"> + <s:property value="#real"/> + </span> + / + </s:if> + <s:property value="#expected"/> + </s:if> + </td> </s:iterator> - <td> - <span> - <s:property value="totalTidesExpected" /> - <s:if test="!authenticatedWaoUser.guest"> - <em>(<s:property value="totalTidesReal" />)</em> - <br/> - <strong><s:property value="totalPercentage" /></strong> - </s:if> - </span> - </td> - <td> - <s:property value="observationTimesInDaysExpected" /> <s:text name="wao.ui.misc.day"/> - <span> - <em>(<s:property value="observationTimesInDaysReal" /> <s:text name="wao.ui.misc.day"/>)</em> - </span> - </td> - <td><s:property value="averageTideTime" /></td> - <td><s:property value="nbObservants" /></td> - <td> - <s:if test="appliedCoverageRate"> - <s:property value="appliedCoverageRate" />% - </s:if> - </td> - <td><s:property value="comment" /></td> + <td class="effort"> + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + <span class="estimated<s:if test="totalTidesEstimated < totalTidesExpected"> lower-than-expected</s:if><s:if test="totalTidesEstimated > totalTidesExpected"> higher-than-expected</s:if>"> + <s:property value="totalTidesEstimated" /> + </span> + <span class="real<s:if test="totalTidesReal < totalTidesExpected"> lower-than-expected</s:if><s:if test="totalTidesReal > totalTidesExpected"> higher-than-expected</s:if>"> + <s:property value="totalTidesReal" /> + </span> + / + </s:if> + <s:property value="totalTidesExpected" /> - <td class="actions"> - <div class="dropdown"> - <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> - <s:text name="wao.ui.actions" /> - <b class="caret"></b> - </a> - <ul class="dropdown-menu"> - <s:if test="authenticatedWaoUser.authorizedToEditSamplingPlan"> + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + (<s:property value="totalPercentage" />) + </s:if> + </td> + <td class="effort"> + + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + <span class="estimated<s:if test="observationTimesInDaysEstimated < observationTimesInDaysExpected"> lower-than-expected</s:if><s:if test="observationTimesInDaysEstimated > observationTimesInDaysExpected"> higher-than-expected</s:if>"> + <s:property value="observationTimesInDaysEstimated" /> <s:text name="wao.ui.misc.day"/> + </span> + <span class="real<s:if test="observationTimesInDaysReal < observationTimesInDaysExpected"> lower-than-expected</s:if><s:if test="observationTimesInDaysReal > observationTimesInDaysExpected"> higher-than-expected</s:if>"> + <s:property value="observationTimesInDaysReal" /> <s:text name="wao.ui.misc.day"/> + </span> + / + </s:if> + + <s:property value="observationTimesInDaysExpected" /> <s:text name="wao.ui.misc.day"/> + + </td> + <td><s:property value="averageTideTime" /></td> + <td><s:property value="nbObservants" /></td> + <td> + <s:if test="appliedCoverageRate"> + <s:property value="appliedCoverageRate" />% + </s:if> + </td> + <td><s:property value="comment" /></td> + + <td class="actions"> + <div class="dropdown"> + <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> + <s:text name="wao.ui.actions" /> + <b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <s:if test="authenticatedWaoUser.authorizedToEditSamplingPlan"> + <li> + <s:url action="edit-sample-row!input" id="editSampleRowUrl"> + <s:param name="sampleRowId" value="sampleRowId" /> + </s:url> + <s:a href="%{editSampleRowUrl}"> + <i class="icon-edit"></i> <s:text name="wao.ui.action.edit" /> + </s:a> + </li> + <li> + <s:url action="delete-sample-row" id="deleteSampleRowUrl"> + <s:param name="companyId" value="sampleRowId" /> + </s:url> + <s:a href="%{deleteSampleRowUrl}"> + <i class="icon-trash"></i> <s:text name="wao.ui.action.delete" /> + </s:a> + </li> + </s:if> <li> - <s:url action="edit-sample-row!input" id="editSampleRowUrl"> + <s:url action="sample-row-log" id="sampleRowLogUrl"> <s:param name="sampleRowId" value="sampleRowId" /> </s:url> - <s:a href="%{editSampleRowUrl}"> - <i class="icon-edit"></i> <s:text name="wao.ui.action.edit" /> + <s:a href="%{sampleRowLogUrl}"> + <i class="icon-time"></i> <s:text name="wao.ui.action.viewSampleRowLog" /> </s:a> </li> <li> - <s:url action="delete-sample-row" id="deleteSampleRowUrl"> - <s:param name="companyId" value="sampleRowId" /> + <s:url action="boats" id="viewElligibleBoatsUrl"> + <s:param name="sampleRowIds" value="sampleRowId" /> </s:url> - <s:a href="%{deleteSampleRowUrl}"> - <i class="icon-trash"></i> <s:text name="wao.ui.action.delete" /> + <s:a href="%{viewElligibleBoatsUrl}"> + <s:text name="wao.ui.action.viewElligibleBoats" /> </s:a> </li> - </s:if> - <li> - <s:url action="sample-row-log" id="sampleRowLogUrl"> - <s:param name="sampleRowId" value="sampleRowId" /> - </s:url> - <s:a href="%{sampleRowLogUrl}"> - <i class="icon-time"></i> <s:text name="wao.ui.action.viewSampleRowLog" /> - </s:a> - </li> - <li> - <s:url action="boats" id="viewElligibleBoatsUrl"> - <s:param name="sampleRowIds" value="sampleRowId" /> - </s:url> - <s:a href="%{viewElligibleBoatsUrl}"> - <s:text name="wao.ui.action.viewElligibleBoats" /> - </s:a> - </li> - <li> - <s:url action="contacts" id="viewAssociatedContactsUrl"> - <s:param name="sampleRowIds" value="sampleRowId" /> - </s:url> - <s:a href="%{viewAssociatedContactsUrl}"> - <s:text name="wao.ui.action.viewAssociatedContacts" /> - </s:a> - </li> - <s:if test="authenticatedWaoUser.authorizedToCreateContact"> <li> - <s:url action="contacts" id="createAssociatedContactUrl"> + <s:url action="contacts" id="viewAssociatedContactsUrl"> <s:param name="sampleRowIds" value="sampleRowId" /> </s:url> - <s:a href="%{createAssociatedContactUrl}"> - <i class="icon-add"></i> <s:text name="wao.ui.action.createAssociatedContact" /> + <s:a href="%{viewAssociatedContactsUrl}"> + <s:text name="wao.ui.action.viewAssociatedContacts" /> </s:a> </li> - </s:if> - </ul> - </div> - </td> - </tr> + <s:if test="authenticatedWaoUser.authorizedToCreateContact"> + <li> + <s:url action="contacts" id="createAssociatedContactUrl"> + <s:param name="sampleRowIds" value="sampleRowId" /> + </s:url> + <s:a href="%{createAssociatedContactUrl}"> + <i class="icon-add"></i> <s:text name="wao.ui.action.createAssociatedContact" /> + </s:a> + </li> + </s:if> + </ul> + </div> + </td> + </tr> <%--Iterate on SampleRows --%> </s:iterator> <%--Iterate on Sectors --%> @@ -375,36 +431,64 @@ </todby> <tfoot> - <td colspan="${nbColumnsForProfession}"> - <s:text name="wao.ui.misc.totals" /> - </td> - <!-- Months columns --> - <s:iterator value="samplingPlan.months" var="month"> - <td<s:if test="@fr.ifremer.wao.WaoUtils@isCurrentMonth(#month)"> class="current-month"</s:if>> - <s:property value="samplingPlan.getTotalExpected(#month)"/> - <span class="display-tides-real"> - <span> - <em>(<s:property value="samplingPlan.getTotalReal(#month)"/>)</em> + <th colspan="${nbColumnsForProfession}"> + <s:text name="wao.ui.misc.totals" /> + </th> + <!-- Months columns --> + <s:iterator value="samplingPlan.months" var="month"> + <td class="effort<s:if test="@fr.ifremer.wao.WaoUtils@isCurrentMonth(#month)"> now</s:if>"> + <s:set var="expected" value="%{samplingPlan.getTotalExpected(#month)}"/> + <s:set var="estimated" value="%{samplingPlan.getTotalEstimated(#month)}"/> + <s:set var="real" value="%{samplingPlan.getTotalReal(#month)}"/> + <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>"> + <s:property value="#estimated"/> + </span> + <span class="real<s:if test="#real < #expected"> lower-than-expected</s:if><s:if test="#real > #expected"> higher-than-expected</s:if>"> + <s:property value="#real"/> + </span> + / + </s:if> + <s:property value="#expected"/> + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + <s:property value="samplingPlan.getTotalRatio(#month)"/> + </s:if> + </td> + </s:iterator> + <td class="effort"> + <s:set var="expected" value="%{samplingPlan.highTotalExpected}"/> + <s:set var="estimated" value="%{samplingPlan.highTotalEstimated}"/> + <s:set var="real" value="%{samplingPlan.highTotalReal}"/> + <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>"> + <s:property value="#estimated"/> </span> - <br/> - <s:property value="samplingPlan.getTotalRatio(#month)"/> - </span> + <span class="real<s:if test="#real < #expected"> lower-than-expected</s:if><s:if test="#real > #expected"> higher-than-expected</s:if>"> + <s:property value="#real"/> + </span> + / + </s:if> + <s:property value="#expected"/> + <s:if test="authenticatedWaoUser.authorizedToViewSamplingPlanReal"> + <s:property value="samplingPlan.highTotalRatio" /> + </s:if> </td> - </s:iterator> - <td> - <s:property value="samplingPlan.highTotalExpected" /> - <s:if test="!authenticatedWaoUser.guest"> - <em>(<s:property value="samplingPlan.highTotalReal" />)</em> - <strong><s:property value="samplingPlan.highTotalRatio" /></strong> - </s:if> - </td> - <td> - <s:property value="samplingPlan.observationTimesInDaysTotalExpected" /> <s:text name="wao.ui.misc.day"/> - <span> - <em>(<s:property value="samplingPlan.observationTimesInDaysTotalReal"/> <s:text name="wao.ui.misc.day"/>)</em> - </span> - </td> - <td colspan="${nbColumnsForOther}"> </td> + <td> + <s:set var="expected" value="%{samplingPlan.observationTimesInDaysTotalExpected}"/> + <s:set var="estimated" value="%{samplingPlan.observationTimesInDaysTotalEstimated}"/> + <s:set var="real" value="%{samplingPlan.observationTimesInDaysTotalReal}"/> + <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>"> + <s:property value="#estimated"/> <s:text name="wao.ui.misc.day"/> + </span> + <span class="real<s:if test="#real < #expected"> lower-than-expected</s:if><s:if test="#real > #expected"> higher-than-expected</s:if>"> + <s:property value="#real"/> <s:text name="wao.ui.misc.day"/> + </span> + / + </s:if> + <s:property value="#expected"/> <s:text name="wao.ui.misc.day"/> + </td> + <th colspan="${nbColumnsForOther}"></th> </tfoot> </table> Modified: trunk/wao-web/src/main/webapp/css/wao.css =================================================================== --- trunk/wao-web/src/main/webapp/css/wao.css 2014-03-27 13:34:21 UTC (rev 1767) +++ trunk/wao-web/src/main/webapp/css/wao.css 2014-03-27 16:23:08 UTC (rev 1768) @@ -19,16 +19,58 @@ * #L% */ -/** +/****************************************************************************** * Personnalisation de Bootstrap - */ + *****************************************************************************/ /* On surcharge left: 0px par left: 0% car ça pose problème pour Firefox qui place le menu complètement à gauche de la fenêtre et pas en dessous du bouton */ .dropdown-menu { left: 0%; } +legend+.control-group { + margin-top: 0px; +} + +/****************************************************************************** + * Des classes à usage transverse + *****************************************************************************/ + +/* pour représente qu'une entité (société, utilisateur) est inactive */ +.highlight { + background-color: #ffff99; +} + +/* pour représenter qu'on est à l'instant présent */ +.now { + background-color: #ffff99; +} + +.inactive { + text-decoration: line-through; +} + /** + * Class permettant de faire faire une rotation à un élément de 90° sur la gauche. + * Ça peut par exemeple servir pour un th, afin de gagner de la largeur + * + * voir http://stackoverflow.com/questions/15806925/how-to-rotate-text-left-90-degre... + */ +.rotate { + display: block; + -moz-transform: rotate(-90.0deg); /* FF3.5+ */ + -o-transform: rotate(-90.0deg); /* Opera 10.5 */ + -webkit-transform: rotate(-90.0deg); /* Saf3.1+, Chrome */ + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)"; /* IE8 */ + +} + + +/****************************************************************************** + * Styles globaux à l'application + *****************************************************************************/ + +/** * Le style du layout */ @@ -77,23 +119,6 @@ float: right; } -legend+.control-group { - margin-top: 0px; -} - -/** - * Des classes à usage transverse - */ - -/* pour représente qu'une entité (société, utilisateur) est inactive */ -.highlight { - background-color: #ffff99; -} - -.inactive { - text-decoration: line-through; -} - th.actions, td.actions { white-space: nowrap; } @@ -106,10 +131,6 @@ list-style-type: none; } -.large-table tbody tr:hover { - background-color: #f5f5f5; -} - .large-table tbody th, .large-table td { border: solid 1px #aaaaaa; border-left-style: dashed; @@ -133,9 +154,9 @@ margin-right: 5px; } -/** +/****************************************************************************** * Styles spécifiques pour certaines pages de l'appli - */ + *****************************************************************************/ #expectedObservationsByMonthsTable th { white-space: nowrap; @@ -158,3 +179,53 @@ margin-bottom: 20px; } +table.sampling-plan tr.facade-row { + color: white; + background-color: seagreen; + background-color: darkslategrey; + font-size: 150%; + line-height: 150%; +} + +table.sampling-plan tr.sector-row { + color: white; + background-color: darkcyan; + background-color: darkseagreen; + font-size: 120%; + line-height: 120%; +} + +table.sampling-plan tr.facade-row th, +table.sampling-plan tr.sector-row th { + text-align: left; + padding: 10px; +} + +table.sampling-plan tbody tr.sample-row-row:nth-child(2n) { + background-color: #e6e6e6; +} + +table.sampling-plan tbody tr.sample-row-row:hover { + background-color: tan; + background-color: antiquewhite; + background-color: palegoldenrod; + background-color: papayawhip; + background-color: wheat; + background-color: beige; +} + +.show-estimated .real, .show-real .estimated { + display: none; +} + +td.effort .lower-than-expected { + color : red; +} + +td.effort .higher-than-expected { + color : green; +} + +td.effort { + text-align: center; +} \ No newline at end of file
participants (1)
-
bleny@users.forge.codelutin.com