Author: bleny Date: 2014-04-03 16:59:23 +0200 (Thu, 03 Apr 2014) New Revision: 1822 Url: http://forge.codelutin.com/projects/wao/repository/revisions/1822 Log: refs #4490 some style for boat-list Modified: trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp trunk/wao-web/src/main/webapp/wao.css Modified: trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties =================================================================== --- trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties 2014-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_en_GB.properties 2014-04-03 14:59:23 UTC (rev 1822) @@ -138,8 +138,8 @@ fr.ifremer.wao.entity.TerrestrialDivision=Terrestrial divisions fr.ifremer.wao.entity.TerrestrialLocation=Terrestrial locations wao.business.other= -wao.time.formatter=%1$tH:%1$tM -wao.datetime.formatter=%1$td-%1$tm/%1$tY %1$tH:%1$tM wao.date.formatter=%1$td-%1$tm/%1$tY +wao.datetime.formatter=%1$td-%1$tm/%1$tY %1$tH\:%1$tM wao.month.formatter=%1$tm-%1$tY wao.month.pattern=MM-yyyy +wao.time.formatter=%1$tH\:%1$tM Modified: trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties =================================================================== --- trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties 2014-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-persistence/src/main/resources/i18n/wao-persistence_fr_FR.properties 2014-04-03 14:59:23 UTC (rev 1822) @@ -137,8 +137,8 @@ fr.ifremer.wao.entity.TerrestrialDivision=Stratification géographique fr.ifremer.wao.entity.TerrestrialLocation=Lieux terrestres wao.business.other= -wao.time.formatter=%1$tH:%1$tM -wao.datetime.formatter=%1$td/%1$tm/%1$tY %1$tH:%1$tM wao.date.formatter=%1$td/%1$tm/%1$tY +wao.datetime.formatter=%1$td/%1$tm/%1$tY %1$tH\:%1$tM wao.month.formatter=%1$tm/%1$tY wao.month.pattern=MM/yyyy +wao.time.formatter=%1$tH\:%1$tM 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-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-services/src/main/java/fr/ifremer/wao/services/AuthenticatedWaoUser.java 2014-04-03 14:59:23 UTC (rev 1822) @@ -200,9 +200,16 @@ return ! userProfile.isCoordinatorOrObserver(); } + public boolean isAuthorizedToViewBoatDetails() { + boolean authorizedToViewBoatDetails = userProfile.isAdmin() + || userProfile.isCoordinatorOrObserver(); + return authorizedToViewBoatDetails; + } + public boolean isAuthorizedToViewBoatDetails(String companyId) { boolean authorizedToViewBoatDetails = userProfile.isAdmin() || userProfile.isCoordinatorOrObserver() && waoUser.getCompany().getTopiaId().equals(companyId); return authorizedToViewBoatDetails; } + } Modified: trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties =================================================================== --- trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-web/src/main/resources/i18n/wao-web_en_GB.properties 2014-04-03 14:59:23 UTC (rev 1822) @@ -32,6 +32,7 @@ wao.ui.action.createSampleRow=Add a sample row to the plan wao.ui.action.createWaoUser=Create a user wao.ui.action.csvExport=Export as CSV +wao.ui.action.csvImport=Import wao.ui.action.delete=Delete wao.ui.action.deleteCompany=Delete company wao.ui.action.deleteCompany.confirm=Are you sure you want to delete this company ? @@ -113,6 +114,7 @@ wao.ui.contacts.createFromBoat=Create a new contact for this boat and this sample row wao.ui.contacts.createFromBoat.fail=Contact creation failed wao.ui.contacts.createFromBoat.warn=Warning \:this sample-row is out of date, are your sure you want to create a new contact ? +wao.ui.contacts.title=%s contacts trouvés wao.ui.disclaimer=The website "SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER" is declared to the CNIL with the number \: 1414476 wao.ui.disclaimer.boats=Data your provide remains property of your company.Outside your company, only an administrator may access to your data for maintenance purpose. The administrator is someone from Ifremer. wao.ui.email=e-mail address @@ -149,6 +151,7 @@ wao.ui.field.Contact.beginDate=Observation start wao.ui.field.Contact.comment=Observer comment wao.ui.field.Contact.commentAdmin=Program comment +wao.ui.field.Contact.commentCompany=Company Comment wao.ui.field.Contact.commentCoordinator=Coordinator comment wao.ui.field.Contact.completeSampling=Complete sampling wao.ui.field.Contact.contactState=Contact state @@ -395,7 +398,6 @@ wao.ui.page.Index.title=Home wao.ui.page.ReferentialManagement.title=Referentials management wao.ui.page.SamplingPlan.title=Sampling plan -wao.ui.field.Contact.commentCompany=Company Comment wao.ui.page.Synthesis.title=Synthesis wao.ui.page.UserProfileForm.title=Profile management wao.ui.page.companies.title=Companies @@ -468,5 +470,3 @@ wao.ui.userList=Users list wao.ui.userMustAcceptCgu=You must accept the terms of use wao.ui.validLogin=Valid identifier -wao.ui.action.csvImport=Import -wao.ui.contacts.title=%s contacts trouvés Modified: trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties =================================================================== --- trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-web/src/main/resources/i18n/wao-web_fr_FR.properties 2014-04-03 14:59:23 UTC (rev 1822) @@ -32,6 +32,7 @@ wao.ui.action.createSampleRow=Ajouter une ligne au plan wao.ui.action.createWaoUser=Créer un utilisateur wao.ui.action.csvExport=Exporter au format CSV +wao.ui.action.csvImport=Import wao.ui.action.delete=Supprimer wao.ui.action.deleteCompany=Supprimer la société wao.ui.action.deleteCompany.confirm=Êtes-vous sûr de vouloir supprimer la société ? @@ -92,7 +93,7 @@ wao.ui.boats.boatLength=Longueur wao.ui.boats.boatName=Nom wao.ui.boats.buildYear=Année de construction -wao.ui.boats.district=Quatier maritime +wao.ui.boats.district=Quartier maritime wao.ui.boats.nbObservations=%s observation(s) dont %s avec votre société wao.ui.boats.portOfRegistry=Port wao.ui.boats.portOfRegistry.description=Il s'agit du port d'exploitation principal du navire @@ -113,6 +114,7 @@ wao.ui.contacts.createFromBoat=Créer un nouveau contact pour ce navire et cette ligne du plan wao.ui.contacts.createFromBoat.fail=Création d'un nouveau contact impossible wao.ui.contacts.createFromBoat.warn=Attention \: cette ligne du plan est arrivée à échéance, êtes-vous sûr de vouloir créer un nouveau contact ? +wao.ui.contacts.title=%s contacts trouvés wao.ui.disclaimer=Le site de « SUIVI DU REALISE DU PLAN D'ECHANTILLONNAGE DES OBSERVATIONS A LA MER » a fait l'objet d'une déclaration à la CNIL sous le numéro suivant \: 1414476 wao.ui.disclaimer.boats=Les données saisies dans cette page sont la propriété exclusive de la société. En dehors de la société, seul l'administrateur peut les consulter pour des questions de maintenance sur le site. L'administrateur est une personne de l'Ifremer. wao.ui.email=Adresse e-mail @@ -468,5 +470,3 @@ wao.ui.userList=Liste des utilisateurs wao.ui.userMustAcceptCgu=Vous devez accepter les conditions d'utilisation pour utiliser Wao wao.ui.validLogin=Identifiant valide -wao.ui.action.csvImport=Import -wao.ui.contacts.title=%s contacts trouvés Modified: trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp =================================================================== --- trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-web/src/main/webapp/WEB-INF/content/obsmer/boats.jsp 2014-04-03 14:59:23 UTC (rev 1822) @@ -40,6 +40,8 @@ var url = $(this).prop('href'); var successCallback = function (data) { $('#boat-details').html(data); + $('tr.boat-row').removeClass('highlight'); + $('#').addClass('highlight'); } WAO.get(url, {}, successCallback); }); @@ -193,17 +195,17 @@ </s:if> </ul> </div> -<table id="boats-list" class="large-table boats-list"> +<table id="boats-list" class="table-condensed table-striped table-hover"> <thead> <tr> <th> - <s:text name="wao.ui.boats.boatName"/> + <s:text name="wao.ui.boats.registrationCode"/> </th> <th> - <s:text name="wao.ui.boats.registrationCode"/> + <s:text name="wao.ui.boats.boatName"/> </th> <th> - <s:text name="wao.ui.boats.boatLength"/> + <s:text name="wao.ui.boats.boatLength"/> (m) </th> <th> <s:text name="wao.ui.boats.buildYear"/> @@ -212,7 +214,9 @@ <s:text name="wao.ui.boats.district"/> </th> <th> - <s:text name="wao.ui.boats.portOfRegistry"/>(<s:text name="wao.ui.boats.portOfRegistry.description"/>) + <span data-original-title="<s:text name="wao.ui.boats.portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom"> + <s:text name="wao.ui.boats.portOfRegistry"/> + </span> </th> </tr> </thead> @@ -220,24 +224,30 @@ <s:iterator value="boats" var="boat"> <tr class="boat-row<s:if test="!active"> inactive</s:if>"> - <td> - <s:url action="boat-details" id="boatDetailsUrl"> - <s:param name="companyId" value="authenticatedWaoUser.waoUser.company.topiaId" /> - <s:param name="boatId" value="topiaId" /> - <s:param name="fragment" value="true" /> - </s:url> - <s:a href="%{boatDetailsUrl}" cssClass="boat-details-action"> - <s:property value="name"/> - </s:a> + <td id="<s:property value="topiaId"/>"> + <s:if test="authenticatedWaoUser.authorizedToViewBoatDetails"> + <s:url action="boat-details" id="boatDetailsUrl"> + <s:param name="companyId" value="authenticatedWaoUser.waoUser.company.topiaId" /> + <s:param name="boatId" value="topiaId" /> + <s:param name="fragment" value="true" /> + </s:url> + <s:a href="%{boatDetailsUrl}" cssClass="boat-details-action"> + <s:property value="%{'' + immatriculation}"/> + </s:a> + </s:if> + <s:else> + <s:property value="%{'' + immatriculation}"/> + </s:else> </td> - <td><s:property value="%{'' + immatriculation}"/></td> - <td><s:property value="boatLength"/> m</td> + <td><s:property value="name"/></td> + <td><s:property value="boatLength"/></td> <td><s:property value="%{'' + buildYear}"/></td> <td><s:property value="district.districtCode"/></td> <td> <s:if test="portOfRegistry != null"> - <s:property value="portOfRegistry.portCode"/> - (<s:property value="portOfRegistry.description"/>) + <span data-original-title="<s:property value="portOfRegistry.description"/>" data-toggle="tooltip" data-placement="bottom"> + <s:property value="portOfRegistry.portCode"/> + </span> </s:if> </td> </tr> Modified: trunk/wao-web/src/main/webapp/wao.css =================================================================== --- trunk/wao-web/src/main/webapp/wao.css 2014-04-03 14:29:21 UTC (rev 1821) +++ trunk/wao-web/src/main/webapp/wao.css 2014-04-03 14:59:23 UTC (rev 1822) @@ -267,3 +267,13 @@ float: left; } +#boats-list th, #boats-list td { + text-align: right; + width: 30px; +} + +/** La colonne pour le nom de navire peut être plus large ques les autres */ +#boats-list th:nth-child(2), #boats-list td:nth-child(2) { + text-align: left; + width: 200px; +}