From 247cc502760ffe480a7e43e483c37a26ed46d20d Mon Sep 17 00:00:00 2001
From: Florent Poittevin <florent.poittevin@unige.ch>
Date: Fri, 25 Oct 2019 12:10:01 +0200
Subject: [PATCH] style: change admin person form in two column

---
 .../admin-orgunit-form.presentational.html    |  1 -
 .../admin-person-form.presentational.html     | 89 ++++++++++---------
 2 files changed, 48 insertions(+), 42 deletions(-)

diff --git a/src/app/features/admin/orgunit/components/presentationals/admin-orgunit-form/admin-orgunit-form.presentational.html b/src/app/features/admin/orgunit/components/presentationals/admin-orgunit-form/admin-orgunit-form.presentational.html
index 6755e7f67..6848707d4 100644
--- a/src/app/features/admin/orgunit/components/presentationals/admin-orgunit-form/admin-orgunit-form.presentational.html
+++ b/src/app/features/admin/orgunit/components/presentationals/admin-orgunit-form/admin-orgunit-form.presentational.html
@@ -4,7 +4,6 @@
 >
   <div class="two-columns-wrapper">
     <div class="left-part">
-
       <mat-form-field *ngIf="getFormControl(formDefinition.name) as fd">
         <input [formControl]="fd"
                solidifyValidation
diff --git a/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.html b/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.html
index 33d6107d7..298fdf8a0 100644
--- a/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.html
+++ b/src/app/features/admin/person/components/presentationals/admin-person-form/admin-person-form.presentational.html
@@ -1,51 +1,58 @@
 <form [formGroup]="form"
+      class="form-two-columns"
       (ngSubmit)="onSubmit()"
 >
-  <mat-form-field *ngIf="getFormControl(formDefinition.firstName) as fd">
-    <mat-label>{{'admin.person.form.firstName' | translate }}</mat-label>
-    <input matInput
-           solidifyValidation
-           [formControl]="fd"
-           [required]="formValidationHelper.hasRequiredField(fd)"
-    >
-    <mat-error>{{formValidationHelper.getFormError(fd)}}</mat-error>
-  </mat-form-field>
+  <div class="two-columns-wrapper">
+    <div class="left-part">
+      <mat-form-field *ngIf="getFormControl(formDefinition.firstName) as fd">
+        <mat-label>{{'admin.person.form.firstName' | translate }}</mat-label>
+        <input matInput
+               solidifyValidation
+               [formControl]="fd"
+               [required]="formValidationHelper.hasRequiredField(fd)"
+        >
+        <mat-error>{{formValidationHelper.getFormError(fd)}}</mat-error>
+      </mat-form-field>
 
-  <mat-form-field *ngIf="getFormControl(formDefinition.lastName) as fd">
-    <mat-label>{{'admin.person.form.lastName' | translate }}</mat-label>
-    <input matInput
-           solidifyValidation
-           [formControl]="fd"
-           [required]="formValidationHelper.hasRequiredField(fd)"
-    >
-    <mat-error>{{formValidationHelper.getFormError(fd)}}</mat-error>
-  </mat-form-field>
+      <mat-form-field *ngIf="getFormControl(formDefinition.lastName) as fd">
+        <mat-label>{{'admin.person.form.lastName' | translate }}</mat-label>
+        <input matInput
+               solidifyValidation
+               [formControl]="fd"
+               [required]="formValidationHelper.hasRequiredField(fd)"
+        >
+        <mat-error>{{formValidationHelper.getFormError(fd)}}</mat-error>
+      </mat-form-field>
 
-  <mat-form-field *ngIf="getFormControl(formDefinition.orcid) as fd">
-    <mat-label>{{'admin.person.form.orcid' | translate }}</mat-label>
-    <input matInput
-           solidifyValidation
-           [formControl]="fd"
-           [required]="formValidationHelper.hasRequiredField(fd)"
-    >
-    <mat-error>{{formValidationHelper.getFormError(fd)}}</mat-error>
-  </mat-form-field>
-  <dlcm-shared-person-orgunit-role [formControl]="form.get(formDefinition.orgUnitRole)"
-                                   [mode]="personOrgUnitRoleMode.orgUnit"
-                                   [selectedPersonOrOrgUnitRole]="selectedOrgUnitRole"
-                                   [listOrgUnit]="listOrganizationalUnit"
-                                   [listRole]="listRole"
-  ></dlcm-shared-person-orgunit-role>
+      <mat-form-field *ngIf="getFormControl(formDefinition.orcid) as fd">
+        <mat-label>{{'admin.person.form.orcid' | translate }}</mat-label>
+        <input matInput
+               solidifyValidation
+               [formControl]="fd"
+               [required]="formValidationHelper.hasRequiredField(fd)"
+        >
+        <mat-error>{{formValidationHelper.getFormError(fd)}}</mat-error>
+      </mat-form-field>
 
-  <dlcm-shared-multi-select [list]="listInstitutions"
-                            [formControl]="form.get(formDefinition.institutions)"
-                            [required]="isRequired(formDefinition.institutions)"
-                            [labelKey]="'name'"
-                            [valueKey]="'resId'"
-                            [placeholder]="'admin.person.form.institution' | translate"
-  >
-  </dlcm-shared-multi-select>
+      <dlcm-shared-multi-select [list]="listInstitutions"
+                                [formControl]="form.get(formDefinition.institutions)"
+                                [required]="isRequired(formDefinition.institutions)"
+                                [labelKey]="'name'"
+                                [valueKey]="'resId'"
+                                [placeholder]="'admin.person.form.institution' | translate"
+      >
+      </dlcm-shared-multi-select>
+    </div>
 
+    <div class="right-part">
+      <dlcm-shared-person-orgunit-role [formControl]="form.get(formDefinition.orgUnitRole)"
+                                       [mode]="personOrgUnitRoleMode.orgUnit"
+                                       [selectedPersonOrOrgUnitRole]="selectedOrgUnitRole"
+                                       [listOrgUnit]="listOrganizationalUnit"
+                                       [listRole]="listRole"
+      ></dlcm-shared-person-orgunit-role>
+    </div>
+  </div>
   <div class="submit-button">
     <button *ngIf="!readonly"
             mat-flat-button
-- 
GitLab