forked from rDrama/rDrama
gffgfg
parent
cbcc93a0d2
commit
8a75cd07a8
|
@ -22,6 +22,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
id = Column(Integer, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
username = Column(String)
|
username = Column(String)
|
||||||
namecolor = Column(String, default='ff66ac')
|
namecolor = Column(String, default='ff66ac')
|
||||||
|
background = Column(String)
|
||||||
customtitle = Column(String)
|
customtitle = Column(String)
|
||||||
customtitleplain = Column(String)
|
customtitleplain = Column(String)
|
||||||
titlecolor = Column(String, default='ff66ac')
|
titlecolor = Column(String, default='ff66ac')
|
||||||
|
|
|
@ -22,6 +22,10 @@ COINS_NAME = environ.get("COINS_NAME").strip()
|
||||||
def settings_profile_post(v):
|
def settings_profile_post(v):
|
||||||
updated = False
|
updated = False
|
||||||
|
|
||||||
|
if request.values.get("background", v.background) != v.background:
|
||||||
|
updated = True
|
||||||
|
v.background= request.values.get("background", None)
|
||||||
|
|
||||||
if request.values.get("slurreplacer", v.slurreplacer) != v.slurreplacer:
|
if request.values.get("slurreplacer", v.slurreplacer) != v.slurreplacer:
|
||||||
updated = True
|
updated = True
|
||||||
v.slurreplacer = request.values.get("slurreplacer", None) == 'true'
|
v.slurreplacer = request.values.get("slurreplacer", None) == 'true'
|
||||||
|
|
|
@ -1001,8 +1001,9 @@
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="overflow-x: hidden;">
|
<body id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/custombackgrounds/{{ v.background }}){% endif %} no-repeat center center fixed">
|
||||||
<a href="https://secure.transequality.org/site/Donation2?df_id=1480"><img src="/assets/images/banner.png" width="100%"></a>
|
|
||||||
|
<a href="https://secure.transequality.org/site/Donation2?df_id=1480"><img src="/assets/images/banner.png" width="100%"></a>
|
||||||
|
|
||||||
{% include "header.html" %}
|
{% include "header.html" %}
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="settings">
|
<body id="settings" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/custombackgrounds/{{ v.background }}){% endif %} no-repeat center center fixed">
|
||||||
|
|
||||||
{% include "header.html" %}
|
{% include "header.html" %}
|
||||||
<!-- Page Content -->
|
<!-- Page Content -->
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="settings-guild">
|
<body id="settings-guild" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/custombackgrounds/{{ v.background }}){% endif %} no-repeat center center fixed">
|
||||||
|
|
||||||
{% include "header.html" %}
|
{% include "header.html" %}
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,107 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-lg-flex border-bottom">
|
||||||
|
<div class="title w-lg-25">
|
||||||
|
<label for="theme">Website Backgrounds</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="body w-lg-100">
|
||||||
|
<script>
|
||||||
|
function updatebgselection(){
|
||||||
|
var bgselector = document.getElementById("backgroundSelector");
|
||||||
|
var selection = bgselector.options[bgselector.selectedIndex].text;
|
||||||
|
|
||||||
|
//var paragraph = document.getElementById("testp");
|
||||||
|
//paragraph.innerHTML = selection;
|
||||||
|
|
||||||
|
const backgrounds = [
|
||||||
|
{
|
||||||
|
folder: "fantasy",
|
||||||
|
backgrounds:
|
||||||
|
[
|
||||||
|
"bg-1",
|
||||||
|
"bg-2",
|
||||||
|
"bg-3",
|
||||||
|
"bg-4",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
folder: "solarpunk",
|
||||||
|
backgrounds:
|
||||||
|
[
|
||||||
|
"bg-1",
|
||||||
|
"bg-2",
|
||||||
|
"bg-3",
|
||||||
|
"bg-4",
|
||||||
|
"bg-5",
|
||||||
|
"bg-6",
|
||||||
|
"bg-7",
|
||||||
|
"bg-8",
|
||||||
|
"bg-9",
|
||||||
|
"bg-10",
|
||||||
|
"bg-11",
|
||||||
|
"bg-12",
|
||||||
|
"bg-13",
|
||||||
|
"bg-14",
|
||||||
|
"bg-15",
|
||||||
|
"bg-16",
|
||||||
|
"bg-17",
|
||||||
|
"bg-18",
|
||||||
|
"bg-19",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
folder: "other",
|
||||||
|
backgrounds:
|
||||||
|
[
|
||||||
|
"bg-1",
|
||||||
|
"bg-2",
|
||||||
|
"bg-3",
|
||||||
|
"bg-4",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
folder: "pixelart",
|
||||||
|
backgrounds:
|
||||||
|
[
|
||||||
|
"bg-1",
|
||||||
|
"bg-2",
|
||||||
|
"bg-3",
|
||||||
|
"bg-4",
|
||||||
|
"bg-5",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
let bgContainer = document.getElementById(`bgcontainer`);
|
||||||
|
let str = '';
|
||||||
|
let bgsToDisplay = backgrounds[bgselector.selectedIndex].backgrounds;
|
||||||
|
let bgsDir = backgrounds[bgselector.selectedIndex].folder;
|
||||||
|
for (i=0; i < bgsToDisplay.length; i++) {
|
||||||
|
let onclickPost = bgsDir + "/" + bgsToDisplay[i];
|
||||||
|
str += `<button class="btn btn-secondary m-1 p-0" style="width:15rem; overflow: hidden;"><img style="padding:0.25rem; width: 15rem" src="/assets/images/custombackgrounds/${bgsDir}/${bgsToDisplay[i]}" alt="${bgsToDisplay[i]}-background" onclick="post('/settings/profile?background=${onclickPost}', function(){window.location.reload(true);})"/></button>`;
|
||||||
|
}
|
||||||
|
bgContainer.innerHTML = str;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<p>Change the background for the website.</p>
|
||||||
|
<div class="input-group mb2">
|
||||||
|
<select id='backgroundSelector' class="form-control" form="profile-settings" name="background" onchange="updatebgselection();">
|
||||||
|
{% for entry in ["fantasy", "solarpunk", "other", "pixelart"] %}
|
||||||
|
<option value="{{entry}}">
|
||||||
|
{{entry}}
|
||||||
|
</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex mt-2">
|
||||||
|
<!--<input class="btn btn-primary ml-auto" value="Load Backgrounds" onclick="updatebgselection();">-->
|
||||||
|
<a class="btn btn-primary ml-auto" id="loadBackgrounds" href="javascript:void(0)" onclick="updatebgselection()">Load Backgrounds</a>
|
||||||
|
</div>
|
||||||
|
<div id="bgcontainer"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2 class="h5">Profile Picture</h2>
|
<h2 class="h5">Profile Picture</h2>
|
||||||
|
|
||||||
|
|
|
@ -286,7 +286,7 @@
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="submit">
|
<body id="submit" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/custombackgrounds/{{ v.background }}){% endif %} no-repeat center center fixed">
|
||||||
|
|
||||||
<!-- Navigation -->
|
<!-- Navigation -->
|
||||||
{% include "header.html" %}
|
{% include "header.html" %}
|
||||||
|
|
Loading…
Reference in New Issue