2022-08-26 22:09:02 +03:00
|
|
|
<div class="footer">
|
2022-09-16 23:22:29 +03:00
|
|
|
<% if (user){ %>
|
2023-05-08 18:17:46 +03:00
|
|
|
<select id="theme_select">
|
|
|
|
<% for(const theme of dataset.themes){%>
|
|
|
|
<option value="<%= theme %>"><%= theme %> theme</option>
|
|
|
|
<% } %>
|
|
|
|
</select>
|
2022-09-16 23:22:29 +03:00
|
|
|
<script>
|
2023-05-08 18:17:46 +03:00
|
|
|
const theme_select = document.getElementById("theme_select");
|
|
|
|
theme_select.querySelector(`option[value=<%= user.theme.name %>]`).selected = true;
|
|
|
|
theme_select.addEventListener("change", async e => {
|
|
|
|
const name = e.target.value;
|
2022-09-16 23:22:29 +03:00
|
|
|
await fetch('/api/users/<%= user.id %>', {
|
|
|
|
method: 'PATCH',
|
|
|
|
body: JSON.stringify({
|
2023-05-08 18:17:46 +03:00
|
|
|
theme: {
|
|
|
|
name
|
|
|
|
}
|
2022-09-16 23:22:29 +03:00
|
|
|
}),
|
|
|
|
headers: {
|
|
|
|
"Content-Type": "application/json"
|
|
|
|
}
|
|
|
|
});
|
2023-05-08 18:17:46 +03:00
|
|
|
location.reload();
|
|
|
|
});
|
2022-09-16 23:22:29 +03:00
|
|
|
</script>
|
|
|
|
<% } %>
|
|
|
|
|
2022-09-09 15:10:44 +03:00
|
|
|
<a href="https://github.com/Akif9748/akf-forum" style="color: white;"> This website is powered by
|
2023-05-08 18:17:46 +03:00
|
|
|
<span style="color: #ffbf00;">akf-forum</span>
|
|
|
|
</a>
|
|
|
|
|
2022-09-09 15:10:44 +03:00
|
|
|
</div>
|