forked from MarseyWorld/MarseyWorld
specify the type of color code we want
parent
691857b805
commit
ce0b141325
|
@ -315,7 +315,7 @@ def namecolor(v):
|
||||||
if color.startswith('#'): color = color[1:]
|
if color.startswith('#'): color = color[1:]
|
||||||
|
|
||||||
if not color_regex.fullmatch(color):
|
if not color_regex.fullmatch(color):
|
||||||
return render_template("settings_profile.html", v=v, error="Invalid color code")
|
return render_template("settings_profile.html", v=v, error="Invalid color hex code")
|
||||||
|
|
||||||
v.namecolor = color
|
v.namecolor = color
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
@ -331,7 +331,7 @@ def themecolor(v):
|
||||||
if themecolor.startswith('#'): themecolor = themecolor[1:]
|
if themecolor.startswith('#'): themecolor = themecolor[1:]
|
||||||
|
|
||||||
if not color_regex.fullmatch(themecolor):
|
if not color_regex.fullmatch(themecolor):
|
||||||
return render_template("settings_profile.html", v=v, error="Invalid color code")
|
return render_template("settings_profile.html", v=v, error="Invalid color hex code")
|
||||||
|
|
||||||
v.themecolor = themecolor
|
v.themecolor = themecolor
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
@ -384,7 +384,7 @@ def titlecolor(v):
|
||||||
if titlecolor.startswith('#'): titlecolor = titlecolor[1:]
|
if titlecolor.startswith('#'): titlecolor = titlecolor[1:]
|
||||||
|
|
||||||
if not color_regex.fullmatch(titlecolor):
|
if not color_regex.fullmatch(titlecolor):
|
||||||
return render_template("settings_profile.html", v=v, error="Invalid color code")
|
return render_template("settings_profile.html", v=v, error="Invalid color hex code")
|
||||||
v.titlecolor = titlecolor
|
v.titlecolor = titlecolor
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
return redirect("/settings/profile")
|
return redirect("/settings/profile")
|
||||||
|
@ -396,7 +396,7 @@ def titlecolor(v):
|
||||||
def verifiedcolor(v):
|
def verifiedcolor(v):
|
||||||
verifiedcolor = str(request.values.get("verifiedcolor", "")).strip()
|
verifiedcolor = str(request.values.get("verifiedcolor", "")).strip()
|
||||||
if verifiedcolor.startswith('#'): verifiedcolor = verifiedcolor[1:]
|
if verifiedcolor.startswith('#'): verifiedcolor = verifiedcolor[1:]
|
||||||
if len(verifiedcolor) != 6: return render_template("settings_profile.html", v=v, error="Invalid color code")
|
if len(verifiedcolor) != 6: return render_template("settings_profile.html", v=v, error="Invalid color hex code")
|
||||||
v.verifiedcolor = verifiedcolor
|
v.verifiedcolor = verifiedcolor
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
return redirect("/settings/profile")
|
return redirect("/settings/profile")
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="text-small mb-2">Or type a color code:</p>
|
<p class="text-small mb-2">Or type a color hex code:</p>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<form action="/settings/themecolor" id="color-code-form" method="post">
|
<form action="/settings/themecolor" id="color-code-form" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
@ -451,7 +451,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="text-small mb-2">Or type a color code:</p>
|
<p class="text-small mb-2">Or type a color hex code:</p>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<form action="/settings/namecolor" id="color-code-form" method="post">
|
<form action="/settings/namecolor" id="color-code-form" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
@ -528,7 +528,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="text-small mb-2">Or type a color code:</p>
|
<p class="text-small mb-2">Or type a color hex code:</p>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<form action="/settings/titlecolor" id="color-code-form" method="post">
|
<form action="/settings/titlecolor" id="color-code-form" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
@ -571,7 +571,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="text-small mb-2">Or type a color code:</p>
|
<p class="text-small mb-2">Or type a color hex code:</p>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<form action="/settings/verifiedcolor" id="color-code-form" method="post">
|
<form action="/settings/verifiedcolor" id="color-code-form" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
|
Loading…
Reference in New Issue