Customization Options: add date, update getVariables method
This commit is contained in:
parent
5abb8b6384
commit
7641c46d34
|
@ -1,7 +1,10 @@
|
||||||
|
import {properties} from "../../../../environments/environment";
|
||||||
|
|
||||||
export class Layout {
|
export class Layout {
|
||||||
_id:string;
|
_id:string;
|
||||||
portalPid:string;
|
portalPid:string;
|
||||||
layoutOptions:CustomizationOptions;
|
layoutOptions:CustomizationOptions;
|
||||||
|
date:Date;
|
||||||
constructor(community, options:CustomizationOptions){
|
constructor(community, options:CustomizationOptions){
|
||||||
this.portalPid = community;
|
this.portalPid = community;
|
||||||
this.layoutOptions = options;
|
this.layoutOptions = options;
|
||||||
|
@ -14,11 +17,22 @@ export class Layout {
|
||||||
if(options.identity) {
|
if(options.identity) {
|
||||||
variables['@global-primary-background'] = options.identity.mainColor;
|
variables['@global-primary-background'] = options.identity.mainColor;
|
||||||
variables['@global-secondary-background'] = options.identity.secondaryColor;
|
variables['@global-secondary-background'] = options.identity.secondaryColor;
|
||||||
|
variables['@primary-color'] = options.identity.mainColor;
|
||||||
|
variables['@secondary-color'] = options.identity.secondaryColor;
|
||||||
|
}
|
||||||
|
if(options.backgrounds){
|
||||||
|
variables['@general-search-form-background'] = options.backgrounds.form.color;
|
||||||
|
variables['@general-search-form-background-image'] = (options.backgrounds.form.imageFile?(this.getUrl(properties.utilsService + '/download/' +options.backgrounds.form.imageFile)): 'none') ;
|
||||||
|
variables['@base-body-background'] = options.backgrounds.light.color;
|
||||||
}
|
}
|
||||||
return variables;
|
return variables;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
public static getUrl(url){
|
||||||
|
return 'url("' + url + '")';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
export class CustomizationOptions {
|
export class CustomizationOptions {
|
||||||
identity: {
|
identity: {
|
||||||
|
|
Loading…
Reference in New Issue