From 06e03bd0293d7e75db10a85b9065a90161364353 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Wed, 5 Jun 2019 12:00:23 +0200
Subject: [PATCH] =?UTF-8?q?Mise=20en=20page=20large=20pour=20la=20passe=20?=
 =?UTF-8?q?=C3=A0=20bassins?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../generic-calculator/calculator.component.html  | 15 ++++++++++++---
 .../generic-calculator/calculator.component.ts    | 10 ++++++++++
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/app/components/generic-calculator/calculator.component.html b/src/app/components/generic-calculator/calculator.component.html
index 4b518f5ab..7356b4b5a 100644
--- a/src/app/components/generic-calculator/calculator.component.html
+++ b/src/app/components/generic-calculator/calculator.component.html
@@ -28,9 +28,15 @@
             <!-- nom du module de calcul -->
             <calc-name id="calculator-name" [title]="uitextCalculatorName"></calc-name>
 
-            <div id="calc-cards-container" class="container" fxLayout="row wrap" fxLayoutAlign="space-around start">
+            <div id="calc-cards-container" class="container"
+              [fxLayout]="isPAB ? 'column' : 'row wrap'"
+              [fxLayoutAlign]="isPAB ? 'space-around stretch' : 'space-around start'">
+
                 <!-- chapitres -->
-                <mat-card id="calc-card-field-sets" fxFlex.gt-xs="1 0 400px" fxFlex.lt-sm="1 0 300px">
+                <mat-card id="calc-card-field-sets"
+                  [fxFlex.gt-xs]="isPAB ? '1 0 auto' : '1 0 400px'"
+                  [fxFlex.lt-sm]="isPAB ? '1 0 auto' : '1 0 300px'">
+
                     <ng-template ngFor let-fe [ngForOf]="formElements">
                         <field-set *ngIf="isFieldset(fe)" [style.display]="getFieldsetStyleDisplay(fe.id)" [fieldSet]=fe
                             (radio)=onRadioClick($event) (validChange)=OnFieldsetValid() (inputChange)=onInputChange($event)
@@ -52,7 +58,10 @@
                 </mat-card>
 
                 <!-- résultats -->
-                <mat-card id="calc-card-results" fxFlex.gt-xs="1 0 400px" fxFlex.lt-sm="1 0 300px">
+                <mat-card id="calc-card-results"
+                  [fxFlex.gt-xs]="isPAB ? '1 0 auto' : '1 0 400px'"
+                  [fxFlex.lt-sm]="isPAB ? '1 0 auto' : '1 0 300px'">
+
                     <div id="fake-results-anchor"></div>
                     <mat-card-header>
                         <mat-card-title>
diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts
index 67b856e1f..a83ea6303 100644
--- a/src/app/components/generic-calculator/calculator.component.ts
+++ b/src/app/components/generic-calculator/calculator.component.ts
@@ -425,6 +425,16 @@ export class GenericCalculatorComponent extends BaseComponent implements OnInit,
         return false;
     }
 
+    // for "one wide column" layout
+    public get isPAB() {
+        return (
+            this._formulaire
+            && this._formulaire.currentNub
+            && this._formulaire.currentNub.calcType === CalculatorType.Pab
+        );
+    }
+
+    // for "generate PAB" button
     public get isPABCloisons() {
         return (
             this._formulaire
-- 
GitLab