[Suiviobsmer-commits] r435 - in trunk: . wao-ui/src/main/java/fr/ifremer/wao/ui/pages wao-ui/src/main/webapp wao-ui/src/main/webapp/css wao-ui/src/main/webapp/img
Author: fdesbois Date: 2010-04-08 15:12:47 +0000 (Thu, 08 Apr 2010) New Revision: 435 Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.png trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.png trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf Modified: trunk/changelog.txt trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java trunk/wao-ui/src/main/webapp/SamplingPlan.tml trunk/wao-ui/src/main/webapp/css/sampling.css Log: Evo #2069 : reduce mode for admin on samplingPlan table Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2010-04-08 10:34:27 UTC (rev 434) +++ trunk/changelog.txt 2010-04-08 15:12:47 UTC (rev 435) @@ -9,6 +9,8 @@ Evolutions ++++++++++ +- [fdesbois] Evo #2069 : Role admin : Ajouter la visibilité réduite sur les + contacts et le plan d'échantillonnage - [fdesbois] Evo #2059 : Filtres sur tableau plan échantillonnage - [fdesbois] Evo #2241 : Revoir chargement des observateurs lorsqu'un utilisateur (observateur/coordinateur) est connecté Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-08 10:34:27 UTC (rev 434) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/SamplingPlan.java 2010-04-08 15:12:47 UTC (rev 435) @@ -108,6 +108,10 @@ // Initialize filters initSelectFilters(true, false, true); } + // Initialize fullView to true for admin user + if (fullView == null && user.isAdmin()) { + fullView = true; + } } /**************************** IMPORT (ADMIN) *******************************/ @@ -233,11 +237,26 @@ return this; } + /**************************** MAIN ACTIONS ********************************/ - /**************************** MAIN TABLE ***********************************/ + @Persist + @Property + private Boolean fullView; - /** ------------------------- DATA -------------------------------------- **/ + /** + * ACTION:: Used to change the display mode of the samplingPlan table. + * This change affect the loading of the css style over the main table. + * + * @see #getMainClass() + */ + void onActionFromToggleDisplayMode() { + fullView = !fullView; + } + /**************************** MAIN TABLE **********************************/ + + /** ------------------------- DATA ------------------------------------- **/ + /** * Main data for samplingPlan : List of SampleRow ordered by FishingZone. */ @@ -376,7 +395,7 @@ return NumberFormat.getNumberInstance(); } - /** ------------------------- HTML & STYLE ------------------------------ **/ + /** ------------------------- HTML & STYLE ----------------------------- **/ @Property private int rowIndex; @@ -391,7 +410,7 @@ public int getNbColumnsForProfession() { // code, program.name, fishingZone.districts, profession.code, profession.libelle int fixed = 5; - if (user.isAdmin()) { + if (fullView) { // company, program.periodBegin, program.periodEnd, fishingZonesInfos // profession.meshSize, profession.size, profession.other, profession.species fixed += 8; @@ -413,7 +432,7 @@ } public String getMainClass() { - return user.isAdmin() ? "admin" : "user"; + return fullView ? "admin" : "user"; } public String getParityClass() { @@ -421,7 +440,7 @@ } public String getActionsClass() { - return user.isAdmin() ? "width100" : "width30"; + return fullView ? "width100" : "width50"; } public String getRealTidesClass() { @@ -442,7 +461,7 @@ return new SimpleDateFormat("MM/yyyy"); } - /** ------------------------- ACTIONS ----------------------------------- **/ + /** ------------------------- ACTIONS ---------------------------------- **/ /** * Can edit the sampleRow. Only for admin with no readOnly rights. Modified: trunk/wao-ui/src/main/webapp/SamplingPlan.tml =================================================================== --- trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-04-08 10:34:27 UTC (rev 434) +++ trunk/wao-ui/src/main/webapp/SamplingPlan.tml 2010-04-08 15:12:47 UTC (rev 435) @@ -16,74 +16,88 @@ </div> </t:if> <div class="clearfix mbottom10"> - <div class="fleft"> - <h1> - Plan d'échantillonnage - <a t:type="actionlink" t:id="exportSamplingPlan"> - <img src="${asset:context:}/img/file-export-22px.png" alt="Export CSV" - title="Exporter le plan d'échantillonnage du ${dateFormat.format(period.fromDate)} au ${dateFormat.format(period.thruDate)}" /> - </a> - </h1> - <form t:type="form" t:id="periodForm" action="post"> - <div> - <t:label t:for="periodBegin" /> : - <input t:type="datefield" class="width70" t:id="periodBegin" t:value="period.fromDate" t:format="MM/yyyy" t:validate="required"/> - <t:label t:for="periodEnd" /> : - <input t:type="datefield" class="width70" t:id="periodEnd" t:value="period.thruDate" t:format="MM/yyyy" t:validate="required" /> - <input t:type="submit" class="ico search" value="Search" t:title="Affichage des lignes du plan couvertes par la période sélectionnée" /> - <a t:type="actionlink" t:id="showFilters" t:zone="so-sampling-filters" class="display-form">recherche avancée</a> - </div> - </form> - <div t:type="zone" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-sampling-filters"> - <fieldset> - <legend>Recherche avancée</legend> - <div class="so-filters-form"> - <form t:type="form" t:id="filtersForm" t:zone="so-sampling-filters" action="post"> - <t:errors /> - <div class="t-beaneditor"> - <div> - <t:if t:test="user.admin"> - <t:label t:for="company" />: - <input t:type="select" t:id="company" t:model="companySelectModel" value="companyId"/> - <input t:type="submit" class="ico22px refresh" t:id="refreshByCompany" value="Refresh" - title="Rafraîchir les filtres en fonction de la société sélectionnée"/> - </t:if> - <t:label t:for="programName" />: - <select t:type="select" t:id="programName" t:model="programSelectModel" t:value="filter.programName" /> - <t:label t:for="codeDCF5" />: - <input t:type="textfield" t:id="codeDCF5" value="filter.codeDCF5" t:mixins="Autocomplete"/> - </div> - <div> - <t:label t:for="facadeName" />: - <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" t:value="filter.facadeName" /> - <input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="Refresh" - title="Rafraîchir les zones et les métiers en fonction de la façade sélectionnée"/> - <t:label t:for="sectorName" />: - <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" t:value="filter.sectorName" /> - <input t:type="submit" class="ico22px refresh" t:id="refreshBySector" value="Refresh" - title="Rafraîchir les métiers en fonction de la zone sélectionnée"/> - <t:label t:for="sampleRow" />: - <input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" /> - </div> - <div class="t-beaneditor-row aright"> - <input t:type="submit" class="ico search-32px" t:id="search" value="Search" title="Rechercher les lignes du plan correspondants aux filtres saisies" /> - <input t:type="submit" class="ico undo" t:id="reset" value="Reset" title="Remettre les filtres par défaut" /> - </div> - </div> - </form> - </div> - </fieldset> - </div> - </div> - <t:if t:test="canEditSampleRow()"> - <div class="actions fright"> + <div class="clearfix"> + <h1 class="fleft">Plan d'échantillonnage</h1> + <div class="fleft actions-top"> <span> - <a t:type="pagelink" t:page="sampleRowForm"> - <img src="${asset:context:}/img/add-32px.png" alt="Ajouter" title="Ajouter une nouvelle ligne"/> - </a> + <a t:type="actionlink" t:id="exportSamplingPlan"> + <img src="${asset:context:}/img/file-export-22px.png" alt="Export CSV" + title="Exporter le plan d'échantillonnage du ${dateFormat.format(period.fromDate)} au ${dateFormat.format(period.thruDate)}" /> + </a> </span> + <t:if t:test="user.admin"> + <span> + <a t:type="actionlink" t:id="toggleDisplayMode"> + <t:if t:test="fullView"> + <img src="${asset:context:}/img/samplingPlan-reduce.png" alt="Réduire" + title="Réduire le plan d'échantillonnage"/> + <p:else> + <img src="${asset:context:}/img/samplingPlan-full.png" alt="Agrandir" + title="Agrandir le plan d'échantillonnage"/> + </p:else> + </t:if> + </a> + </span> + <t:if t:test="canEditSampleRow()"> + <span> + <a t:type="pagelink" t:page="sampleRowForm"> + <img src="${asset:context:}/img/add.png" alt="Ajouter" title="Ajouter une nouvelle ligne"/> + </a> + </span> + </t:if> + </t:if> </div> - </t:if> + </div> + <form t:type="form" t:id="periodForm" action="post"> + <div> + <t:label t:for="periodBegin" /> : + <input t:type="datefield" class="width70" t:id="periodBegin" t:value="period.fromDate" t:format="MM/yyyy" t:validate="required"/> + <t:label t:for="periodEnd" /> : + <input t:type="datefield" class="width70" t:id="periodEnd" t:value="period.thruDate" t:format="MM/yyyy" t:validate="required" /> + <input t:type="submit" class="ico search" value="Search" t:title="Affichage des lignes du plan couvertes par la période sélectionnée" /> + <a t:type="actionlink" t:id="showFilters" t:zone="so-sampling-filters" class="display-form">recherche avancée</a> + </div> + </form> + <div t:type="zone" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-sampling-filters"> + <fieldset> + <legend>Recherche avancée</legend> + <div class="so-filters-form"> + <form t:type="form" t:id="filtersForm" t:zone="so-sampling-filters" action="post"> + <t:errors /> + <div class="t-beaneditor"> + <div> + <t:if t:test="user.admin"> + <t:label t:for="company" />: + <input t:type="select" t:id="company" t:model="companySelectModel" value="companyId"/> + <input t:type="submit" class="ico22px refresh" t:id="refreshByCompany" value="Refresh" + title="Rafraîchir les filtres en fonction de la société sélectionnée"/> + </t:if> + <t:label t:for="programName" />: + <select t:type="select" t:id="programName" t:model="programSelectModel" t:value="filter.programName" /> + <t:label t:for="codeDCF5" />: + <input t:type="textfield" t:id="codeDCF5" value="filter.codeDCF5" t:mixins="Autocomplete"/> + </div> + <div> + <t:label t:for="facadeName" />: + <select t:type="select" t:id="facadeName" t:model="facadeSelectModel" t:value="filter.facadeName" /> + <input t:type="submit" class="ico22px refresh" t:id="refreshByFacade" value="Refresh" + title="Rafraîchir les zones et les métiers en fonction de la façade sélectionnée"/> + <t:label t:for="sectorName" />: + <select t:type="select" t:id="sectorName" t:model="sectorSelectModel" t:value="filter.sectorName" /> + <input t:type="submit" class="ico22px refresh" t:id="refreshBySector" value="Refresh" + title="Rafraîchir les métiers en fonction de la zone sélectionnée"/> + <t:label t:for="sampleRow" />: + <input t:type="select" t:id="sampleRow" t:model="sampleRowSelectModel" value="sampleRowId" /> + </div> + <div class="t-beaneditor-row aright"> + <input t:type="submit" class="ico search-32px" t:id="search" value="Search" title="Rechercher les lignes du plan correspondants aux filtres saisies" /> + <input t:type="submit" class="ico undo" t:id="reset" value="Reset" title="Remettre les filtres par défaut" /> + </div> + </div> + </form> + </div> + </fieldset> + </div> </div> <t:zone t:id="samplingZone"> <table class="t-data-grid"> @@ -96,11 +110,11 @@ <tr> <td class="bleft">Code ligne</td> <td class="width150">Programme ou règlement rattachement</td> - <t:if t:test="user.admin"> + <t:if t:test="fullView"> <td>Société</td> </t:if> <td>Zone</td> - <t:if t:test="user.admin"> + <t:if t:test="fullView"> <td>Zone de pêche info</td> <td>METIER<br />Code DCF5</td> <td>METIER<br />Maillage</td> @@ -152,10 +166,10 @@ </a> </td> <td class="width150">${row.programName}</td> - <t:if t:test="user.admin"> + <t:if t:test="fullView"> <td>${companyName}</td> </t:if> - <t:if t:test="user.admin"> + <t:if t:test="fullView"> <td>${fishingZones}</td> <td>${row.fishingZonesInfos}</td> <td>${row.profession.codeDCF5}</td> Modified: trunk/wao-ui/src/main/webapp/css/sampling.css =================================================================== --- trunk/wao-ui/src/main/webapp/css/sampling.css 2010-04-08 10:34:27 UTC (rev 434) +++ trunk/wao-ui/src/main/webapp/css/sampling.css 2010-04-08 15:12:47 UTC (rev 435) @@ -29,11 +29,21 @@ width: 40%; } +div#so-sampling h1 { + padding-bottom: 5px; + padding-right: 5px; +} + +div#so-sampling div.actions-top { + margin-bottom: 10px; +} + div#so-sampling-filters div.t-beaneditor div { margin-top: 5px; } div#so-sampling-filters fieldset { + margin-top: 5px; padding: 5px; } Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.png =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.png =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream
participants (1)
-
fdesbois@users.labs.libre-entreprise.org