This is an automated email from the git hooks/post-receive script. New commit to branch feature/6575 in repository tutti. See http://git.codelutin.com/tutti.git commit 0a0144160f2afdf4faef3d6c780dbb571f951dc5 Author: Kevin Morin <morin@codelutin.com> Date: Fri Feb 6 17:50:15 2015 +0100 mise en page du pdf --- .../resources/ftl/toConfirmSpeciesReport_fr.ftl | 102 ++++++++++++++------- .../SpeciesToConfirmReportForCruiseAction.java | 8 +- .../resources/i18n/tutti-ui-swing_en_GB.properties | 1 + .../resources/i18n/tutti-ui-swing_fr_FR.properties | 1 + 4 files changed, 78 insertions(+), 34 deletions(-) diff --git a/tutti-service/src/main/resources/ftl/toConfirmSpeciesReport_fr.ftl b/tutti-service/src/main/resources/ftl/toConfirmSpeciesReport_fr.ftl index 409276c..6899217 100644 --- a/tutti-service/src/main/resources/ftl/toConfirmSpeciesReport_fr.ftl +++ b/tutti-service/src/main/resources/ftl/toConfirmSpeciesReport_fr.ftl @@ -26,6 +26,7 @@ <style type="text/css"> <#assign blueColor="#000080"> + <#assign lightGrayColor="#f2f2f2"> @page { size: A4 landscape;} @@ -35,25 +36,60 @@ font-style: italic; } + h2 { + margin-bottom: 50pt; + } + table { + margin-bottom: 25pt; border-collapse: collapse; } th { color: ${blueColor}; font-weight: bold; + background: ${lightGrayColor}; } td, th { - padding-right: 10pt; - border-left: 1px solid black; - border-right: 1px solid black; + padding: 1pt 5pt; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + } + + tbody tr:nth-child(even) { + background: ${lightGrayColor}; + } + tbody tr:nth-child(odd) { + background: #fff; } td.number { text-align: right; } + .species { + width: 10%; + } + .scientificName { + width: 18%; + } + .vernacular { + width: 17%; + } + .category { + width: 15%; + } + .categoryWeight { + width: 10%; + } + .weight { + width: 10%; + } + .comment { + width: 20%; + } + .operationInfo { font-weight: bold; } @@ -86,29 +122,29 @@ </p> <#if operation.speciesCatches??> + <h3>Espèces</h3> <table> - <caption>Espèces</caption> <thead> <tr> - <th>Espèce</th> - <th>Nom scientifique</th> - <th>Nom commun</th> - <th>Catégorie</th> - <th>Poids (${speciesWeightUnit.shortLabel})</th> - <th>Poids sous-échantilloné (${speciesWeightUnit.shortLabel})</th> - <th>Commentaire</th> + <th class="species">Espèce</th> + <th class="scientificName">Nom scientifique</th> + <th class="vernacular">Nom commun</th> + <th class="category">Catégorie</th> + <th class="categoryWeight">Poids (${speciesWeightUnit.shortLabel})</th> + <th class="weight">Poids sous échantilloné (${speciesWeightUnit.shortLabel})</th> + <th class="comment">Commentaire</th> </tr> </thead> <tbody> <#list operation.speciesCatches as catch> <tr> - <td><#if catch.code??>${catch.code}</#if></td> - <td><em>${catch.scientificName}</em></td> - <td><#if catch.vernacularCode??>${catch.vernacularCode}</#if></td> - <td>${catch.category}</td> - <td class="number">${catch.categoryWeight}</td> - <td class="number">${catch.weight}</td> - <td><#if catch.comment??>${catch.comment?html}</#if></td> + <td class="species"><#if catch.code??>${catch.code}</#if></td> + <td class="scientificName"><em>${catch.scientificName}</em></td> + <td class="vernacular"><#if catch.vernacularCode??>${catch.vernacularCode}</#if></td> + <td class="category">${catch.category}</td> + <td class="number categoryWeight">${catch.categoryWeight}</td> + <td class="number weight">${catch.weight}</td> + <td class="comment"><#if catch.comment??>${catch.comment?html}</#if></td> </tr> </#list> </tbody> @@ -116,29 +152,29 @@ </#if> <#if operation.benthosCatches??> + <h3>Benthos</h3> <table> - <caption>Benthos</caption> <thead> <tr> - <th>Espèce</th> - <th>Nom scientifique</th> - <th>Nom commun</th> - <th>Catégorie</th> - <th>Poids (${benthosWeightUnit.shortLabel})</th> - <th>Poids sous-échantilloné (${benthosWeightUnit.shortLabel})</th> - <th>Commentaire</th> + <th class="species">Espèce</th> + <th class="scientificName">Nom scientifique</th> + <th class="vernacular">Nom commun</th> + <th class="category">Catégorie</th> + <th class="categoryWeight">Poids (${benthosWeightUnit.shortLabel})</th> + <th class="weight">Poids sous échantilloné (${benthosWeightUnit.shortLabel})</th> + <th class="comment">Commentaire</th> </tr> </thead> <tbody> <#list operation.benthosCatches as catch> <tr> - <td><#if catch.code??>${catch.code}</#if></td> - <td><em>${catch.scientificName}</em></td> - <td><#if catch.vernacularCode??>${catch.vernacularCode}</#if></td> - <td>${catch.category}</td> - <td class="number">${catch.categoryWeight}</td> - <td class="number">${catch.weight}</td> - <td><#if catch.comment??>${catch.comment?html}</#if></td> + <td class="species"><#if catch.code??>${catch.code}</#if></td> + <td class="scientificName"><em>${catch.scientificName}</em></td> + <td class="vernacular"><#if catch.vernacularCode??>${catch.vernacularCode}</#if></td> + <td class="category">${catch.category}</td> + <td class="number categoryWeight">${catch.categoryWeight}</td> + <td class="number weight">${catch.weight}</td> + <td class="comment"><#if catch.comment??>${catch.comment?html}</#if></td> </tr> </#list> </tbody> diff --git a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/SpeciesToConfirmReportForCruiseAction.java b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/SpeciesToConfirmReportForCruiseAction.java index f127046..7f5812a 100644 --- a/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/SpeciesToConfirmReportForCruiseAction.java +++ b/tutti-ui-swing/src/main/java/fr/ifremer/tutti/ui/swing/action/SpeciesToConfirmReportForCruiseAction.java @@ -30,6 +30,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import java.io.File; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; import static org.nuiton.i18n.I18n.t; @@ -45,6 +48,8 @@ public class SpeciesToConfirmReportForCruiseAction extends AbstractMainUITuttiAc private static final Log log = LogFactory.getLog(SpeciesToConfirmReportForCruiseAction.class); + public static final DateFormat df = new SimpleDateFormat("yyyyMMddHHmm"); + protected File file; public SpeciesToConfirmReportForCruiseAction(MainUIHandler handler) { @@ -60,8 +65,9 @@ public class SpeciesToConfirmReportForCruiseAction extends AbstractMainUITuttiAc Cruise cruise = getDataContext().getCruise(); // choose file to export + String now = df.format(new Date()); file = saveFile( - "toConfirm-" + cruise.getName(), + t("tutti.speciesToConfirmReport.fileName.default", cruise.getName(), now), "pdf", t("tutti.speciesToConfirmReport.title.choose.exportFile"), t("tutti.speciesToConfirmReport.action.chooseFile"), diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties index a236f1f..a48299d 100644 --- a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties +++ b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_en_GB.properties @@ -1815,6 +1815,7 @@ tutti.species.name.tip= tutti.species.refTaxCode.tip= tutti.species.surveyCode.tip= tutti.speciesToConfirmReport.action.chooseFile= +tutti.speciesToConfirmReport.fileName.default= tutti.speciesToConfirmReport.title.choose.exportFile= tutti.splitBenthosBatch.action.cancel= tutti.splitBenthosBatch.action.cancel.mnemonic= diff --git a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties index 686646d..31f0931 100644 --- a/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties +++ b/tutti-ui-swing/src/main/resources/i18n/tutti-ui-swing_fr_FR.properties @@ -1715,6 +1715,7 @@ tutti.species.name.tip=Nom scientifique tutti.species.refTaxCode.tip=Code Rubin tutti.species.surveyCode.tip=Code campagne ou code rubin tutti.speciesToConfirmReport.action.chooseFile=Choisir le fichier de rapport +tutti.speciesToConfirmReport.fileName.default=Especes_a_confirmer_%1$s_%2$s tutti.speciesToConfirmReport.title.choose.exportFile=Rapport des espèces à confirmer tutti.splitBenthosBatch.action.cancel=Annuler tutti.splitBenthosBatch.action.cancel.mnemonic=A -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.