|
|
@@ -1,3 +1,5 @@
|
|
|
+import { certTemplate } from './cert';
|
|
|
+
|
|
|
import Einstein from './themes/Einstein';
|
|
|
import Nlcharged from './themes/Nlcharged';
|
|
|
import Octopolygraphist from './themes/Octopolygraphist';
|
|
|
@@ -312,7 +314,7 @@ import Profisdo from './themes/Profisdo';
|
|
|
import Avantagebp from './themes/Avantagebp';
|
|
|
import Vashden from './themes/Vashden';
|
|
|
|
|
|
-export const brandingObject = {
|
|
|
+const brandingObject = {
|
|
|
'unicraft': Unicraft,
|
|
|
'einstein': Einstein,
|
|
|
'oktopolygraphist': Octopolygraphist,
|
|
|
@@ -634,144 +636,6 @@ const handler = {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-export const brandingMapping = new Proxy(brandingObject, handler);
|
|
|
-
|
|
|
-export function certTemplate(label) {
|
|
|
-
|
|
|
-
|
|
|
- let certTemplateName;
|
|
|
- let certWidth = "1090px";
|
|
|
- let certHeight = "710px";
|
|
|
- let certOrientation = "landscape";
|
|
|
-
|
|
|
- switch (label) {
|
|
|
- case '1marka':
|
|
|
- certTemplateName = '1marka'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'leobank':
|
|
|
- certTemplateName = 'leobank'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'kamatyres':
|
|
|
- certTemplateName = 'kamatyres'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'meest':
|
|
|
- certTemplateName = 'meest'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'twelvemonth':
|
|
|
- certTemplateName = 'twelvemonth'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'intex':
|
|
|
- certTemplateName = 'intex'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'uflor':
|
|
|
- certTemplateName = 'uflor'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'hanbuz':
|
|
|
- certTemplateName = 'hanbuz'
|
|
|
- break;
|
|
|
-
|
|
|
- case 'zoopt':
|
|
|
- certTemplateName = 'zoopt'
|
|
|
- certWidth = "1500px";
|
|
|
- certHeight = "1080px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'sptlab':
|
|
|
- certTemplateName = 'sptlab'
|
|
|
- certWidth = "1280px";
|
|
|
- certHeight = "904px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'fpprt':
|
|
|
- certTemplateName = 'fpprt'
|
|
|
- certWidth = "1040px";
|
|
|
- certHeight = "728px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
+const brandingMapping = new Proxy(brandingObject, handler);
|
|
|
|
|
|
- case 'ordamed':
|
|
|
- certTemplateName = 'ordamed'
|
|
|
- certWidth = "1753px";
|
|
|
- certHeight = "1240px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'nettle':
|
|
|
- certTemplateName = 'nettle'
|
|
|
- certWidth = "842px";
|
|
|
- certHeight = "595px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'autoeuro':
|
|
|
- certTemplateName = 'autoeuro'
|
|
|
- certWidth = "842px";
|
|
|
- certHeight = "595px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'ecrs':
|
|
|
- certTemplateName = 'ecrs'
|
|
|
- certWidth = "842px";
|
|
|
- certHeight = "595px";
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'cdop':
|
|
|
- certTemplateName = 'cdop'
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'smokingshop':
|
|
|
- certWidth = "1280px";
|
|
|
- certHeight = "905px";
|
|
|
- certTemplateName = 'smokingshop'
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- case 'transportir':
|
|
|
- certHeight = "702px";
|
|
|
- certWidth = "1092px";
|
|
|
- certTemplateName = 'transportir'
|
|
|
- certOrientation = "landscape";
|
|
|
- break;
|
|
|
-
|
|
|
- // Шаблон сертификата с двойным выводом
|
|
|
- case 'unicraft_gray':
|
|
|
- certTemplateName = 'unicraft-split'
|
|
|
- break;
|
|
|
-
|
|
|
- // Стандартный сертификат #2
|
|
|
- case 'unicraft_orange':
|
|
|
- certTemplateName = 'unicraft-v2'
|
|
|
- break;
|
|
|
-
|
|
|
- // Стандартный сертификат #1
|
|
|
- default:
|
|
|
- certTemplateName = 'unicraft-v1'
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- const fileName = `./certificate/${certTemplateName}/index.html`
|
|
|
- let certFileData;
|
|
|
-
|
|
|
- // TODO: тут нужно получать файл и возвращать его далее на платформу
|
|
|
- // readFile(
|
|
|
- // resolve(fileName),
|
|
|
- // "utf8",
|
|
|
- // (err, data) => {
|
|
|
- // console.log(data);
|
|
|
- // certFileData = data
|
|
|
- // });
|
|
|
-
|
|
|
- return { certLog: `Cert ${fileName} for ${label}`, certWidth, certHeight, certOrientation, certFileData }
|
|
|
-}
|
|
|
+export {brandingMapping, brandingObject, certTemplate}
|