Added owner role, fixed reputation scaling
This commit is contained in:
parent
e9723303d8
commit
010bccc89d
3 changed files with 9 additions and 2 deletions
|
@ -39,7 +39,7 @@ let calcVote = function(up,down, type) {
|
||||||
rating = Math.round(rating * Math.log(totalPadded) * 10);
|
rating = Math.round(rating * Math.log(totalPadded) * 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rating * Math.log(totalPadded);
|
return rating;
|
||||||
}
|
}
|
||||||
|
|
||||||
let handleSubmit = async e => {
|
let handleSubmit = async e => {
|
||||||
|
|
|
@ -16,5 +16,8 @@ export async function load({ fetch, params, url }) {
|
||||||
const resUser = await fetch(`/api/userGet?user=${user}`);
|
const resUser = await fetch(`/api/userGet?user=${user}`);
|
||||||
const postJsonUser = (await resUser.json()) || {};
|
const postJsonUser = (await resUser.json()) || {};
|
||||||
|
|
||||||
return { postJson, id, postJsonUser, user };
|
const resUserBio = await fetch(`/api/userBio?user=${user}`);
|
||||||
|
const postJsonUserBio = (await resUserBio.json()) || {};
|
||||||
|
|
||||||
|
return { postJson, id, postJsonUser, postJsonUserBio, user };
|
||||||
}
|
}
|
|
@ -7,6 +7,7 @@
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
let userData = data.postJsonUser.data;
|
let userData = data.postJsonUser.data;
|
||||||
|
let userBio = data.postJsonUserBio.data;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if userData}
|
{#if userData}
|
||||||
|
@ -26,6 +27,9 @@
|
||||||
<p>
|
<p>
|
||||||
<b>Downvotes:</b> {userData.downvotes}
|
<b>Downvotes:</b> {userData.downvotes}
|
||||||
</p>
|
</p>
|
||||||
|
{#if userBio && userBio.roles == 69}
|
||||||
|
<p><b>This user is an Owner.</b></p>
|
||||||
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
<span slot="footer">
|
<span slot="footer">
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue