Skip to content
Snippets Groups Projects
Commit 23f439f7 authored by Tóth Miklós Tibor's avatar Tóth Miklós Tibor :shrug:
Browse files

Fix some nil dereferences

parent f4dc2fce
No related branches found
No related tags found
No related merge requests found
Pipeline #9110 passed
......@@ -55,7 +55,7 @@
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ .User.SchAcc }}
</a>
<div class="dropdown-menu {{ if .User.Dark }} bg-dark {{ end }}" style="width: auto; min-width: auto" aria-labelledby="navbarDropdown">
<div class="dropdown-menu {{ if $dark }} bg-dark {{ end }}" style="width: auto; min-width: auto" aria-labelledby="navbarDropdown">
<a class="nav-link" href="/logout" style="padding: 1em; width: auto">Log out</a>
</div>
</li>
......@@ -67,7 +67,7 @@
</nav>
<div class="container" style="padding: 2em">
{{ if .User.SchAcc }}
{{ if .User }}
<div class="input-group mb-3">
<div class="input-group-prepend">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="langbutton">
......@@ -79,13 +79,13 @@
btn.innerText = lang;
}
</script>
<div class="dropdown-menu {{ if .User.Dark }} bg-dark text-white {{ end }}">
<div class="dropdown-menu {{ if $dark }} bg-dark text-white {{ end }}">
{{ range .Langs }}
<a class="dropdown-item {{ if $.User.Dark }} text-white {{ end }}" onclick="changeLanguage({{ . }})">{{ . }} ({{ .ESpeak }})</a>
<a class="dropdown-item {{ if $dark }} text-white {{ end }}" onclick="changeLanguage({{ . }})">{{ . }} ({{ .ESpeak }})</a>
{{ end }}
</div>
</div>
<input id="msg" type="text" class="form-control {{ if .User.Dark }} bg-secondary text-white {{ end }}" aria-label="Vox message">
<input id="msg" type="text" class="form-control {{ if $dark }} bg-secondary text-white {{ end }}" aria-label="Vox message">
<div class="input-group-append">
<button class="btn btn-primary" type="button" id="send">Küldés!</button>
</div>
......@@ -137,8 +137,8 @@
{{ if .Msgs }}
<div class="container">
<div class="card">
<div class="card-body" {{ if .User.Dark }} style="background: #545b62" {{ end }}>
<table class="table {{ if .User.Dark }} text-white {{ end }}">
<div class="card-body" {{ if $dark }} style="background: #545b62" {{ end }}>
<table class="table {{ if $dark }} text-white {{ end }}">
<thead>
<tr>
<th scope="row">Idő</th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment