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 {
|
||||
_id:string;
|
||||
portalPid:string;
|
||||
layoutOptions:CustomizationOptions;
|
||||
date:Date;
|
||||
constructor(community, options:CustomizationOptions){
|
||||
this.portalPid = community;
|
||||
this.layoutOptions = options;
|
||||
|
@ -14,11 +17,22 @@ export class Layout {
|
|||
if(options.identity) {
|
||||
variables['@global-primary-background'] = options.identity.mainColor;
|
||||
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 null;
|
||||
}
|
||||
public static getUrl(url){
|
||||
return 'url("' + url + '")';
|
||||
}
|
||||
|
||||
}
|
||||
export class CustomizationOptions {
|
||||
identity: {
|
||||
|
|
Loading…
Reference in New Issue