diff --git a/src/app/components/calculator-list/calculator-list.component.html b/src/app/components/calculator-list/calculator-list.component.html index 25c88f0250120f157df3e2ea882db154a79ebfe2..2f9231bab1b7b065346c775e5bcf731a4d7e7a30 100644 --- a/src/app/components/calculator-list/calculator-list.component.html +++ b/src/app/components/calculator-list/calculator-list.component.html @@ -1,5 +1,28 @@ <div class="container" fxLayout="row wrap" fxLayoutAlign="space-evenly stretch"> + <mat-card class="welcome-card" *ngIf="nbOpenCalculators === 0"> + + <mat-card-header> + <!-- <img mat-card-avatar src="https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/water-wave.png"> --> + <mat-card-title>{{ uitextWelcomeTitle }}</mat-card-title> + <mat-card-subtitle>{{ uitextWelcomeSubtitle }}</mat-card-subtitle> + </mat-card-header> + + <mat-card-content [innerHTML]="uitextWelcomeContent"> + </mat-card-content> + + <img mat-card-image src="../../assets/images/logo_irstea_m.jpg"> + + <img mat-card-image src="../../assets/images/logo_afb_m.jpg"> + + <mat-card-actions> + <div class="container" fxLayout="column" fxLayoutAlign="left" fxLayoutGap="10px"> + <button mat-raised-button color="accent" class="theme-calculator"></button> + </div> + </mat-card-actions> + + </mat-card> + <mat-card *ngFor="let theme of items" class="compute-nodes-theme"> <mat-card-header> diff --git a/src/app/components/calculator-list/calculator-list.component.scss b/src/app/components/calculator-list/calculator-list.component.scss index 460061c0f0be33188214acbe517642f587a8193b..c0edcccd75f8157f974a705fff9f705f7b918976 100644 --- a/src/app/components/calculator-list/calculator-list.component.scss +++ b/src/app/components/calculator-list/calculator-list.component.scss @@ -1,4 +1,4 @@ -mat-card.compute-nodes-theme { +mat-card.compute-nodes-theme, mat-card.welcome-card { width: 300px; margin: 1em; @@ -47,3 +47,10 @@ mat-card.compute-nodes-theme { } } } + +mat-card.welcome-card { + + .mat-card-content { + line-height: 1.4em; + } +} diff --git a/src/app/components/calculator-list/calculator-list.component.ts b/src/app/components/calculator-list/calculator-list.component.ts index b2c4cdb661c1cf884cda3d1c25631f322424d065..1e13c7ec4e540702e843a53c497fb4531de823a9 100644 --- a/src/app/components/calculator-list/calculator-list.component.ts +++ b/src/app/components/calculator-list/calculator-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { Router } from "@angular/router"; -import { CalculatorType, EnumEx } from "jalhyd"; +import { CalculatorType, EnumEx, Session } from "jalhyd"; import { FormulaireDefinition } from "../../formulaire/definition/form-definition"; import { ServiceFactory } from "../../services/service-factory"; @@ -108,10 +108,26 @@ export class CalculatorListComponent implements OnInit { }); } + public get nbOpenCalculators() { + return Session.getInstance().getNumberOfNubs(); + } + public get items() { return this._items; } + public get uitextWelcomeTitle() { + return "Cassiopée"; + } + + public get uitextWelcomeSubtitle() { + return ServiceFactory.instance.i18nService.localizeText("INFO_WELCOME_SUBTITLE"); + } + + public get uitextWelcomeContent() { + return ServiceFactory.instance.i18nService.localizeText("INFO_WELCOME_CONTENT"); + } + // interface Observer update(sender: any, data: any): void { diff --git a/src/assets/images/logo_afb_m.jpg b/src/assets/images/logo_afb_m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9c85a0b09163911cf49b2943941d0ba0a637fa90 Binary files /dev/null and b/src/assets/images/logo_afb_m.jpg differ diff --git a/src/assets/images/logo_irstea_m.jpg b/src/assets/images/logo_irstea_m.jpg new file mode 100644 index 0000000000000000000000000000000000000000..dafe45d15da77d93d3cb3c6f317c9cc5de6440f7 Binary files /dev/null and b/src/assets/images/logo_irstea_m.jpg differ diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 76628a0959dbe756eb29bf76873573097ea8288e..c1d177f0d62d7a4037c4c3ecf2607e46ca4e4687 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -212,6 +212,7 @@ "INFO_REQUIRES": "requires", "INFO_SECTIONPARAMETREE_TITRE": "Parametric section", "INFO_SECTIONPARAMETREE_TITRE_COURT": "Param. section", + "INFO_SETUP_LANGUAGE": "Language", "INFO_SETUP_NEWTON_MAX_ITER": "Newton iteration limit", "INFO_SETUP_PRECISION_AFFICHAGE": "Display accuracy", "INFO_SETUP_PRECISION_CALCUL": "Computation accuracy", @@ -233,6 +234,8 @@ "INFO_THEME_HYDRAULIQUE_EN_CHARGE_DESCRIPTION": "Modules for calculating head losses in pressure pipes", "INFO_THEME_LOIS_D_OUVRAGES_TITRE": "Hydraulic structures", "INFO_THEME_LOIS_D_OUVRAGES_DESCRIPTION": "Flow calculation for hydraulic devices (gates, weir, orifices)", + "INFO_WELCOME_SUBTITLE": "Hydraulic calculators", + "INFO_WELCOME_CONTENT": "<p>The Cassiopée software was developed by <a href=\"https://www.afbiodiversite.fr\">AFB</a> (French Agency for Biodiversity) and <a href=\"https://www.irstea.fr/en\">Irstea</a> (National Institute for Environmental and Agricultural Science and Research).</p><p>It includes tools for designing fish passes, and hydraulic calculation tools useful for environmental and agricultural engineering.</p><p>For more information, consult <a href=\"assets/docs-fr/mentions_legales\">legal notice</a> and <a href=\"assets/docs-fr\">documentation</a>.</p>", "WARNING_REMOUS_ARRET_CRITIQUE": "Calculation stopped: critical elevation reached at abscissa %x%", "WARNING_STRUCTUREKIVI_HP_TROP_ELEVE": "h/p must not be greater than 2.5. h/p is forced to 2.5", "WARNING_STRUCTUREKIVI_PELLE_TROP_FAIBLE": "Threshold height should be greater than 0.1 m. Beta coefficient is forced to 0" diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 4a03ee1641ffcf2465629a1e8f96a6490a09572d..6a1b4efdb50f35e1e8fd734a169213c59c52ea52 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -212,6 +212,7 @@ "INFO_REQUIRES": "dépend de", "INFO_SECTIONPARAMETREE_TITRE": "Section paramétrée", "INFO_SECTIONPARAMETREE_TITRE_COURT": "Sec. param.", + "INFO_SETUP_LANGUAGE": "Langue", "INFO_SETUP_NEWTON_MAX_ITER": "Newton : nombre d'itérations maximum", "INFO_SETUP_PRECISION_AFFICHAGE": "Précision d'affichage", "INFO_SETUP_PRECISION_CALCUL": "Précision de calcul", @@ -233,6 +234,8 @@ "INFO_THEME_HYDRAULIQUE_EN_CHARGE_DESCRIPTION": "Modules de calcul de perte de charge dans les conduites sous pression", "INFO_THEME_LOIS_D_OUVRAGES_TITRE": "Lois d'ouvrages", "INFO_THEME_LOIS_D_OUVRAGES_DESCRIPTION": "Calculs basés sur les lois de débits d'ouvrages hydrauliques (Vannes, seuils, orifices)", + "INFO_WELCOME_SUBTITLE": "Modules de calcul hydrauliques", + "INFO_WELCOME_CONTENT": "<p>Le logiciel Cassiopée a été développé par l'<a href=\"https://www.afbiodiversite.fr\">AFB</a> (Agence Française pour la Biodiversité) et <a href=\"https://www.irstea.fr\">Irstea</a> (Institut national de Recherche en Sciences et Technologies pour l’Environnement et l’Agriculture).</p><p>Il regroupe des outils d'aide à la conception de passes à poissons et des outils de calcul hydraulique utiles pour l'ingénierie en environnement et agriculture.</p><p>Pour plus d'informations, consulter les <a href=\"assets/docs-fr/mentions_legales\">mentions légales</a> et la <a href=\"assets/docs-fr\">documentation</a>.</p>", "WARNING_REMOUS_ARRET_CRITIQUE": "Arrêt du calcul : hauteur critique atteinte à l'abscisse %x%", "WARNING_STRUCTUREKIVI_HP_TROP_ELEVE": "h/p ne doit pas être supérieur à 2,5. h/p est forcé à 2,5", "WARNING_STRUCTUREKIVI_PELLE_TROP_FAIBLE": "La pelle du seuil doit mesurer au moins 0,1 m. Le coefficient béta est forcé à 0"