🔒 Repository is read-only – file editing is disabled.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
{% extends "base.html" %}{% block title %}Admin – {{ t('admin_commits_page') }}{% endblock %}
{% block content %}
{% include "admin/nav.html" %}
<div class="card" style="margin-bottom:1rem"><div class="card-header"><h2> {{ t('admin_commits_page') }} (recipes)</h2><a href="/admin">← {{ t('admin_back_panel') }}</a></div></div>
{% for c in commits %}
<div class="card" style="margin-bottom:0.5rem">
<div style="display:flex;justify-content:space-between;align-items:center;padding:0.5rem 1rem;background:#0d1117;border-bottom:1px solid var(--border)">
<span><code style="color:var(--accent)">{{ c.hash }}</code> <span class="text-muted">{{ c.date }}</span> – <strong>{{ c.author }}</strong></span>
<span style="display:flex;gap:0.3rem">
<form method="POST" action="/admin/commits/revert" onsubmit="return confirm('Revertować {{ c.hash }}?')" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="hash" value="{{ c.full_hash }}">
<button class="btn btn-sm" style="background:#f0883e;color:#000;border:none">↩ Revert</button>
</form>
<button class="btn btn-sm" style="background:var(--accent);color:#000;border:none" onclick="editMsg('{{ c.full_hash }}','{{ c.msg|escape }}')"> Edytuj</button>
<form method="POST" action="/admin/commits/delete" onsubmit="return confirm('USUNĄĆ commit {{ c.hash }}? Tej operacji NIE MOŻNA cofnąć!')" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="hash" value="{{ c.full_hash }}">
<button class="btn btn-sm" style="background:var(--red);color:#fff;border:none" title="Przywróć commit"><svg class="i16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"/><path d="M10 11v6M14 11v6"/></svg></button>
</form>
</span>
</div>
<div style="padding:0.5rem 1rem;font-size:0.85rem">{{ c.msg }}</div>
</div>
{% else %}<p class="text-muted">Brak commitów</p>{% endfor %}
<div id="edit-modal" style="display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);z-index:999;align-items:center;justify-content:center" onclick="this.style.display='none'">
<div style="background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:1.5rem;max-width:500px;width:90%" onclick="event.stopPropagation()">
<h3> Edytuj opis commita</h3>
<form method="POST" action="/admin/commits/edit">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="hash" id="edit-hash">
<textarea name="message" id="edit-msg" rows="3" style="width:100%;padding:0.5rem;background:#0d1117;border:1px solid var(--border);color:#fff;border-radius:var(--radius-sm);font-family:monospace;margin-bottom:0.5rem"></textarea>
<button class="btn btn-primary">Zapisz</button>
<button type="button" class="btn" style="background:var(--bg);border:1px solid var(--border);color:var(--fg)" onclick="document.getElementById('edit-modal').style.display='none'">Anuluj</button>
</form>
</div>
</div>
<script>
function editMsg(hash, msg) {
document.getElementById('edit-hash').value = hash;
document.getElementById('edit-msg').value = msg;
document.getElementById('edit-modal').style.display = 'flex';
}
</script>
{% endblock %}