[Suiviobsmer-commits] r436 - in trunk/wao-ui/src/main: java/fr/ifremer/wao/ui/pages webapp webapp/img webapp/img/source
Author: fdesbois Date: 2010-04-08 16:07:20 +0000 (Thu, 08 Apr 2010) New Revision: 436 Added: trunk/wao-ui/src/main/webapp/img/contacts-full.png trunk/wao-ui/src/main/webapp/img/contacts-reduce.png trunk/wao-ui/src/main/webapp/img/source/ trunk/wao-ui/src/main/webapp/img/source/contacts-full.xcf trunk/wao-ui/src/main/webapp/img/source/contacts-reduce.xcf trunk/wao-ui/src/main/webapp/img/source/contacts-table.png trunk/wao-ui/src/main/webapp/img/source/samplingPlan-full.xcf trunk/wao-ui/src/main/webapp/img/source/samplingPlan-reduce.xcf Removed: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java trunk/wao-ui/src/main/webapp/Contacts.tml Log: Evo #2069 : reduce mode for admin on contacts table Modified: trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java =================================================================== --- trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-04-08 15:12:47 UTC (rev 435) +++ trunk/wao-ui/src/main/java/fr/ifremer/wao/ui/pages/Contacts.java 2010-04-08 16:07:20 UTC (rev 436) @@ -117,23 +117,21 @@ @Inject private ServiceBoat serviceBoat; -// @Persist(PersistenceConstants.FLASH) -// private String contactEditedId; - @Log void setupRender() throws WaoException { -// if (contactEdited == null) { - if (log.isDebugEnabled()) { - log.debug("RESET DATA"); - } - if (isFiltersVisible()) { - // Initialize filters - initSelectFilters(true, false, true); - } - contacts = null; - getContacts(); -// } + if (log.isDebugEnabled()) { + log.debug("RESET DATA"); + } + contacts = null; contactsForm.clearErrors(); + // Initialize filters if needed + if (isFiltersVisible()) { + initSelectFilters(true, false, true); + } + // Initialize fullView to true for amdmin user + if (fullView == null && user.isAdmin()) { + fullView = true; + } } /**************************** CONTACT FILTERS *****************************/ @@ -267,6 +265,22 @@ return null; } + /**************************** CONTACT DISPLAY MODE ************************/ + + @Persist + @Property + private Boolean fullView; + + /** + * ACTION:: Used to change the display mode of the contacts table. + * This change affect the loading of the css style over the main table. + * + * @see #getGridClass() + */ + void onActionFromToggleDisplayMode() { + fullView = !fullView; + } + /**************************** CONTACT LIST ********************************/ @Inject @@ -303,8 +317,8 @@ public ContactDataSource getContacts() throws WaoException { if (contacts == null) { - if (log.isInfoEnabled()) { - log.info("Create DataSource"); + if (log.isDebugEnabled()) { + log.debug("Create DataSource"); } contacts = new ContactDataSource(getContactFilter(), serviceContact); } @@ -313,7 +327,7 @@ public BeanModel<Contact> getContactModel() { if (contactModel == null) { - contactModel = user.isAdmin() ? + contactModel = fullView ? contactModelFactory.buildAdminContactModel(beanModelSource, resources) : contactModelFactory.buildContactModel(beanModelSource, resources); } @@ -360,7 +374,7 @@ } public String getGridClass() { - return user.isAdmin() ? "admin" : "user"; + return fullView ? "admin" : "user"; } public String getRowClass() { Modified: trunk/wao-ui/src/main/webapp/Contacts.tml =================================================================== --- trunk/wao-ui/src/main/webapp/Contacts.tml 2010-04-08 15:12:47 UTC (rev 435) +++ trunk/wao-ui/src/main/webapp/Contacts.tml 2010-04-08 16:07:20 UTC (rev 436) @@ -19,6 +19,17 @@ import/export </a> </t:if> + <t:if t:test="user.admin"> + + <a t:type="actionlink" t:id="toggleDisplayMode" class="display-form"> + <t:if t:test="fullView"> + réduire la vue + <p:else> + agrandir la vue + </p:else> + </t:if> + </a> + </t:if> </div> <!-- FILTRES --> <div t:type="zone" class="so-filters" t:id="filtersZone" t:visible="prop:filtersVisible" id="so-contacts-filters"> Added: trunk/wao-ui/src/main/webapp/img/contacts-full.png =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/contacts-full.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/contacts-reduce.png =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/contacts-reduce.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/wao-ui/src/main/webapp/img/samplingPlan-full.xcf =================================================================== (Binary files differ) Deleted: trunk/wao-ui/src/main/webapp/img/samplingPlan-reduce.xcf =================================================================== (Binary files differ) Added: trunk/wao-ui/src/main/webapp/img/source/contacts-full.xcf =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/source/contacts-full.xcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/source/contacts-reduce.xcf =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/source/contacts-reduce.xcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/source/contacts-table.png =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/source/contacts-table.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-full.xcf =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-full.xcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-reduce.xcf =================================================================== (Binary files differ) Property changes on: trunk/wao-ui/src/main/webapp/img/source/samplingPlan-reduce.xcf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream
participants (1)
-
fdesbois@users.labs.libre-entreprise.org