Want to read activity

This commit is contained in:
Mouse Reeve 2020-11-06 09:07:04 -08:00
parent 8f5d6c11ef
commit 4ec6104cac
2 changed files with 16 additions and 6 deletions

View file

@ -58,7 +58,7 @@
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Reading "{{ book.title }}"</p>
<p class="modal-card-title">Started "{{ book.title }}"</p>
<label class="delete" for="start-reading-{{ uuid }}" aria-label="close"></label>
</header>
<form name="start-reading" action="/start-reading" method="post">
@ -74,12 +74,12 @@
</section>
<footer class="modal-card-foot">
<div class="columns">
<div class="column field is-grouped">
{% include 'snippets/privacy_select.html' %}
<div class="column field">
<label for="post-status">
<input type="checkbox" name="post-status" class="checkbox" checked>
Post to feed
</label>
{% include 'snippets/privacy_select.html' %}
</div>
<div class="column">
<button type="submit" class="button is-success">Save</button>
@ -123,12 +123,12 @@
</section>
<footer class="modal-card-foot">
<div class="columns">
<div class="column field is-grouped">
{% include 'snippets/privacy_select.html' %}
<div class="column field">
<label for="post-status">
<input type="checkbox" name="post-status" class="checkbox" checked>
Post to feed
</label>
{% include 'snippets/privacy_select.html' %}
</div>
<div class="column">
<button type="submit" class="button is-success">Save</button>

View file

@ -293,6 +293,16 @@ def shelve(request):
# this just means it isn't currently on the user's shelves
pass
outgoing.handle_shelve(request.user, book, desired_shelf)
# post about "want to read" shelves
if desired_shelf.identifier == 'to-read':
outgoing.handle_reading_status(
request.user,
desired_shelf,
book,
privacy='public'
)
return redirect('/')
@ -324,7 +334,7 @@ def start_reading(request):
if request.POST.get('reshelve', True):
try:
current_shelf = models.Shelf.objects.get(
user=request.user,
user=request.user,
edition=book
)
outgoing.handle_unshelve(request.user, book, current_shelf)