|
@@ -25,25 +25,33 @@ def change_colors(request):
|
|
form = ColorsForm(request.POST)
|
|
form = ColorsForm(request.POST)
|
|
if form.is_valid():
|
|
if form.is_valid():
|
|
btnBg = request.POST.get('btnBg')
|
|
btnBg = request.POST.get('btnBg')
|
|
- btnTxt = request.POST.get('btnTxt')
|
|
|
|
|
|
+ btnTxt = request.POST.get('btnTxt')
|
|
|
|
+ btnHover = request.POST.get('btnHover')
|
|
|
|
+ pillsBg = request.POST.get('pillsBg')
|
|
|
|
+ pillsTxt = request.POST.get('pillsTxt')
|
|
|
|
+ linksTxt = request.POST.get('linksTxt')
|
|
|
|
+ linksHover = request.POST.get('linksHover')
|
|
btnSuccessBg = request.POST.get('btnSuccessBg')
|
|
btnSuccessBg = request.POST.get('btnSuccessBg')
|
|
btnSuccessTxt = request.POST.get('btnSuccessTxt')
|
|
btnSuccessTxt = request.POST.get('btnSuccessTxt')
|
|
|
|
+ btnSuccessHover = request.POST.get('btnSuccessHover')
|
|
btnDangerBg = request.POST.get('btnDangerBg')
|
|
btnDangerBg = request.POST.get('btnDangerBg')
|
|
btnDangerTxt = request.POST.get('btnDangerTxt')
|
|
btnDangerTxt = request.POST.get('btnDangerTxt')
|
|
- pillsBg = request.POST.get('pillsBg')
|
|
|
|
- pillsTxt = request.POST.get('pillsTxt')
|
|
|
|
- linksTxt = request.POST.get('linksTxt')
|
|
|
|
|
|
+ btnDangerHover = request.POST.get('btnDangerHover')
|
|
css = f'''
|
|
css = f'''
|
|
:root{{
|
|
:root{{
|
|
--btn-bg-color: {btnBg};
|
|
--btn-bg-color: {btnBg};
|
|
--btn-txt-color: {btnTxt};
|
|
--btn-txt-color: {btnTxt};
|
|
|
|
+ --btn-hover-color: {btnHover};
|
|
--pills-bg-color: {pillsBg};
|
|
--pills-bg-color: {pillsBg};
|
|
--pills-txt-color: {pillsTxt};
|
|
--pills-txt-color: {pillsTxt};
|
|
- --links-txt-color: {linksTxt};
|
|
|
|
|
|
+ --links-txt-color: {linksTxt };
|
|
|
|
+ --links-hover-color: {linksHover};
|
|
--btn-success: {btnSuccessBg};
|
|
--btn-success: {btnSuccessBg};
|
|
--btn-success-txt: {btnSuccessTxt};
|
|
--btn-success-txt: {btnSuccessTxt};
|
|
|
|
+ --btn-success-hover: {btnSuccessHover};
|
|
--btn-danger: {btnDangerBg};
|
|
--btn-danger: {btnDangerBg};
|
|
--btn-danger-txt: {btnDangerTxt};
|
|
--btn-danger-txt: {btnDangerTxt};
|
|
|
|
+ --btn-danger-hover: {btnDangerHover};
|
|
}}
|
|
}}
|
|
|
|
|
|
.btn-primary, .btn-outline-primary{{
|
|
.btn-primary, .btn-outline-primary{{
|
|
@@ -52,6 +60,10 @@ def change_colors(request):
|
|
border-color: var(--btn-bg-color);
|
|
border-color: var(--btn-bg-color);
|
|
}}
|
|
}}
|
|
|
|
|
|
|
|
+.btn-primary, .btn-outline-primary:hover{{
|
|
|
|
+ color: var(--btn-hover-color);
|
|
|
|
+}}
|
|
|
|
+
|
|
.nav-pills .nav-link.active, .nav-pills .show>.nav-link{{
|
|
.nav-pills .nav-link.active, .nav-pills .show>.nav-link{{
|
|
background-color: var(--pills-bg-color);
|
|
background-color: var(--pills-bg-color);
|
|
color: var(--pills-txt-color);
|
|
color: var(--pills-txt-color);
|
|
@@ -61,21 +73,39 @@ a{{
|
|
color: var(--links-txt-color);
|
|
color: var(--links-txt-color);
|
|
}}
|
|
}}
|
|
|
|
|
|
|
|
+a:hover{{
|
|
|
|
+ color:var(--links-hover-color)
|
|
|
|
+}}
|
|
|
|
+
|
|
.nav-link{{
|
|
.nav-link{{
|
|
color: var(--links-txt-color)
|
|
color: var(--links-txt-color)
|
|
}}
|
|
}}
|
|
|
|
|
|
|
|
+.nav-link:hover{{
|
|
|
|
+ color:var(--links-hover-color)
|
|
|
|
+}}
|
|
|
|
+
|
|
.btn-success, .btn-outline-success{{
|
|
.btn-success, .btn-outline-success{{
|
|
color: var(--btn-txt-color);
|
|
color: var(--btn-txt-color);
|
|
background-color: var(--btn-success);
|
|
background-color: var(--btn-success);
|
|
border-color: var(--btn-success);
|
|
border-color: var(--btn-success);
|
|
}}
|
|
}}
|
|
|
|
|
|
|
|
+.btn-success, .btn-outline-success:hover{{
|
|
|
|
+ background-color: var(--btn-success-hover);
|
|
|
|
+ border-color: var(--btn-success-hover);
|
|
|
|
+}}
|
|
|
|
+
|
|
.btn-danger, .btn-outline-danger{{
|
|
.btn-danger, .btn-outline-danger{{
|
|
color: var(--btn-danger-txt);
|
|
color: var(--btn-danger-txt);
|
|
background-color: var(--btn-danger);
|
|
background-color: var(--btn-danger);
|
|
border-color: var(--btn-danger);
|
|
border-color: var(--btn-danger);
|
|
}}
|
|
}}
|
|
|
|
+
|
|
|
|
+.btn-danger, .btn-outline-danger:hover{{
|
|
|
|
+ background-color: var(--btn-danger-hover);
|
|
|
|
+ border-color: var(--btn-danger-hover);
|
|
|
|
+}}
|
|
'''
|
|
'''
|
|
with open("design_template/static/design_template/colors.css", 'r+', encoding='utf-8') as file:
|
|
with open("design_template/static/design_template/colors.css", 'r+', encoding='utf-8') as file:
|
|
file.write(css)
|
|
file.write(css)
|