mirror of
https://github.com/ivabus/www
synced 2024-11-22 12:55:07 +03:00
Moved auth data script to a partial; placed partial in <head>
This commit is contained in:
parent
df3f1fd4fa
commit
94bd1c97dc
3 changed files with 26 additions and 25 deletions
24
src/layouts/partials/auth-data-snippet.html
Normal file
24
src/layouts/partials/auth-data-snippet.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
try {
|
||||
fetch('https://app.tea.xyz/api/signups')
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
const signups = res.signups ? res.signups.toLocaleString() : ""
|
||||
if (!(localStorage['signup'] || '').match(/:::/)) {
|
||||
$('#count').html(signups)
|
||||
}
|
||||
$('#count1').html(signups)
|
||||
$('#count2').html(signups)
|
||||
$('#count3').html(signups)
|
||||
$('#count4').html(signups)
|
||||
$('#count5').html(signups)
|
||||
$('#count6').html(signups)
|
||||
$('#count7').html(signups)
|
||||
$('#stat-one').html(res.repos ? res.repos.toLocaleString() : "")
|
||||
$('#stat-one-small').html(res.repos ? res.repos.toLocaleString() : "")
|
||||
$('#stat-two').html(res.maintainers ? res.maintainers.toLocaleString() : "")
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
</script>
|
|
@ -73,31 +73,6 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
|
|||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
try {
|
||||
fetch('https://app.tea.xyz/api/signups')
|
||||
.then(res => res.json())
|
||||
.then(res => {
|
||||
const signups = res.signups ? res.signups.toLocaleString() : ""
|
||||
if (!(localStorage['signup'] || '').match(/:::/)) {
|
||||
$('#count').html(signups)
|
||||
}
|
||||
$('#count1').html(signups)
|
||||
$('#count2').html(signups)
|
||||
$('#count3').html(signups)
|
||||
$('#count4').html(signups)
|
||||
$('#count5').html(signups)
|
||||
$('#count6').html(signups)
|
||||
$('#count7').html(signups)
|
||||
$('#stat-one').html(res.repos ? res.repos.toLocaleString() : "")
|
||||
$('#stat-one-small').html(res.repos ? res.repos.toLocaleString() : "")
|
||||
$('#stat-two').html(res.maintainers ? res.maintainers.toLocaleString() : "")
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function(c,l,a,r,i,t,y){
|
||||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||
|
|
|
@ -105,6 +105,8 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
{{- partial "auth-data-snippet.html" -}}
|
||||
|
||||
{{- partial "floating-join-btn.html" . -}}
|
||||
|
||||
{{- partial "toast.html" -}}
|
||||
|
|
Loading…
Reference in a new issue