Skip to content

Commit

Permalink
company labels as html
Browse files Browse the repository at this point in the history
  • Loading branch information
micnori committed Jan 24, 2024
1 parent 67d1363 commit 8b91cda
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,17 +360,52 @@ <h1 style="width: 100%;margin-bottom: 0px;">{{'addCampaign' | translate}}</h1>
<input matInput id="{{'name'+languageSelected}}"
formControlName="{{'name'+languageSelected}}">
</mat-form-field>
<div class="in-line-forms" style="margin-top: 20px" *ngIf="!!validatingForm && !!validatingForm.get('type').value && validatingForm.get('type').value==='company'">
<mat-form-field appearance="fill" *ngIf="l===languageSelected" class="input-half-left">
<mat-label>{{'registrationCompanyDesc' | translate}} - {{l | translate}}</mat-label>
<input matInput id="{{'registrationCompanyDesc' + languageSelected}}"
formControlName="{{'registrationCompanyDesc' + languageSelected}}">
</mat-form-field>
<mat-form-field appearance="fill" *ngIf="l===languageSelected" class="input-half-right">
<mat-label>{{'limitCompanyDesc' | translate}} - {{l | translate}}</mat-label>
<input matInput id="{{'limitCompanyDesc' + languageSelected}}"
formControlName="{{'limitCompanyDesc' + languageSelected}}">
</mat-form-field>
<div class="in-line-forms" style="margin-top: 20px"
*ngIf="!!validatingForm && !!validatingForm.get('type').value && validatingForm.get('type').value==='company'">
<mat-card class="input-half-left" *ngIf="l===languageSelected" style="display: inline-block; vertical-align: top;">
<mat-card-title class="cursor-pointer card-expandable"
(click)="expandableRegistrationCompanyDesc = ! expandableRegistrationCompanyDesc">
{{'registrationCompanyDesc' | translate}} - {{l | translate}}
<mat-card-actions class="right-button top-button">
<mat-icon *ngIf="expandableRegistrationCompanyDesc">
<span class="material-symbols-outlined">
expand_more
</span>
</mat-icon>
<mat-icon *ngIf="!expandableRegistrationCompanyDesc">
<span class="material-symbols-outlined">
expand_less
</span>
</mat-icon>
</mat-card-actions>
</mat-card-title>
<mat-card-content [@bodyExpansion]="expandableRegistrationCompanyDesc ? 'collapsed': 'expanded' "
class="expandable-content">
<rich-text-editor [control]="registrationCompanyDescControl"></rich-text-editor>
</mat-card-content>
</mat-card>
<mat-card class="input-half-right" *ngIf="l===languageSelected" style="display: inline-block; vertical-align: top;">
<mat-card-title class="cursor-pointer card-expandable"
(click)="expandableLimitCompanyDesc = ! expandableLimitCompanyDesc">
{{'limitCompanyDesc' | translate}} - {{l | translate}}
<mat-card-actions class="right-button top-button">
<mat-icon *ngIf="expandableLimitCompanyDesc">
<span class="material-symbols-outlined">
expand_more
</span>
</mat-icon>
<mat-icon *ngIf="!expandableLimitCompanyDesc">
<span class="material-symbols-outlined">
expand_less
</span>
</mat-icon>
</mat-card-actions>
</mat-card-title>
<mat-card-content [@bodyExpansion]="expandableLimitCompanyDesc ? 'collapsed': 'expanded' "
class="expandable-content">
<rich-text-editor [control]="limitCompanyDescControl"></rich-text-editor>
</mat-card-content>
</mat-card>
</div>
<mat-card class="card" *ngIf="l===languageSelected">
<mat-card-title class="cursor-pointer card-expandable"
Expand Down Expand Up @@ -860,17 +895,62 @@ <h1 style="width: 100%;margin-bottom: 0px;">{{'modifyCampaign' | translate}} -
<input matInput id="{{'name'+languageSelected}}"
formControlName="{{'name'+languageSelected}}">
</mat-form-field>
<div class="in-line-forms" style="margin-top: 20px" *ngIf="!!validatingForm && !!validatingForm.get('type').value && validatingForm.get('type').value==='company'">
<mat-form-field appearance="fill" *ngIf="l===languageSelected" class="input-half-left">
<div class="in-line-forms" style="margin-top: 20px"
*ngIf="!!validatingForm && !!validatingForm.get('type').value && validatingForm.get('type').value==='company'">
<mat-card class="input-half-left" *ngIf="l===languageSelected" style="display: inline-block; vertical-align: top;">
<mat-card-title class="cursor-pointer card-expandable"
(click)="expandableRegistrationCompanyDesc = ! expandableRegistrationCompanyDesc">
{{'registrationCompanyDesc' | translate}} - {{l | translate}}
<mat-card-actions class="right-button top-button">
<mat-icon *ngIf="expandableRegistrationCompanyDesc">
<span class="material-symbols-outlined">
expand_more
</span>
</mat-icon>
<mat-icon *ngIf="!expandableRegistrationCompanyDesc">
<span class="material-symbols-outlined">
expand_less
</span>
</mat-icon>
</mat-card-actions>
</mat-card-title>
<mat-card-content [@bodyExpansion]="expandableRegistrationCompanyDesc ? 'collapsed': 'expanded' "
class="expandable-content">
<rich-text-editor [control]="registrationCompanyDescControl"></rich-text-editor>
</mat-card-content>
</mat-card>
<!--mat-form-field appearance="fill" *ngIf="l===languageSelected" class="input-half-left">
<mat-label>{{'registrationCompanyDesc' | translate}} - {{l | translate}}</mat-label>
<input matInput id="{{'registrationCompanyDesc' + languageSelected}}"
formControlName="{{'registrationCompanyDesc' + languageSelected}}">
</mat-form-field>
<mat-form-field appearance="fill" *ngIf="l===languageSelected" class="input-half-right">
</mat-form-field-->
<mat-card class="input-half-right" *ngIf="l===languageSelected" style="display: inline-block; vertical-align: top;">
<mat-card-title class="cursor-pointer card-expandable"
(click)="expandableLimitCompanyDesc = ! expandableLimitCompanyDesc">
{{'limitCompanyDesc' | translate}} - {{l | translate}}
<mat-card-actions class="right-button top-button">
<mat-icon *ngIf="expandableLimitCompanyDesc">
<span class="material-symbols-outlined">
expand_more
</span>
</mat-icon>
<mat-icon *ngIf="!expandableLimitCompanyDesc">
<span class="material-symbols-outlined">
expand_less
</span>
</mat-icon>
</mat-card-actions>
</mat-card-title>
<mat-card-content [@bodyExpansion]="expandableLimitCompanyDesc ? 'collapsed': 'expanded' "
class="expandable-content">
<rich-text-editor [control]="limitCompanyDescControl"></rich-text-editor>
</mat-card-content>
</mat-card>
<!--mat-form-field appearance="fill" *ngIf="l===languageSelected" class="input-half-right">
<mat-label>{{'limitCompanyDesc' | translate}} - {{l | translate}}</mat-label>
<input matInput id="{{'limitCompanyDesc' + languageSelected}}"
formControlName="{{'limitCompanyDesc' + languageSelected}}">
</mat-form-field>
</mat-form-field-->
</div>
<mat-card class="card" *ngIf="l===languageSelected">
<mat-card-title class="cursor-pointer card-expandable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ export class CampaignAddFormComponent implements OnInit {
errorMsgValidation: string;
stateDescription: string = "collapsed";
expandableDescription: boolean = true;
expandableRegistrationCompanyDesc: boolean = true;
expandableLimitCompanyDesc: boolean = true;
details: DetailsForAddModifyModule[] = [];
detailsType: any[];
// stateRules: string = "collapsed";
Expand Down Expand Up @@ -237,6 +239,8 @@ export class CampaignAddFormComponent implements OnInit {
hideCompanyDesc: false,
});
this.expandableDescription = false;
this.expandableLimitCompanyDesc = false;
this.expandableRegistrationCompanyDesc = false;
this.campaignCreated.specificData.periods = [];
this.periods = this.campaignCreated.specificData.periods;
} else {
Expand Down Expand Up @@ -1046,6 +1050,16 @@ export class CampaignAddFormComponent implements OnInit {
return this.validatingForm.controls[name] as FormControl;
}

get registrationCompanyDescControl() {
const name = REGISTRATION_COMPANY_DESC + this.languageSelected;
return this.validatingForm.controls[name] as FormControl;
}

get limitCompanyDescControl() {
const name = LIMIT_COMPANY_DESC + this.languageSelected;
return this.validatingForm.controls[name] as FormControl;
}

get privacyRichControl() {
return this.validatingForm.controls.privacy as FormControl;
}
Expand Down

0 comments on commit 8b91cda

Please sign in to comment.