SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 1a5789af authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add proofs toggle accessibility action

parent d7026b37
No related branches found
No related tags found
1 merge request!43Polish up new production page
...@@ -64,6 +64,17 @@ ...@@ -64,6 +64,17 @@
class="btn btn-sm btn-warning">Send proofs to authors</button> class="btn btn-sm btn-warning">Send proofs to authors</button>
</div> </div>
</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 %} {% endif %}
</div> </div>
......
...@@ -1103,7 +1103,16 @@ def toggle_accessibility(request, stream_id, version): ...@@ -1103,7 +1103,16 @@ def toggle_accessibility(request, stream_id, version):
proofs.accessible_for_authors = not proofs.accessible_for_authors proofs.accessible_for_authors = not proofs.accessible_for_authors
proofs.save() proofs.save()
messages.success(request, "Proofs accessibility updated.") 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() @is_production_user()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment