{% extends "admin/change_form.html" %}

{% block after_related_objects %}
{{ block.super }}
<style>
.dolt-commit-btn {
    background: #275C3A;
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
    var row = document.querySelector('.submit-row');
    if (!row) return;
    var save = row.querySelector('[name=_save]');
    if (!save) return;
    var btn = document.createElement('input');
    btn.type = 'submit';
    btn.value = 'Save and commit';
    btn.name = '_save_and_commit';
    btn.className = 'dolt-commit-btn';
    btn.title = 'Save changes and create a Dolt commit';
    save.after(btn);
});
</script>
{% endblock %}
