Bezbednost: ispravke kontrole pristupa u admin i handler sloju
This commit is contained in:
@@ -4,11 +4,6 @@
|
||||
|
||||
{{define "dodatni-css"}}
|
||||
<style>
|
||||
@keyframes slideDown {
|
||||
from { opacity: 0; transform: translateY(-10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.poruka-animacija { animation: slideDown 0.3s ease forwards; }
|
||||
|
||||
.servis-tabela tbody tr:nth-child(1) { animation-delay: 0.04s; }
|
||||
@@ -78,14 +73,9 @@
|
||||
<div class="poruka-uspeh poruka-animacija">Nalog je uspešno obrisan.</div>
|
||||
{{end}}
|
||||
|
||||
<!-- gornja traka: dugme + pretraga + filter statusa -->
|
||||
<div style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;">
|
||||
<a href="/servis/novi"
|
||||
style="padding:8px 16px;background:var(--sb-akcent);color:#fff;border-radius:8px;font-size:14px;font-weight:500;text-decoration:none;white-space:nowrap;transition:opacity 0.2s;"
|
||||
onmouseover="this.style.opacity='0.85'" onmouseout="this.style.opacity='1'">
|
||||
+ Novi nalog
|
||||
</a>
|
||||
<form method="GET" action="/servis" style="display:flex;gap:8px;flex:1;flex-wrap:wrap;min-width:200px;">
|
||||
<!-- gornja traka: pretraga + dugme nova, ispod toga dugme traži -->
|
||||
<form method="GET" action="/servis" style="display:flex;flex-direction:column;gap:8px;">
|
||||
<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;">
|
||||
<input type="text" name="pretraga" value="{{.Pretraga}}"
|
||||
placeholder="Pretraži po broju naloga ili uređaju..."
|
||||
style="flex:1;min-width:160px;">
|
||||
@@ -95,11 +85,12 @@
|
||||
<option value="{{.}}" {{if eq . $.FilterStatus}}selected{{end}}>{{.}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
<button type="submit" class="btn-primarno">
|
||||
Traži
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<a href="/servis/novi" class="btn-primarno" style="white-space:nowrap;flex-shrink:0;">+ Novi nalog</a>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn-primarno" style="white-space:nowrap;">Traži</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- desktop tabela -->
|
||||
<div class="kartica servis-tabela animiraj" style="padding:0;overflow:hidden;">
|
||||
@@ -117,14 +108,10 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Nalozi}}
|
||||
<tr class="animiraj" style="border-bottom:0.5px solid var(--ivica);transition:background 0.15s;"
|
||||
onmouseover="this.style.background='var(--pozadina)'"
|
||||
onmouseout="this.style.background=''">
|
||||
<tr class="animiraj red-tabele">
|
||||
<td style="padding:12px 16px;">
|
||||
<a href="/servis/{{.ID}}"
|
||||
style="font-size:14px;font-weight:500;color:var(--sb-akcent);text-decoration:none;font-family:monospace;"
|
||||
onmouseover="this.style.textDecoration='underline'"
|
||||
onmouseout="this.style.textDecoration='none'">
|
||||
style="font-size:14px;font-weight:500;color:var(--sb-akcent);text-decoration:none;font-family:monospace;">
|
||||
{{.BrojNaloga}}
|
||||
</a>
|
||||
</td>
|
||||
@@ -143,14 +130,14 @@
|
||||
<a href="/servis/izmeni/{{.ID}}" class="btn-primarno-malo">
|
||||
Izmeni
|
||||
</a>
|
||||
{{if index $.Dozvole "servis.obrisi"}}
|
||||
<form method="POST" action="/servis/obrisi/{{.ID}}" style="display:inline;">
|
||||
<button type="submit"
|
||||
onclick="return confirm('Da li ste sigurni da želite da obrišete nalog {{.BrojNaloga}}?')"
|
||||
style="padding:4px 10px;background:#dc2626;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;transition:opacity 0.2s;"
|
||||
onmouseover="this.style.opacity='0.8'" onmouseout="this.style.opacity='1'">
|
||||
<button type="submit" class="btn-obrisi-malo"
|
||||
data-potvrda="Da li ste sigurni da želite da obrišete nalog {{.BrojNaloga}}?">
|
||||
Obriši
|
||||
</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -196,13 +183,14 @@
|
||||
<a href="/servis/izmeni/{{.ID}}" class="btn-primarno-malo">
|
||||
Izmeni
|
||||
</a>
|
||||
{{if index $.Dozvole "servis.obrisi"}}
|
||||
<form method="POST" action="/servis/obrisi/{{.ID}}" style="display:inline;">
|
||||
<button type="submit"
|
||||
onclick="return confirm('Da li ste sigurni da želite da obrišete nalog {{.BrojNaloga}}?')"
|
||||
style="padding:6px 14px;background:#dc2626;color:#fff;border:none;border-radius:6px;font-size:13px;cursor:pointer;">
|
||||
<button type="submit" class="btn-obrisi-malo"
|
||||
data-potvrda="Da li ste sigurni da želite da obrišete nalog {{.BrojNaloga}}?">
|
||||
Obriši
|
||||
</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
|
||||
Reference in New Issue
Block a user