diff --git a/scipost_django/production/templates/production/_hx_productionstream_actions_proofs_item.html b/scipost_django/production/templates/production/_hx_productionstream_actions_proofs_item.html index 03b30ce8d96356399a6ebf4d5ddbb545c80aafe4..af0f23f1311205ec99b12a9a35bcc28deaba1dcb 100644 --- a/scipost_django/production/templates/production/_hx_productionstream_actions_proofs_item.html +++ b/scipost_django/production/templates/production/_hx_productionstream_actions_proofs_item.html @@ -64,6 +64,17 @@ class="btn btn-sm btn-warning">Send proofs to authors</button> </div> </div> + {% else %} + <div class="col-12 col-sm-6 col-md-12 col-lg-6 h-100 d-none-empty"> + <div class="row m-0 d-none-empty"> + <button hx-get="{% url 'production:toggle_accessibility' proofs.stream.id proofs.version %}" + hx-target="#productionstream-{{ stream.id }}-proofs-list-accordion-proofs-{{ proofs.version }}-item" + hx-swap="outerHTML" + class="btn btn-sm btn-primary"> + {{ proofs.accessible_for_authors|yesno:'Hide,Make accessible' }} for authors + </button> + </div> + </div> {% endif %} </div> diff --git a/scipost_django/production/views.py b/scipost_django/production/views.py index 5cc4eb4ad662bf11c2678c5d7053407bbc4c3923..02d8d929ff70d20128ff09b5e3de15843fcb4b66 100644 --- a/scipost_django/production/views.py +++ b/scipost_django/production/views.py @@ -1103,7 +1103,16 @@ def toggle_accessibility(request, stream_id, version): proofs.accessible_for_authors = not proofs.accessible_for_authors proofs.save() messages.success(request, "Proofs accessibility updated.") - return redirect(stream.get_absolute_url()) + return render( + request, + "production/_hx_productionstream_actions_proofs_item.html", + { + "stream": stream, + "proofs": proofs, + "total_proofs": stream.proofs.count(), + "active_id": proofs.version, + }, + ) @is_production_user()