From 7668c35354b3e1b4b551974ae7dac7f4086f6045 Mon Sep 17 00:00:00 2001 From: teddy Date: Tue, 17 Sep 2024 17:00:18 +0100 Subject: [PATCH] 1. New Router and Base Page Class architecture to avoid circular references and conform to module bundler requirements. \n 2. Relative path bug fix for lib/validation.js file to work using module bundler. --- .babelrc | 5 +- ..._view_accessibility_report.cpython-312.pyc | Bin 0 -> 1293 bytes ...ew_accessibility_statement.cpython-312.pyc | Bin 0 -> 1320 bytes .../model_view_base.cpython-312.pyc | Bin 13918 -> 13918 bytes .../model_view_home.cpython-312.pyc | Bin 1161 -> 1164 bytes .../model_view_license.cpython-312.pyc | Bin 0 -> 1189 bytes .../model_view_privacy_policy.cpython-312.pyc | Bin 0 -> 1245 bytes ...el_view_retention_schedule.cpython-312.pyc | Bin 0 -> 1282 bytes models/model_view_accessibility_report.py | 24 + models/model_view_accessibility_statement.py | 24 + models/model_view_base.py | 2 +- models/model_view_home.py | 15 +- models/model_view_license.py | 24 + models/model_view_privacy_policy.py | 24 + models/model_view_retention_schedule.py | 24 + package-lock.json | 1 + package.json | 1 + routing/__pycache__/legal.cpython-312.pyc | Bin 3604 -> 4048 bytes routing/legal.py | 23 +- .../pages/legal/accessibility_statement.css | 0 static/css/pages/legal/privacy_policy.css | 0 static/css/pages/legal/retention_schedule.css | 0 static/css/sections/legal.css | 0 static/dist/css/466.bundle.css | 1 + ...in_home.css => core_admin_home.bundle.css} | 1 - .../{contact.css => core_contact.bundle.css} | 1 - .../css/{home.css => core_home.bundle.css} | 11 +- ...{services.css => core_services.bundle.css} | 1 - .../legal_accessibility_statement.bundle.css | 1 + .../css/legal_accessibility_statement.css | 2 + .../{license.css => legal_license.bundle.css} | 1 - .../dist/css/legal_privacy_policy.bundle.css | 1 + static/dist/css/legal_privacy_policy.css | 2 + .../css/legal_retention_schedule.bundle.css | 1 + static/dist/css/legal_retention_schedule.css | 2 + static/dist/css/main.bundle.css | 702 ++++++++++++++++++ static/dist/css/main.css | 32 +- static/dist/css/store_home.bundle.css | 1 + .../css/store_product_categories.bundle.css | 62 ++ .../css/store_product_permutations.bundle.css | 61 ++ static/dist/css/store_stock_items.bundle.css | 40 + static/dist/js/144.bundle.js | 1 - static/dist/js/17.bundle.js | 1 - static/dist/js/312.bundle.js | 1 - static/dist/js/623.bundle.js | 1 - static/dist/js/722.bundle.js | 1 - static/dist/js/765.bundle.js | 1 - static/dist/js/835.bundle.js | 1 - static/dist/js/916.bundle.js | 1 - static/dist/js/admin_home.bundle.js | 2 - static/dist/js/contact.bundle.js | 2 - static/dist/js/core_admin_home.bundle.js | 3 +- static/dist/js/core_contact.bundle.js | 3 +- static/dist/js/core_home.bundle.js | 3 +- static/dist/js/core_services.bundle.js | 3 +- static/dist/js/home.bundle.js | 2 - .../legal_accessibility_statement.bundle.js | 1 + ...ssibility_statement.bundle.js.LICENSE.txt} | 0 static/dist/js/legal_license.bundle.js | 3 +- static/dist/js/legal_privacy_policy.bundle.js | 1 + ...egal_privacy_policy.bundle.js.LICENSE.txt} | 0 .../js/legal_retention_schedule.bundle.js | 1 + ..._retention_schedule.bundle.js.LICENSE.txt} | 0 static/dist/js/license.bundle.js | 2 - static/dist/js/license.bundle.js.LICENSE.txt | 1 - static/dist/js/main.bundle.js | 2 +- static/dist/js/services.bundle.js | 2 - static/dist/js/services.bundle.js.LICENSE.txt | 1 - static/dist/js/store_home.bundle.js | 3 +- .../js/store_product_categories.bundle.js | 3 +- .../js/store_product_permutations.bundle.js | 3 +- static/dist/js/store_stock_items.bundle.js | 3 +- static/dist/page_core_home.chunk.js | 1 + static/dist/page_privacy_policy.chunk.js | 1 + static/js/DEPRECATED/routing.js | 2 +- static/js/components/input_date.js | 2 +- static/js/components/table.js | 2 +- static/js/components/textarea.js | 2 +- static/js/dom.js | 2 +- static/js/lib/common.js | 2 +- static/js/lib/local_storage.js | 2 +- static/js/pages/base.js | 104 +-- static/js/pages/base_table.js | 10 +- static/js/pages/core/admin_home.js | 13 +- static/js/pages/core/contact.js | 8 +- static/js/pages/core/home.js | 8 +- static/js/pages/core/services.js | 8 +- static/js/pages/legal/accessibility_report.js | 17 + .../js/pages/legal/accessibility_statement.js | 8 +- static/js/pages/legal/license.js | 8 +- static/js/pages/legal/privacy_policy.js | 18 + static/js/pages/legal/retention_schedule.js | 17 + static/js/pages/store/base.js | 7 +- static/js/pages/store/basket.js | 8 +- static/js/pages/store/home.js | 8 +- static/js/pages/store/product_categories.js | 8 +- static/js/pages/store/product_permutations.js | 10 +- static/js/pages/store/stock_items.js | 12 +- static/js/pages/user/user.js | 8 +- static/js/router.js | 93 ++- static/js/sections/legal.js | 0 templates/layouts/layout.html | 5 +- ...ivacy_notice.html => _privacy_policy.html} | 6 +- webpack.config.js | 53 +- 104 files changed, 1348 insertions(+), 247 deletions(-) create mode 100644 models/__pycache__/model_view_accessibility_report.cpython-312.pyc create mode 100644 models/__pycache__/model_view_accessibility_statement.cpython-312.pyc create mode 100644 models/__pycache__/model_view_license.cpython-312.pyc create mode 100644 models/__pycache__/model_view_privacy_policy.cpython-312.pyc create mode 100644 models/__pycache__/model_view_retention_schedule.cpython-312.pyc create mode 100644 models/model_view_accessibility_report.py create mode 100644 models/model_view_accessibility_statement.py create mode 100644 models/model_view_license.py create mode 100644 models/model_view_privacy_policy.py create mode 100644 models/model_view_retention_schedule.py create mode 100644 static/css/pages/legal/accessibility_statement.css create mode 100644 static/css/pages/legal/privacy_policy.css create mode 100644 static/css/pages/legal/retention_schedule.css create mode 100644 static/css/sections/legal.css create mode 100644 static/dist/css/466.bundle.css rename static/dist/css/{admin_home.css => core_admin_home.bundle.css} (98%) rename static/dist/css/{contact.css => core_contact.bundle.css} (99%) rename static/dist/css/{home.css => core_home.bundle.css} (73%) rename static/dist/css/{services.css => core_services.bundle.css} (99%) create mode 100644 static/dist/css/legal_accessibility_statement.bundle.css create mode 100644 static/dist/css/legal_accessibility_statement.css rename static/dist/css/{license.css => legal_license.bundle.css} (98%) create mode 100644 static/dist/css/legal_privacy_policy.bundle.css create mode 100644 static/dist/css/legal_privacy_policy.css create mode 100644 static/dist/css/legal_retention_schedule.bundle.css create mode 100644 static/dist/css/legal_retention_schedule.css create mode 100644 static/dist/css/main.bundle.css create mode 100644 static/dist/css/store_home.bundle.css create mode 100644 static/dist/css/store_product_categories.bundle.css create mode 100644 static/dist/css/store_product_permutations.bundle.css create mode 100644 static/dist/css/store_stock_items.bundle.css delete mode 100644 static/dist/js/144.bundle.js delete mode 100644 static/dist/js/17.bundle.js delete mode 100644 static/dist/js/312.bundle.js delete mode 100644 static/dist/js/623.bundle.js delete mode 100644 static/dist/js/722.bundle.js delete mode 100644 static/dist/js/765.bundle.js delete mode 100644 static/dist/js/835.bundle.js delete mode 100644 static/dist/js/916.bundle.js delete mode 100644 static/dist/js/admin_home.bundle.js delete mode 100644 static/dist/js/contact.bundle.js delete mode 100644 static/dist/js/home.bundle.js create mode 100644 static/dist/js/legal_accessibility_statement.bundle.js rename static/dist/js/{admin_home.bundle.js.LICENSE.txt => legal_accessibility_statement.bundle.js.LICENSE.txt} (100%) create mode 100644 static/dist/js/legal_privacy_policy.bundle.js rename static/dist/js/{contact.bundle.js.LICENSE.txt => legal_privacy_policy.bundle.js.LICENSE.txt} (100%) create mode 100644 static/dist/js/legal_retention_schedule.bundle.js rename static/dist/js/{home.bundle.js.LICENSE.txt => legal_retention_schedule.bundle.js.LICENSE.txt} (100%) delete mode 100644 static/dist/js/license.bundle.js delete mode 100644 static/dist/js/license.bundle.js.LICENSE.txt delete mode 100644 static/dist/js/services.bundle.js delete mode 100644 static/dist/js/services.bundle.js.LICENSE.txt create mode 100644 static/dist/page_core_home.chunk.js create mode 100644 static/dist/page_privacy_policy.chunk.js create mode 100644 static/js/pages/legal/accessibility_report.js create mode 100644 static/js/pages/legal/privacy_policy.js create mode 100644 static/js/pages/legal/retention_schedule.js create mode 100644 static/js/sections/legal.js rename templates/pages/legal/{_privacy_notice.html => _privacy_policy.html} (97%) diff --git a/.babelrc b/.babelrc index fc8201a6..827c750f 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,4 @@ { - "presets": ["@babel/preset-env"] - } \ No newline at end of file + "presets": ["@babel/preset-env"], + "plugins": ["@babel/plugin-syntax-dynamic-import"] +} \ No newline at end of file diff --git a/models/__pycache__/model_view_accessibility_report.cpython-312.pyc b/models/__pycache__/model_view_accessibility_report.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f478875bc246aed78dad09210749b03a029b4c54 GIT binary patch literal 1293 zcmah}&u`O66rOQn>Us$U79n<#*tvi(hzgYps@Q5nTcA>bs3}xLmPW4qk_>X}?92p6 z#i55v3kQy!X@91w5p6k0CK;rTi5*Y|z%oadE_OYlU` z{%bzA2>I8%Y#n>(3{If4P9oAE5sj>vcC3a)iA64wsI*3+GFTg>BDYcM+up8~&u&eo zHzCxM3{S1PuvlkHu&jgzx7yR~ROSIT8{H0M#4d{{ib1Ezsd`7~wrh&EPEA56lt>d+ zO(M1c3IZ9n*&>APB#qNnpVj+HLr1ZBfyEHH?zh+^n}=2qv+DwGv&(4&v2rg!pnDQ> z0M#%ArNpv`h3;eXZYuS*WY?Vm6-v?7IDgWe33R|ZrVDGPk_9`8Wl?+!C%OL{F+7@$ zI-~O4)DQM($w83w9y>u9bl?D5F^?ed<|PRu1ea8;bJ8&?zg3o60m`pYBXg z`qval<%79H|7rp=QrrT6CJlQXNVM{C1zIxbbVSnfuM5?~d#LMPBvLkUdSb%Qw}RtV z_(8Yp=d!Be!HtM~hrGOycf8xrY%O#QD@T7obUaV{8Nn*E$E)Pc*wFzxB*ZoUdJOwq zfn(@Ar0Ya~4c)iyk_T9Nmp-K%L)9qh6VwQ`*w+qJn|Fg2@USN(685ajR=qCB%;8)l zLUZnwq=Wrr1x+@}c^C&uajwin##ZI1367yzIsPLyTP+V_wmN|3<0|>bsoWoV=^T1- z^4tsO&@1P6`4a}bQ3D_eI>346a*oROV&m`T{7<}uVZ`am6v67gG=BinK+29>s@5;@ zTJ_>AuTD?T*6VZU=jP`YZ}5fL+SP@{9BNh>@(3Z0ks_6Qu{7U`KMF!dZfVSZ6F83M z;~M$fu54P=J~k+kU3=ad?~Ql%wYT)rTlzq#J+)~}jz2HG;+3-z&Z9I$;0KH47|$QY zaxCN5lw;1b<%k(+$ma+?Ip+$}Q}P%5&D@eXHe(k6 literal 0 HcmV?d00001 diff --git a/models/__pycache__/model_view_accessibility_statement.cpython-312.pyc b/models/__pycache__/model_view_accessibility_statement.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb6175697ed192dab2900699c0b731a50922c1c0 GIT binary patch literal 1320 zcma)6&u`pB6rS;}8^?4Bzf=kw7&xGqil_<~6qSf=vTY+JA*z=mEK4KDe!DxB*Is63 zTQ>BNLnPV*N0fg76b}3ooVc_H1hP0(f(y4s+ls0u-q@RM_5|^dljWZYwIhf6uDcE@mSUh0!iu{d>4^1BBi6|!i)QN8wEh;} z=l*R}@o2G7Ud#;!emPPQS87#$A{`lD!S`=aXdnSau`Q@2^ne^q&IWa`Z=O9}Sj8QB zmvnF}2lK()UGfzT9G`f#;@wkM&T!;YjxkPY#tf2i9o-=rQP0}mdwr(zxjH`>QgsDs zN0}b%+1G0;;b#h@3c<`X{4|4gDQ-cyp2tI@rwVZ$x-#nbMb-^(2sOl+_PzJd_e?dsbnq z;Q(aea4s^TIrnPP!G5xVu9)XMP9vo_SLQ~>_T{`uE}+}H@IMHhbUlX!>NRvv_sJhl zYOfv}S5hcTx4n8X$9a;+ zi2Yo(C`;v|T9jSM0rNm>9smFU literal 0 HcmV?d00001 diff --git a/models/__pycache__/model_view_base.cpython-312.pyc b/models/__pycache__/model_view_base.cpython-312.pyc index f110801e15ba940bb10f167dbde2bc527d29c87c..bf75e6bc250cb497a7a0f95e6175c58b6e13b2e6 100644 GIT binary patch delta 64 zcmcbYb1#ScG%qg~0}#wQ_hcitrTFAy;ue!##G5w%6W=YwIBD}Pt>3JC<~|o#R2Nii UU|v{znZ;-F76Y5j{|(|<0U?|jO#lD@ delta 64 zcmcbYb1#ScG%qg~0}wpzxU-SlQhaiac++GTaf{9W#CHoZPTssr>o@D!d<~|o# UR2NiiU|v{znZ;-GKZ68T02;3u5C8xG diff --git a/models/__pycache__/model_view_home.cpython-312.pyc b/models/__pycache__/model_view_home.cpython-312.pyc index ccd9c7f4d2a4f7ac3a3f653c58529ee8475a487f..a930b8acaaea79417a1880eb4a97c9f3c12316f8 100644 GIT binary patch delta 133 zcmeC=?BV1+&CAQh00hoQpQHs$~_J29e@#W}wyb>o9sjEusQtCeP(80Yyccq7RG delta 130 zcmeC-?BwJ<&CAQh00b7_&!jz?$m_*;V`4<-#%D7b8RaH7Fdg7k0?HMO0Er(B3{NKe zGWQ$GfJC%FA}tILSb0A(F|vw%W@cdH`v78nU}Mm-ysqhfQPcf90~4#=M+TJ%=R9wpqw(tA&nk?OFM3&WUId+<26s z&6RK5tgzd#ApIE3ayxEBB2BOnO%!K2&8!loVYC@1u)~g z5K7pUH_b_quJBtijvO^7o!DVb)yQg*U_oBLg!h?W6lIGhed)zq&EOXu32r7u=5t+0 z_Y!_TKox;hDJrQ!!K3SBGq0@{L0{aryD^Jv^dYIC=Ig!Ho`>WN(gFF^|0-`6QlMm2}0VS_F-QSVN&=@U{6MFy9r?| zZCqzvIL)RX*6n#;wo%hc-1hv4jhq=7vC|E6+_3GmT6U_J%nq)k;<;|atxlrHejLEc z;J*xp)65}+B-P7XBOm()yBH7`ALegUv{GuvF?d2ZNc=nXNLwY3v2~R`r<=JPlynG^ zN5=gPM>crNsRMW0LLeg7QcYxRO{hPM zIDl?t=syH@ZW+J=c^KW#HS)nIJ?eRF48A%w_R1K1Yn&Hq%~r3P89GhiJTW;($=ZR6 z_i=s?)y*?TOGJn-?ufnEBovCI|4O-Xh0m2QPw|0;%REZPley)@EdTC3e`jKvd?AiZSMIWtm@2u(9*7OfT_3#ZmlCZAcEG`&yusZfPbhem_d+ R*>8qU$DbbiPVh*Ze*viSIgJ1S literal 0 HcmV?d00001 diff --git a/models/__pycache__/model_view_privacy_policy.cpython-312.pyc b/models/__pycache__/model_view_privacy_policy.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72352694ead131e71e3edf0bcc1eaf59c06e3163 GIT binary patch literal 1245 zcmZ`&&rj4q6rSmBp;Q+96@q$T;=x#r#NfpcB(5N60=Teo^{Z0{>FE;YM{`f(}-RGustz;FF^7 zkU1up#qBzoXLj8Wyr9-1<(7z8Ly##Kz|7J0zqMg9#cGyE7F@PWrUQq0LZ4t()Z{E> z#@!{$Zjn;pxv>2`rt9NO*xU^x=sc{CTaiT?5>KiDCt(H)Q`i#Ru78yV7&z`t+E95F zyf@H*Pe&Q|hFebD_cFwLv@DXPK**1Ia5PthY> z(aOlk#i#yhSxTwVRFRGUyF?Ob=OJvM7B-Zbm7WZcS@2p)$P4CGg@lrQJ~nLL6^sj$ z$yu3qd^Qd(m^mKU%?9%$VZx|u+-fvjzh*ADq6vPNqo(5qWa#qHkeN)M!t_lm49&zu zk#1BPM>8{NYUW_riq*)CJhn1$sI0-{zzHBIJG}#KNRSOr_|KAB6TRmkd4V@j z^r!SpSw+tQx{BZ6&CDZ=S_m8g{m1H-sMFA@F={tC2a$#ntD+e)9&41kz8g_$_-+}8THE{<$z{qMDF z{0J0`F4@|*8jR9drxbi_dNS{(^dVTDRkV-?Kr?D_`B`&GChosgEZ?G~;^a+Qn!CMF z9J^0TccyNS-B0Mng^at+JP%}HeiT5-^slEPq{Uo@gd^( z*^Y7bgE6~p%>G1J9o>^5VV*!|jC|ZlsT0^hxi5VLgUOaYf<^dJ61K@{-YHv3*$IPv pZ6uXD%1^<6a$e#Lgxws*cu&!B{>N#AuYA{3Jo>8l2ZAjD{|3>mPmurs literal 0 HcmV?d00001 diff --git a/models/__pycache__/model_view_retention_schedule.cpython-312.pyc b/models/__pycache__/model_view_retention_schedule.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..67015cb567062c31c5037b00fab8beead659e097 GIT binary patch literal 1282 zcmaJ=L2KMb6rRzpVp;LlZCZ?zQkdcrs+OAKUW!RgH`z@baBSmUCm;laBE8*J&`R4G zt=%;~_+Y4W$T9emL$1a79l7-4972oe!O&iEv)Py!pYlf9-I^XUhc{1p@0<6&Z{GY- zDwzb=)XRSx&on~*Q6Iyl51jrt=7UhG3C z&D-E6T>)7GYmh*csKaYs3;b>f7g9~L0@4#fM9m3RYk^j#JCDhqS?CsVJ^c1r!ZH3hURRC{B4vTkG(Rc z55K)}XiUF0eiD~4V2!Ktk=q8&QKDkRkB*ghWc~Q3WxulQcZBK-C(2|LGU&2ZOvgC)V-I_u$|qws z+w#eHh|ef%JIfYhs-)tdb#QLn$ayb_tN2e{p8Oomae-2LqM5XKdX3N@-Wobxc)oH< IaLd5&0XGd@SO5S3 literal 0 HcmV?d00001 diff --git a/models/model_view_accessibility_report.py b/models/model_view_accessibility_report.py new file mode 100644 index 00000000..1faf5d85 --- /dev/null +++ b/models/model_view_accessibility_report.py @@ -0,0 +1,24 @@ +""" +Project: PARTS Website +Author: Edward Middleton-Smith + Precision And Research Technology Systems Limited + +Technology: Legal View Models +Feature: Accessibility Report View Model + +Description: +Data model for accessibility report view +""" + +# internal +from models.model_view_base import Model_View_Base +# from routes import bp_home +# external + +class Model_View_Accessibility_Report(Model_View_Base): + @property + def title(self): + return 'Accessibility Report' + def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_ACCESSIBILITY_REPORT): + super().__init__(hash_page_current=hash_page_current) + \ No newline at end of file diff --git a/models/model_view_accessibility_statement.py b/models/model_view_accessibility_statement.py new file mode 100644 index 00000000..2ffcb79c --- /dev/null +++ b/models/model_view_accessibility_statement.py @@ -0,0 +1,24 @@ +""" +Project: PARTS Website +Author: Edward Middleton-Smith + Precision And Research Technology Systems Limited + +Technology: Legal View Models +Feature: Accessibility Statement View Model + +Description: +Data model for accessibility statement view +""" + +# internal +from models.model_view_base import Model_View_Base +# from routes import bp_home +# external + +class Model_View_Accessibility_Statement(Model_View_Base): + @property + def title(self): + return 'Accessibility Statement' + def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_ACCESSIBILITY_STATEMENT): + super().__init__(hash_page_current=hash_page_current) + \ No newline at end of file diff --git a/models/model_view_base.py b/models/model_view_base.py index 759f0fbd..39c5235f 100644 --- a/models/model_view_base.py +++ b/models/model_view_base.py @@ -111,11 +111,11 @@ class Model_View_Base(BaseModel, ABC): HASH_PAGE_ACCESSIBILITY_STATEMENT: ClassVar[str] = '/accessibility-statement' HASH_PAGE_ADMIN_HOME: ClassVar[str] = '/admin' HASH_PAGE_CONTACT: ClassVar[str] = '/contact' + HASH_PAGE_DATA_RETENTION_SCHEDULE: ClassVar[str] = '/retention-schedule' HASH_PAGE_ERROR_NO_PERMISSION: ClassVar[str] = '/error' HASH_PAGE_HOME: ClassVar[str] = '/' HASH_PAGE_LICENSE: ClassVar[str] = '/license' HASH_PAGE_PRIVACY_POLICY: ClassVar[str] = '/privacy-policy' - HASH_PAGE_DATA_RETENTION_SCHEDULE: ClassVar[str] = '/retention-schedule' HASH_PAGE_SERVICES: ClassVar[str] = '/services' # HASH_PAGE_STORE_ADMIN: ClassVar[str] = '/store/admin' HASH_PAGE_STORE_BASKET: ClassVar[str] = '/store/basket' diff --git a/models/model_view_home.py b/models/model_view_home.py index 34c2ae19..f7bb6e2e 100644 --- a/models/model_view_home.py +++ b/models/model_view_home.py @@ -3,35 +3,22 @@ Project: PARTS Website Author: Edward Middleton-Smith Precision And Research Technology Systems Limited -Technology: View Models +Technology: Core View Models Feature: Home View Model Description: Data model for home view """ -# IMPORTS -# VARIABLE INSTANTIATION -# METHODS - -# IMPORTS # internal from models.model_view_base import Model_View_Base # from routes import bp_home # external - -# VARIABLE INSTANTIATION - - -# CLASSES class Model_View_Home(Model_View_Base): - # Attributes @property def title(self): return 'Home' - def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_HOME): - # Constructor super().__init__(hash_page_current=hash_page_current) \ No newline at end of file diff --git a/models/model_view_license.py b/models/model_view_license.py new file mode 100644 index 00000000..f891df1e --- /dev/null +++ b/models/model_view_license.py @@ -0,0 +1,24 @@ +""" +Project: PARTS Website +Author: Edward Middleton-Smith + Precision And Research Technology Systems Limited + +Technology: Legal View Models +Feature: License View Model + +Description: +Data model for license view +""" + +# internal +from models.model_view_base import Model_View_Base +# from routes import bp_home +# external + +class Model_View_License(Model_View_Base): + @property + def title(self): + return 'License' + def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_LICENSE): + super().__init__(hash_page_current=hash_page_current) + \ No newline at end of file diff --git a/models/model_view_privacy_policy.py b/models/model_view_privacy_policy.py new file mode 100644 index 00000000..0424333c --- /dev/null +++ b/models/model_view_privacy_policy.py @@ -0,0 +1,24 @@ +""" +Project: PARTS Website +Author: Edward Middleton-Smith + Precision And Research Technology Systems Limited + +Technology: Legal View Models +Feature: Privacy Policy View Model + +Description: +Data model for privacy policy view +""" + +# internal +from models.model_view_base import Model_View_Base +# from routes import bp_home +# external + +class Model_View_Privacy_Policy(Model_View_Base): + @property + def title(self): + return 'Privacy Policy' + def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_PRIVACY_POLICY): + super().__init__(hash_page_current=hash_page_current) + \ No newline at end of file diff --git a/models/model_view_retention_schedule.py b/models/model_view_retention_schedule.py new file mode 100644 index 00000000..3f28d209 --- /dev/null +++ b/models/model_view_retention_schedule.py @@ -0,0 +1,24 @@ +""" +Project: PARTS Website +Author: Edward Middleton-Smith + Precision And Research Technology Systems Limited + +Technology: Legal View Models +Feature: Retention Schedule View Model + +Description: +Data model for retention schedule view +""" + +# internal +from models.model_view_base import Model_View_Base +# from routes import bp_home +# external + +class Model_View_Retention_Schedule(Model_View_Base): + @property + def title(self): + return 'Retention Schedule' + def __init__(self, hash_page_current=Model_View_Base.HASH_PAGE_DATA_RETENTION_SCHEDULE): + super().__init__(hash_page_current=hash_page_current) + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5336a642..02310043 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "ISC", "devDependencies": { "@babel/core": "^7.25.2", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.25.4", "babel-loader": "^9.1.3", "css-loader": "^7.1.2", diff --git a/package.json b/package.json index dcb42acc..9aa4ab71 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/Teddy-1024/parts_website#readme", "devDependencies": { "@babel/core": "^7.25.2", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/preset-env": "^7.25.4", "babel-loader": "^9.1.3", "css-loader": "^7.1.2", diff --git a/routing/__pycache__/legal.cpython-312.pyc b/routing/__pycache__/legal.cpython-312.pyc index 94783a90fe60314f1d0a228615d55d885ca8f7e8..d5267cf64dcd4b264fc8666b170a08b6f48de3ed 100644 GIT binary patch delta 1530 zcmah{TWcFf6yC8Uue7?Yt=meztz|{>#!bM8$) zn#(=RW;F%A{~rGN)#dcvoPqwj+nVjik>VmZP7`b#k4JWbsw|0FBJ{ z88++USvH5~B1f8Vi=1A+on7ojp;6<|d z&Bo9kMK|y2U!$KU#FwblKYI$NFyy?>ORT%{wP+Zn~8tB4b3f ze6q-`9?{fBG%LHRHMRE?1*kuHwd)dU-}K10_7%?|TRyQ+SRL`Maqo7=*|pcY)N^(r zI5!gf$Z?48dz&8hf?a!^^twC%O8r#IM$iceBU_R+bG2K0Q+%BS;Ptv&_J(tdxZ8A( z#C}Dl73VQ{Q=S3{Q=jcPq$f#X%n$he7@rr{6L)Hh5Uj)UF9Lk89K_>^@?*U|&>MTt z5=~^8;D$uwutkZuB=ZFc4FF$OFin%U#F9EwTY}SB>HZMlO}6s`eN}9#tH=^Rs(*Z8 zLJU$SVEg}+KnRPSL(jycXX48cIuGk`o%TRKCw@uFItR($U;n!L);i*G%BZ!0_TI6S z%LBbFa@uOig3x#Qc5m3xZWcBtC6+jVR^tTH)*{z|mjx8)?lq{&H)S|6In<3|e0-wd0_ zX(v9rA$t~D$Jydt)iC6YgpCt|Pf`UmHJ+X!}UtiUlwbb7OIGyOtWuDM^!>i!W2N5wC$}9Beu<_ zkd-Hdi6vni9bwqCY} zUc6Z&dh;r!9)yB_gnAHE(4YtZgO(} z5h#SxwUs7X^jmH_jC(%WjFWO8CDw<=X|PO}cbUQ(x5M*7@ta=#sE=&FOw>TRM2|^@ z!3fJ@f~IMbF}jCF@H%M>lSyhb8Se^(|0IHGaR$_adGX7!I{9EXT^Kq^+0*@Ho=Z&T zz4YnEao5Qb~IZXvG^cVdj&lGAj^iVsqNLtH{=IV6Y^;=C8oE4r0 zVX8RSb?Xa0cF1vs)dRlOC6GE*z1Y9#t@O+}R&;72Oj?%hHZ3bGVm3Ul9&Oe#o8f|s zQ8c{Ja9Z>AU`@#f9mUM?lp4*GB$$)7ZeV0tWPrH>ahH5V*mR>Y6E>viQKKd|xjpK0 y(ckb}oTUxWH@`$!?|?2ZMR6w%0N9Pmfd5tE!1?do*gnsJJF)%XtGdU}(zL&BhwMrK diff --git a/routing/legal.py b/routing/legal.py index 78557d9c..af249a79 100644 --- a/routing/legal.py +++ b/routing/legal.py @@ -12,7 +12,12 @@ Initializes the Flask application, sets the configuration based on the environme # IMPORTS # internal -from models.model_view_home import Model_View_Home +# from models.model_view_home import Model_View_Home +from models.model_view_license import Model_View_License +from models.model_view_privacy_policy import Model_View_Privacy_Policy +from models.model_view_accessibility_report import Model_View_Accessibility_Report +from models.model_view_accessibility_statement import Model_View_Accessibility_Statement +from models.model_view_retention_schedule import Model_View_Retention_Schedule import lib.argument_validation as av # external from flask import Flask, render_template, jsonify, request, render_template_string, send_from_directory, redirect, url_for, session, Blueprint, current_app @@ -29,7 +34,7 @@ routes_legal = Blueprint('routes_legal', __name__) @routes_legal.route('/license', methods=['GET']) def license(): try: - model = Model_View_Home() + model = Model_View_License() html_body = render_template('pages/legal/_license.html', model = model) except Exception as e: return str(e) @@ -37,7 +42,7 @@ def license(): @routes_legal.route('/accessibility-statement', methods=['GET']) def accessibility_statement(): try: - model = Model_View_Home() + model = Model_View_Accessibility_Statement() html_body = render_template('pages/legal/_accessibility_statement.html', model = model) except Exception as e: return str(e) @@ -45,7 +50,7 @@ def accessibility_statement(): @routes_legal.route('/accessibility-report', methods=['GET']) def accessibility_report(): try: - model = Model_View_Home() + model = Model_View_Accessibility_Report() html_body = render_template('pages/legal/_accessibility_report.html', model = model) except Exception as e: return str(e) @@ -53,16 +58,16 @@ def accessibility_report(): @routes_legal.route('/retention-schedule', methods=['GET']) def retention_schedule(): try: - model = Model_View_Home() + model = Model_View_Retention_Schedule() html_body = render_template('pages/legal/_retention_schedule.html', model = model) except Exception as e: return str(e) return html_body -@routes_legal.route('/privacy-notice', methods=['GET']) -def privacy_notice(): +@routes_legal.route('/privacy-policy', methods=['GET']) +def privacy_policy(): try: - model = Model_View_Home() - html_body = render_template('pages/legal/_privacy_notice.html', model = model) + model = Model_View_Privacy_Policy() + html_body = render_template('pages/legal/_privacy_policy.html', model = model) except Exception as e: return str(e) return html_body diff --git a/static/css/pages/legal/accessibility_statement.css b/static/css/pages/legal/accessibility_statement.css new file mode 100644 index 00000000..e69de29b diff --git a/static/css/pages/legal/privacy_policy.css b/static/css/pages/legal/privacy_policy.css new file mode 100644 index 00000000..e69de29b diff --git a/static/css/pages/legal/retention_schedule.css b/static/css/pages/legal/retention_schedule.css new file mode 100644 index 00000000..e69de29b diff --git a/static/css/sections/legal.css b/static/css/sections/legal.css new file mode 100644 index 00000000..e69de29b diff --git a/static/dist/css/466.bundle.css b/static/dist/css/466.bundle.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/static/dist/css/466.bundle.css @@ -0,0 +1 @@ + diff --git a/static/dist/css/admin_home.css b/static/dist/css/core_admin_home.bundle.css similarity index 98% rename from static/dist/css/admin_home.css rename to static/dist/css/core_admin_home.bundle.css index 07007720..fc71cd32 100644 --- a/static/dist/css/admin_home.css +++ b/static/dist/css/core_admin_home.bundle.css @@ -1,4 +1,3 @@ - #pageBody > .card:first-of-type { width: 80%; } diff --git a/static/dist/css/contact.css b/static/dist/css/core_contact.bundle.css similarity index 99% rename from static/dist/css/contact.css rename to static/dist/css/core_contact.bundle.css index 6c6200d9..683102e7 100644 --- a/static/dist/css/contact.css +++ b/static/dist/css/core_contact.bundle.css @@ -1,5 +1,4 @@ - #pageBody > .card:first-of-type{ flex-grow: 1; } diff --git a/static/dist/css/home.css b/static/dist/css/core_home.bundle.css similarity index 73% rename from static/dist/css/home.css rename to static/dist/css/core_home.bundle.css index cd418281..281052e4 100644 --- a/static/dist/css/home.css +++ b/static/dist/css/core_home.bundle.css @@ -1,6 +1,5 @@ - -.page-body > * { +#pageBody > * { height: 100%; } #pageBody > * :first-child{ @@ -24,3 +23,11 @@ img { background-image: url("/static/images/Tag_Molly1.png"); } */ + +#pageBody h2 { + width: 100%; +} +#pageBody button.navContact { + width: fit-content; +} + diff --git a/static/dist/css/services.css b/static/dist/css/core_services.bundle.css similarity index 99% rename from static/dist/css/services.css rename to static/dist/css/core_services.bundle.css index e09e4c73..ae3f57de 100644 --- a/static/dist/css/services.css +++ b/static/dist/css/core_services.bundle.css @@ -1,4 +1,3 @@ - #pageBody > .card { padding-left: 5vw; padding-right: 5vw; diff --git a/static/dist/css/legal_accessibility_statement.bundle.css b/static/dist/css/legal_accessibility_statement.bundle.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/static/dist/css/legal_accessibility_statement.bundle.css @@ -0,0 +1 @@ + diff --git a/static/dist/css/legal_accessibility_statement.css b/static/dist/css/legal_accessibility_statement.css new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/static/dist/css/legal_accessibility_statement.css @@ -0,0 +1,2 @@ + + diff --git a/static/dist/css/license.css b/static/dist/css/legal_license.bundle.css similarity index 98% rename from static/dist/css/license.css rename to static/dist/css/legal_license.bundle.css index 21efab32..a3773060 100644 --- a/static/dist/css/license.css +++ b/static/dist/css/legal_license.bundle.css @@ -1,5 +1,4 @@ - .page-body > * { } #pageBody > * :first-child{ diff --git a/static/dist/css/legal_privacy_policy.bundle.css b/static/dist/css/legal_privacy_policy.bundle.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/static/dist/css/legal_privacy_policy.bundle.css @@ -0,0 +1 @@ + diff --git a/static/dist/css/legal_privacy_policy.css b/static/dist/css/legal_privacy_policy.css new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/static/dist/css/legal_privacy_policy.css @@ -0,0 +1,2 @@ + + diff --git a/static/dist/css/legal_retention_schedule.bundle.css b/static/dist/css/legal_retention_schedule.bundle.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/static/dist/css/legal_retention_schedule.bundle.css @@ -0,0 +1 @@ + diff --git a/static/dist/css/legal_retention_schedule.css b/static/dist/css/legal_retention_schedule.css new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/static/dist/css/legal_retention_schedule.css @@ -0,0 +1,2 @@ + + diff --git a/static/dist/css/main.bundle.css b/static/dist/css/main.bundle.css new file mode 100644 index 00000000..7cebe8d8 --- /dev/null +++ b/static/dist/css/main.bundle.css @@ -0,0 +1,702 @@ + + + + + + + + + + + + +#overlayConfirm { + position: absolute; + left: 25vw; + width: 50vw; + height: 50vh; +} +.img-product { + max-width: 20vh; + max-height: 20vh; + border-radius: 3vh; + justify-self: left; +} + +.img-thumbnail { + max-width: 10vh; + max-height: 10vh; + border-radius: 3vh; + justify-self: left; +} + +.buttonAdd2Basket { + background-color: var(--c_blue_pastel); + color: var(--c_blue_dark); + border-color: var(--c_blue_dark); +} + +#buttonCheckout, .buttonBuyNow { + background-color: var(--c_purple_pastel); + color: var(--c_purple_dark); + border-color: var(--c_purple_dark); +} + +.button-increment, .button-decrement { + border: 2px solid darkgrey; + background-color: lightgray; + margin: 1vh 1vh; + width: 2.5vh; + height: 2.5vh; + border-radius: 1.25vh; + font-size: 2vh; +} + +.container-input > input { + padding: 0vh 1vh; + border-radius: 0.5vh; + max-width: 7vh; +} + +#basket { + max-width: 100%; +} + + + +/* Right column */ +.rightcolumn { + min-width: fit-content; +} + +/* +/* Base styles * +@import 'lib/reset.css'; +@import 'lib/typography.css'; +@import 'lib/variables.css'; +@import 'lib/utils.css'; + +/* Layout styles * +@import 'layouts/header.css'; +@import 'layouts/footer.css'; + +/* Component styles * +@import 'components/button.css'; +@import 'components/card.css'; +@import 'components/dialog.css'; +@import 'components/form.css'; +@import 'components/modal.css'; +@import 'components/navigation.css'; +@import 'components/overlay.css'; + +/* Section styles * +@import 'sections/store.css'; + +/* Page-specific styles * +@import 'pages/page_admin.css'; +@import 'pages/page_contact.css'; +@import 'pages/page_home.css'; +@import 'pages/page_license.css'; +@import 'pages/page_services.css'; +@import 'pages/page_store_home.css'; +@import 'pages/page_store_product_permutations.css'; +@import 'pages/page_store_stock_items.css'; +* + +/* Theme styles * +@import 'themes/light.css'; +/* Uncomment the line below to enable dark theme * +/* @import 'themes/dark.css'; * + + +*/ + +/* Custom styles */ +/* Add any custom styles or overrides here */ + +body { + /* Example of using a CSS variable defined in variables.css */ + background-color: var(--background-color); + color: var(--text-color); + font-family: var(--font-family-base); +} + +/* You can add more global styles here */ + + +:root { + /* Declare global variables */ + --c_purple: #5B29FF; + --c_purple_pastel: #D1D1FF; + --c_purple_light: #C6BDFF; + --c_purple_dark: #4700B3; + --c_blue: #0044FF; + --c_blue_pastel: #B8E0FF; + --c_blue_light: #73E8FF; + --c_blue_dark: #003ADB; +} + +*{ + /*box-sizing: border-box; */ + margin: 0; +} + +script, link { + display: none !important; +} + +html { + height: 100%; +} + +body { + font-family: Arial; + padding: 0; + margin: 0; + border: 0; + background: linear-gradient(to bottom right, var(--c_purple), #dc2430); /* var(--c_purple_pastel); */ + height: 100vh; + max-height: 100%; +} + +/* +h1, h2, h3, h4, h5, p, a, label { + display: flex; + margin: 0; + padding: 0; +} +*/ + +h1 { + font-size: 24px; +} + +h2 { + font-size: 22px; +} + +h3 { + font-size: 18px; + margin-top: 1vh; +} + +h4 { + font-size: 13px; + margin: 1vh; + text-align: center; + margin-left: auto; + margin-right: auto; +} + +h5 { + font-size: 11px; + margin: 1vh; +} + +/* Style the top navigation bar */ +.topnav { + /* overflow: hidden; */ + /* background-color: var(--c_purple); */ + border-bottom-left-radius: 2.5vh; + border-bottom-right-radius: 2.5vh; + display: flex; + flex-wrap: wrap; + flex: 1; + flex-direction: row; + font-weight: bold; + font-size: 1vh; + max-height: 15vh; + height: 15vh; + align-items: flex-start; +} + +/* Style the topnav links */ +.topnav a, .topnav label, .topnav p, .topnav h1 { + float: left; + display: flex; + color: white; + text-align: center; + /* padding: 14px 16px; */ + text-decoration: none; + width: 100%; + max-height: 15vh; + font-weight: normal; + /* font-size: 20px; */ + justify-content: center; +} +/* +.topnav a { + padding: 3vh 2vw; +} +*/ + +/* Change color on hover */ +.topnav a:hover { + background-color: var(--c_purple_light); + color: var(--c_purple_dark); +} + +.topnav > .container { + max-width: 50%; + height: 100%; + align-items: center; + align-self: center; + /* align-content: center; */ + /* width: fit-content; */ + display: flex; +} + +.topnav select { + padding: 1vh; + margin: 1vh; + border-radius: 1vh; + /* background-color: var(--c_purple_light); */ + color: var(--c_purple_dark); + border: 2px solid white; + font-weight: bold; + text-align: center; +} +.topnav select .collapsed { + width: 5vw; +} +.topnav select .expanded { + width: 25vw; +} + + +.company-name { + font-size: min(28px, calc(1vh * 7)); + color: white; +} +@media screen and (max-width: 450px) { + .company-name { + font-size: min(24px, calc(1vh * 7)); + } +} + + +#pageBody { + height: 69vh !important; + padding: 1vh; + padding-left: 1vw; + padding-right: 1vw; + margin: 1vh; + margin-left: 0; + margin-right: 0; + border: 0; + align-content: center; + justify-content: flex-start; + display: flex; + flex-direction: column; + align-items: flex-start; + overflow-y: auto; + overflow-x: hidden; + position: absolute; + width: 98vw; + +} + +.page-body > * { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + text-align: center; + width: 100%; + align-self: center; + font-size: min(20px, calc(1vh * 6)); +} +#pageBody > * > * { + width: 100%; + align-self: center; + padding-top: 1vh; + padding-bottom: 1vh; + color: var(--c_purple_dark); +} +#pageBody > .card { + height: fit-content; + margin-top: 1vh; +} +#pageBody > .card:first-of-type{ + margin-top: 0vh; + top: 0; +} +#pageBody > .card:last-of-type { + /* margin-bottom: 1vh; */ +} +/* Create two unequal columns that floats next to each other * +/* Left column * +.leftcolumn { + float: left; + width: 70%; + display: flex; + flex-wrap: wrap; + /* min-width: fit-content; * + align-items: center; + justify-content: center; +} + +/* Right column * +.rightcolumn { + float: left; + width: 30%; + display: flex; + flex-wrap: wrap; + /* min-width: fit-content; only on store?? * + /* background-color: #f1f1f1; * + padding-left: 20px; + height: fit-content; + align-items: center; + justify-content: center; +} +*/ + +/* Fake image */ +.fakeimg { + background-color: var(--c_purple_light); + width: 100%; + padding: 20px; +} + +img, video { + border-radius: 3vh; +} + +/* header image */ +img.header-logo { + max-height: 15vh; + max-width: 20vw; + cursor: pointer; + border-radius: 5vh !important; +} + +/* icon images */ +.img-icon { + max-width: 16vh; + max-height: 8vh; + border-radius: 0; +} + +.container-icon-label { + padding: 0; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + text-align: center; +} + +.container-icon-label > * { + display: inline-flex; + margin-left: 1vh; + margin-right: 1vh; +} + +.header > .container:first-of-type { + max-width: 25%; + justify-self: left; +} +.header > .container:last-of-type { + max-width: 75%; + justify-self: left; +} + +/* Add a card effect for articles */ +.card { + background-color: var(--c_purple_pastel); + padding: 1vh; + margin: 1vh; + display: flex !important; + flex-wrap: wrap; + align-items: center; + justify-content: center; + text-align: center; + border-radius: 4vh; + /* min-width: fit-content; */ + position: relative; + height: fit-content; + max-width: 80vw; + padding-left: 2.5vw; + padding-right: 2.5vw; +} + +.card.subcard { + margin-top: 0; +} + +.header.card { + border-radius: 2.5vh; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +.container { + flex: 1; + margin: 0px; + align-items: flex-start; + justify-content: flex-start; + text-align: flex-start; + /* max-width: 100%; */ + /* min-width: fit-content; */ +} + +.column { + display: flex; + flex-direction: column; + align-items: center; +} + +.row { + display: flex; + flex-direction: row; + width: 100%; + /* min-width: fit-content; */ +} + +.container > .card:first-of-type { + margin-top: none; +} + + +/* Clear floats after the columns +.row:after { + content: ""; + display: table; + clear: both; +} +*/ +/* Footer */ +.footer { + padding: 1vh; + padding-left: 1vw; + padding-right: 1vw; + text-align: center; + margin: 0; + height: 8vh !important; + overflow-y: auto; + background-color: var(--c_purple_pastel); + border-top-left-radius: 2.5vh; + border-top-right-radius: 2.5vh; + position: absolute; + /* top: 2.5vh; */ + bottom: 0; + width: 98vw; +} + +.footer > h4, h5 { + padding: 0; + margin: 0; +} + +/* +/* Responsive layout - when the screen is less than 800px wide, make the two columns stack on top of each other instead of next to each other * +@media screen and (max-width: 800px) { + .leftcolumn, .rightcolumn { + width: 100%; + /* padding: 0; * + } +} + +/* Responsive layout - when the screen is less than 400px wide, make the navigation links stack on top of each other instead of next to each other * +@media screen and (max-width: 400px) { + .topnav a { + float: none; + width: 100%; + } +} +*/ + +/* input container + margin-top: 3vh; + */ +.container-input { + padding: 1vh; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + text-align: center; +} + +.container-input > label { + width: 100%; + margin-bottom: 1vh; + margin-top: 0; +} + +.container-input:not(:nth-child(3)) > label { + margin-top: 1vh; +} + +.container-input > input, .container-input > textarea { + border: 2px solid var(--c_purple); + max-width: 66%; + min-width: 20%; + padding: 1vh; +} + +.label-title { + width: 100%; +} + +button, .button-submit, input[type="submit"] { + font-size: 20px; + font-weight: bold; + border: 4px solid; + border-radius: 2vh; + padding: 1vh 2vh 1vh 2vh; + margin: 0.5vh; + /* + background-color: var(--c_blue_pastel); + color: var(--c_blue_dark); + border-color: var(--c_blue_dark); + */ + background-color: var(--c_purple_pastel); + color: var(--c_purple_dark); + border-color: var(--c_purple_dark); +} +button.navContactUs { + border: 4px solid var(--c_purple_dark); + background-color: var(--c_purple_pastel); + color: var(--c_purple_dark) !important; + border-radius: 2vh; + width: 180px !important; +} +button:hover, input[type="submit"]:hover, #overlayHamburger .row *:hover { + text-decoration: underline; +} +#buttonHamburger:hover { + text-decoration: none; +} + +.delete { + text-decoration: underline; +} + + +/* Overlay modal */ +.overlay { + /* + display: none; + */ + position: fixed; + top: 15vh; + right: 0; + width: 100px; + /* height: 50%; */ + background: var(--c_purple_pastel); + justify-content: right; + align-items: right; + align-self: right; + z-index: 999; +} +.overlay.expanded { + display: block !important; +} +.collapsed { + display: none !important; +} + +#overlayHamburger { + overflow-x: hidden; + overflow-y: auto; + max-height: 80%; +} +.hamburger { + border: 2px solid var(--c_purple_dark); + border-radius: 4px; +} +.hamburger:first-child { + border-top-left-radius: 12px; + border-top-right-radius: 12px; +} +.hamburger:last-child { + border-bottom-left-radius: 12px; + border-bottom-right-radius: 12px; +} + +.hamburger > * { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + text-align: center; + width: 100%; + color: var(--c_purple_dark); + font-weight: bold; + font-size: 18px; + /* height: 18px; */ +} +.hamburger > :hover { + background-color: var(--c_purple_light); + color: var(--c_purple_dark); +} +.hamburger > * > * { + width: 100%; + /* + margin-top: 4.5px; + margin-bottom: 4.5px; + */ +} +.hamburger > .container { + padding-top: 4.5px; + padding-bottom: 4.5px; +} + +ul { + max-width: 90%; +} +li { + text-align: left; + font-size: 18px; +} + + +.dirty { + /* color: var(--c_purple_dark); */ + border-color: var(--c_purple_dark); +} +td.dirty { + background-color: var(--c_purple_dark); +} + + +/* Tables */ +#pageBody > *, button { + font-size: min(14px, calc(1vh * 5)) !important; +} +thead, tbody { + padding-top: 0px !important; + padding-bottom: 0px !important; +} + +th { + +} +td { + font-size: min(14px, calc(1vh * 5)); +} + +th, td { + min-width: fit-content; +} +tr:not(:last-child) > td { + border-bottom: 1px dashed var(--c_purple_dark); +} +td > table > tbody > tr > td { + border: none !important; +} +tr { + min-height: 1px; + border-bottom: 1px solid var(--c_purple_dark); + border-top: 1px solid var(--c_purple_dark); + padding-bottom: 1vh; + background-color: transparent; +} + +/* +.row-new { + visibility: hidden; +} +*/ + diff --git a/static/dist/css/main.css b/static/dist/css/main.css index c1372452..7cebe8d8 100644 --- a/static/dist/css/main.css +++ b/static/dist/css/main.css @@ -69,13 +69,28 @@ min-width: fit-content; } -/* Base styles */ +/* +/* Base styles * +@import 'lib/reset.css'; +@import 'lib/typography.css'; +@import 'lib/variables.css'; +@import 'lib/utils.css'; -/* Layout styles */ +/* Layout styles * +@import 'layouts/header.css'; +@import 'layouts/footer.css'; -/* Component styles */ +/* Component styles * +@import 'components/button.css'; +@import 'components/card.css'; +@import 'components/dialog.css'; +@import 'components/form.css'; +@import 'components/modal.css'; +@import 'components/navigation.css'; +@import 'components/overlay.css'; -/* Section styles */ +/* Section styles * +@import 'sections/store.css'; /* Page-specific styles * @import 'pages/page_admin.css'; @@ -86,12 +101,15 @@ @import 'pages/page_store_home.css'; @import 'pages/page_store_product_permutations.css'; @import 'pages/page_store_stock_items.css'; -*/ +* /* Theme styles * @import 'themes/light.css'; -/* Uncomment the line below to enable dark theme */ -/* @import 'themes/dark.css'; */ +/* Uncomment the line below to enable dark theme * +/* @import 'themes/dark.css'; * + + +*/ /* Custom styles */ /* Add any custom styles or overrides here */ diff --git a/static/dist/css/store_home.bundle.css b/static/dist/css/store_home.bundle.css new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/static/dist/css/store_home.bundle.css @@ -0,0 +1 @@ + diff --git a/static/dist/css/store_product_categories.bundle.css b/static/dist/css/store_product_categories.bundle.css new file mode 100644 index 00000000..619f1e43 --- /dev/null +++ b/static/dist/css/store_product_categories.bundle.css @@ -0,0 +1,62 @@ + + +td.display-order, th.display-order { + width: 8% !important; +} +td.code, th.code { + width: 15% !important; +} +td.name, th.name { + width: 25% !important; +} +td.description, th.description { + width: 35% !important; +} +td.access_level, th.access_level { + width: 10% !important; +} +td.active, th.active { + width: 7% !important; +} + +/* +.row-new { + visibility: hidden; +} +*/ + +textarea { + width: 95% !important; +} + +select { + width: 100% !important; +} + +input { + width: 90% !important; +} + +td > input, td > select, td > textarea, .container-input > input, .container-input > select, .container-input > textarea { + border: 2px solid var(--c_purple); + border-radius: 0.5vh; +} + +#tableMain tbody tr td button { + padding: 0; + border: 0; + margin: 0; + text-decoration: none; +} + +#tableMain tbody tr td table thead tr th.id_variation_type, #tableMain tbody tr td table tbody tr td.id_variation_type, #tableMain tbody tr td table thead tr th.id_variation, #tableMain tbody tr td table tbody tr td.id_variation { + width: 47.5%; +} + + +/* +select.id_variation, select.id_variation_type { + max-width: 40% !important; +} +*/ + diff --git a/static/dist/css/store_product_permutations.bundle.css b/static/dist/css/store_product_permutations.bundle.css new file mode 100644 index 00000000..5fa4f30c --- /dev/null +++ b/static/dist/css/store_product_permutations.bundle.css @@ -0,0 +1,61 @@ + + +td.category, th.category { + width: 16% !important; +} +td.product, th.product { + width: 23% !important; +} +td.variations, th.variations { + width: 19% !important; +} +td.quantity-stock, th.quantity-stock { + width: 10% !important; +} +td.quantity-min, th.quantity-min { + width: 10% !important; +} +td.quantity-max, th.quantity-max { + width: 10% !important; +} +td.cost-local-VAT-incl, th.cost-local-VAT-incl { + width: 6% !important; +} +td.detail, th.detail { + width: 6% !important; +} + +textarea { + width: 95% !important; +} + +select { + width: 100% !important; +} + +input { + width: 90% !important; +} + +td > input, td > select, td > textarea, .container-input > input, .container-input > select, .container-input > textarea { + border: 2px solid var(--c_purple); + border-radius: 0.5vh; +} + +#tableMain tbody tr td button { + padding: 0; + border: 0; + margin: 0; + text-decoration: none; +} + +#tableMain tbody tr td table thead tr th.id_variation_type, #tableMain tbody tr td table tbody tr td.id_variation_type, #tableMain tbody tr td table thead tr th.id_variation, #tableMain tbody tr td table tbody tr td.id_variation { + width: 47.5%; +} + +/* +select.id_variation, select.id_variation_type { + max-width: 40% !important; +} +*/ + diff --git a/static/dist/css/store_stock_items.bundle.css b/static/dist/css/store_stock_items.bundle.css new file mode 100644 index 00000000..d9dbd18a --- /dev/null +++ b/static/dist/css/store_stock_items.bundle.css @@ -0,0 +1,40 @@ + +th, td { + min-width: fit-content; +} + + + +.category { + width: 12%; +} +.product { + width: 12%; +} +.variations { + width: 12%; +} +.currency { + width: 12%; +} +.cost-local-VAT-incl { + width: 10%; +} +.date-puchased, .date-received, .date-unsealed, .date-expiration, .date-consumed { + width: 6%; +} +.storage-location { + width: 12%; +} +.active { + width: 5%; +} + +.row-new { + visibility: hidden; +} + +textarea, select, input { + width: 100% !important; +} + diff --git a/static/dist/js/144.bundle.js b/static/dist/js/144.bundle.js deleted file mode 100644 index 38f60b16..00000000 --- a/static/dist/js/144.bundle.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[144],{243:(e,t,o)=>{o.d(t,{v:()=>c});var n=o(595),a=o(143),i=o(402);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function l(e,t){for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null==t&&(t=document.querySelector("form."+flagFilter+" button."+flagSave)),null==o&&(o=document.querySelector("form."+flagFilter+" button."+flagCancel)),e?(o.classList.remove(flagCollapsed),t.classList.remove(flagCollapsed)):(o.classList.add(flagCollapsed),t.classList.add(flagCollapsed))}}],r=[{key:"isDirtyFilter",value:function(e){var t=a.A.isElementDirty(e);return t&&document.querySelectorAll(idTableMain+" tbody tr").remove(),t}}],o&&l(t.prototype,o),r&&l(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,o,r}()},144:(e,t,o)=>{o.r(t),o.d(t,{PageStoreProductCategories:()=>L});var n=o(243),a=o(143);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function r(e,t){for(var o=0;o0&&void 0!==arguments[0]&&arguments[0];if(this.constructor===t)throw new Error("Must implement initialize() method.");if(o){var n=this.getLocalStoragePage()[flagFormFilters],i=this.getFormFilters(),r=a.A.convertForm2JSON(i);areEqualDicts(n,r)}else this.sharedInitialize(),this.hookupFilters(),this.hookupButtonsAddSaveCancel(),this.hookupTableMain(),hookupOverlayConfirm((function(){e.leave(),e.saveRecordsTableDirty()}))}},{key:"hookupFilters",value:function(){if(this.constructor===t)throw new Error("Subclass of TableBasePage must implement method hookupFilters().");this.hookupButtonApplyFilters()}},{key:"hookupFilterActive",value:function(){initialiseEventHandler(idFormFilters+"."+flagActive,flagInitialised,(function(e){e.addEventListener("change",(function(o){t.isDirtyFilter(e)}))}))}},{key:"hookupButtonApplyFilters",value:function(){var e=this;initialiseEventHandler(idButtonApplyFilters,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation(),e.getAndLoadFilteredTableContent()}))}))}},{key:"getAndLoadFilteredTableContent",value:function(){var e=this.getFormFilters(),t=a.A.convertForm2JSON(e);this.callFilterTableContent(t).catch((function(e){return console.error("Error:",e)}))}},{key:"getFormFilters",value:function(){return document.querySelector(idFormFilters)}},{key:"callbackLoadTableContent",value:function(e){this.getTableMain().querySelector("tbody").querySelectorAll("tr").forEach((function(e){e.remove()}));var t=e.data[flagRows];!isEmpty(t)&&t.every((function(e){return e.hasOwnProperty("display_order")}))&&(t=t.sort((function(e,t){return e.display_order-t.display_order}))),t.forEach(this.loadRowTable.bind(this)),this.hookupTableMain()}},{key:"getTableMain",value:function(){return document.querySelector(idTableMain)}},{key:"loadRowTable",value:function(e){throw new Error("Subclass of TableBasePage must implement method loadRowTable().")}},{key:"hookupButtonsAddSaveCancel",value:function(){this.hookupButtonSave(),this.hookupButtonCancel(),this.hookupButtonAddRowTable()}},{key:"saveRecordsTableDirty",value:function(){var e=this,t=this.getTableRecords(!0);if(0!=t.length){var o=this.getFormFilters(),n=a.A.getElementValueCurrent(document.querySelector(idTextareaConfirm));this.callSaveTableContent(t,o,n).then((function(t){t[flagStatus]==flagSuccess?(console.log("Data received:",t),e.callbackLoadTableContent(t),console.log("Records saved!")):showOverlayError(t[flagMessage])})).catch((function(e){return console.error("Error:",e)}))}else showOverlayError("No records to save")}},{key:"getTableRecords",value:function(){var e,t=this,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.getTableMain(),a=[];return n.querySelectorAll("tbody tr").forEach((function(n){o&&!n.classList.contains(flagDirty)||(e=t.getJsonRow(n),a.push(e))})),a}},{key:"getJsonRow",value:function(e){throw new Error("Subclass of TableBasePage must implement method getJsonRow().")}},{key:"hookupButtonCancel",value:function(){initialiseEventHandler(idFormFilters+" button."+flagCancel,flagInitialised,(function(e){e.addEventListener("click",(function(e){e.stopPropagation(),getAndLoadFilteredTableContent()})),e.classList.add(flagCollapsed)}))}},{key:"hookupButtonAddRowTable",value:function(){var e=this;initialiseEventHandler(idFormFilters+" button."+flagAdd,flagInitialised,(function(t){t.addEventListener("click",(function(t){t.stopPropagation();var o=document.querySelector(idTableMain+" tbody"),n=_rowBlank.cloneNode(!0);n.classList.remove(flagInitialised),n.querySelectorAll("."+flagInitialised).forEach((function(e){e.classList.remove(flagInitialised)}));var a=parseInt(o.querySelector("tr:last-child").querySelector("td."+flagDisplayOrder+" ."+flagSlider).getAttribute(attrValueCurrent))+1;o.appendChild(n);var i=o.querySelector("tr:last-child").querySelector("td."+flagDisplayOrder+" ."+flagSlider);i&&(i.setAttribute(attrValueCurrent,a),i.setAttribute(attrValuePrevious,a)),e.hookupTableMain()}))}))}},{key:"hookupTableMain",value:function(){if(this.constructor===t)throw new Error("Must implement hookupTableMain() method.");null==_rowBlank&&this.cacheRowBlank()}},{key:"cacheRowBlank",value:function(){var e=idTableMain+" tbody tr."+flagRowNew,t=document.querySelector(e);console.log("row blank temp: ",t),_rowBlank=t.cloneNode(!0),document.querySelectorAll(e).forEach((function(e){e.remove()}))}},{key:"hookupSlidersDisplayOrderTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagDisplayOrder+" input."+flagSlider+"."+flagDisplayOrder;initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(o){console.log("slider change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupTextareasCodeTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagCode+" textarea";initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(o){console.log("textarea change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"handleChangeElementCellTable",value:function(e){var t=a.A.getRowFromElement(e),o=a.A.getCellFromElement(e);console.log("td: ",o);var n=this.isDirtyRow(t),i=e.classList.contains(flagDirty),r=a.A.isElementDirty(e);if(console.log("isDirtyElement: ",r),console.log("wasDirtyElement: ",i),r!=i){a.A.handleDirtyElement(o,r);var l=this.isDirtyRow(t);if(console.log("isNowDirtyRow: ",l),console.log("wasDirtyRow: ",n),l!=n){a.A.handleDirtyElement(t,l);var s=this.getTableRecords(!0),c=s.length>0;console.log("dirty records:",s),console.log("existsDirtyRecord:",c),this.toggleShowButtonsSaveCancel(c)}}}},{key:"isDirtyRow",value:function(e){throw new Error("Subclass of TableBasePage must implement method isDirtyRow().")}},{key:"toggleShowButtonsSaveCancel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null==t&&(t=document.querySelector(idFormFilters+" button."+flagSave)),null==o&&(o=document.querySelector(idFormFilters+" button."+flagCancel)),e?(o.classList.remove(flagCollapsed),t.classList.remove(flagCollapsed)):(o.classList.add(flagCollapsed),t.classList.add(flagCollapsed))}},{key:"handleChangeSelectCellTable",value:function(e){var t=a.A.getRowFromElement(e),o=a.A.getCellFromElement(e);console.log("td: ",o);var n=this.isDirtyRow(t),i=e.classList.contains(flagDirty),r=a.A.isElementDirty(e);if(console.log("isDirtyElement: ",r),console.log("wasDirtyElement: ",i),r!=i){a.A.handleDirtyElement(o,r);var l=e.options[e.selectedIndex];o.setAttribute(attrIdAccessLevel,l.value),o.setAttribute(flagAccessLevelRequired,l.textcontent);var s=this.isDirtyRow(t);if(console.log("isNowDirtyRow: ",s),console.log("wasDirtyRow: ",n),s!=n){a.A.handleDirtyElement(t,s);var c=this.getTableRecords(!0),u=c.length>0;console.log("dirty records:",c),console.log("existsDirtyRecord:",u),this.toggleShowButtonsSaveCancel(u)}}}},{key:"hookupTextareasNameTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagName+" textarea";initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(o){console.log("textarea change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupTextareasDescriptionTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagDescription+" textarea";initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(o){console.log("textarea change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupInputsActiveTable",value:function(){var e=this,t=idTableMain+" tbody tr td."+flagActive+' input[type="checkbox"]';initialiseEventHandler(t,flagInitialised,(function(t){t.addEventListener("change",(function(o){console.log("input change event"),e.handleChangeElementCellTable(t)}))}))}},{key:"hookupTdsAccessLevel",value:function(){var e=this;initialiseEventHandler(idTableMain+" tbody td."+flagAccessLevel,flagInitialised,(function(t){t.addEventListener("click",(function(t){e.handleClickTdAccessLevel(t)}))}))}},{key:"handleClickTdAccessLevel",value:function(e){console.log("tdAccessLevel clicked"),e.stopPropagation();var t=a.A.getCellFromElement(e.target);console.log("tdAccessLevel: ",t);var o=a.A.getRowFromElement(t),n=t.querySelector("div."+flagAccessLevel).getAttribute(attrIdAccessLevel),i=document.createElement("select");i.classList.add(flagAccessLevel),i.setAttribute(attrValueCurrent,n),i.setAttribute(attrValuePrevious,n),optionsAccessLevel.forEach((function(e){var t=document.createElement("option");t.value=e.value,t.textContent=e.text,e.value==n&&(t.selected=!0),i.appendChild(t)}));var r=t.cloneNode(!0);r.innerHTML="",r.appendChild(i),o.replaceChild(r,t),this.hookupDdlsAccessLevelTable()}},{key:"hookupDdlsAccessLevelTable",value:function(){var e=this;initialiseEventHandler(idTableMain+" tbody select."+flagAccessLevel,flagInitialised,(function(t){t.addEventListener("change",(function(o){o.stopPropagation(),e.handleChangeDdlAccessLevelTable(t)}))}))}},{key:"handleChangeDdlAccessLevelTable",value:function(e){var t=a.A.getRowFromElement(e),o=a.A.getCellFromElement(e);console.log("td: ",o);var n=this.isDirtyRow(t),i=e.classList.contains(flagDirty),r=a.A.isElementDirty(e);if(console.log("isDirtyElement: ",r),console.log("wasDirtyElement: ",i),r!=i){a.A.handleDirtyElement(o,r);var l=e.options[e.selectedIndex];o.setAttribute(attrIdAccessLevel,l.value),o.setAttribute(flagAccessLevelRequired,l.textcontent);var s=this.isDirtyRow(t);if(console.log("isNowDirtyRow: ",s),console.log("wasDirtyRow: ",n),s!=n){a.A.handleDirtyElement(t,s);var c=this.getTableRecords(!0),u=c.length>0;console.log("dirty records:",c),console.log("existsDirtyRecord:",u),this.toggleShowButtonsSaveCancel(u)}}}},{key:"leave",value:function(){if(this.constructor===t)throw new Error("Must implement leave() method.");var e,o,n;(e=t,o=this,"function"==typeof(n=u(f(1&3?e.prototype:e),"leave",o))?function(e){return n.apply(o,e)}:n)([]);var i=this.getFormFilters(),r={};r[flagFormFilters]=a.A.convertForm2JSON(i),this.setLocalStoragePage(r),_rowBlank=null}}],i=[{key:"isDirtyFilter",value:function(e){var t=a.A.isElementDirty(e);if(t){var o=document.querySelector(idTableMain+" tbody");o.querySelectorAll("tr").remove(),o.appendChild(document.createElement('
Press "Apply Filters" to refresh the table.
'))}return t}}],n&&r(o.prototype,n),i&&r(o,i),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,n,i}(n.v),g=o(595);function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function y(e,t){for(var o=0;o{a.d(e,{v:()=>c});var n=a(595),o=a(143),i=a(402);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function l(t,e){for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;null==e&&(e=document.querySelector("form."+flagFilter+" button."+flagSave)),null==a&&(a=document.querySelector("form."+flagFilter+" button."+flagCancel)),t?(a.classList.remove(flagCollapsed),e.classList.remove(flagCollapsed)):(a.classList.add(flagCollapsed),e.classList.add(flagCollapsed))}}],r=[{key:"isDirtyFilter",value:function(t){var e=o.A.isElementDirty(t);return e&&document.querySelectorAll(idTableMain+" tbody tr").remove(),e}}],a&&l(e.prototype,a),r&&l(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,a,r}()},17:(t,e,a)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var a=0;af});var f=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,e)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(e,t),a=e,n=[{key:"initialize",value:function(){this.sharedInitialize(),hookupFilters(),hookupButtonsSaveCancel(),hookupTableMain(),hookupOverlayConfirm(savePermutations)}},{key:"hookupFilters",value:function(){initialiseEventHandler(idFilterCategory,flagInitialised,(function(t){console.log("hooking up filter category"),t.addEventListener("change",(function(t){loadPermutations()})),console.log("hooked up filter category")})),initialiseEventHandler(idFilterProduct,flagInitialised,(function(t){listProducts.forEach((function(e){e[attrIdCategory]==getElementCurrentValue(document.querySelectorAll(idFilterCategory))&&t.appendChild(document.createElement("