Added expert review/edit document
This commit is contained in:
56
backend/core/templates/admin/core/document/change_form.html
Normal file
56
backend/core/templates/admin/core/document/change_form.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{% extends "admin/change_form.html" %}
|
||||
{% load i18n admin_urls static admin_list %}
|
||||
|
||||
{% block extrastyle %}
|
||||
{{ block.super }}
|
||||
<style>
|
||||
/* Keep page within viewport and allow horizontal scroll for wide tables */
|
||||
.change-form { max-width: 100%; overflow-x: hidden; }
|
||||
.inline-group { overflow-x: auto; }
|
||||
.inline-group table { table-layout: fixed; width: 100%; }
|
||||
.inline-group table th, .inline-group table td { white-space: nowrap; }
|
||||
/* Make textareas fill width */
|
||||
textarea { width: 100% !important; min-height: 120px; }
|
||||
/* Adjust numeric inputs smaller */
|
||||
input[type=number] { width: 90px; }
|
||||
/* Make select boxes reasonable width */
|
||||
.related-widget-wrapper select, select { min-width: 260px; }
|
||||
.inline-action { margin: 8px 0 16px; }
|
||||
/* Green Save & Send button */
|
||||
.btn-save-send { background-color: #28a745 !important; border-color: #28a745 !important; color: #fff !important; }
|
||||
.btn-save-send:hover, .btn-save-send:focus { background-color: #218838 !important; border-color: #1e7e34 !important; color: #fff !important; }
|
||||
/* Hide labels (and colons) for regen action rows */
|
||||
.form-row.field-regen_controls_action label,
|
||||
.form-row.field-regen_keyfindings_action label,
|
||||
.form-row.field-regen_recommendations_action label { display: none; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2 style="margin-top:0">Review and Edit Document</h2>
|
||||
<p>Use the Regenerate buttons inside each section to update content. When ready, Save and Send.</p>
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block submit_buttons_bottom %}
|
||||
{{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ block.super }}
|
||||
<script>
|
||||
(function() {
|
||||
function addSaveSendButton() {
|
||||
document.querySelectorAll('.submit-row').forEach(function(row){
|
||||
var saveBtn = row.querySelector('input[name="_save"]');
|
||||
if (saveBtn && !row.querySelector('button[name="_save_send"]')) {
|
||||
saveBtn.insertAdjacentHTML('afterend', '\n<button type="submit" name="_save_send" class="button btn-save-send">Save and Send</button>');
|
||||
}
|
||||
});
|
||||
}
|
||||
addSaveSendButton();
|
||||
document.addEventListener('formset:added', addSaveSendButton);
|
||||
document.addEventListener('formset:removed', addSaveSendButton);
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user