forked from mirrors/bookwyrm
Adds standalone modal views for reading steps
This commit is contained in:
parent
b5d0a9e0b4
commit
3356c652ee
4 changed files with 45 additions and 1 deletions
14
bookwyrm/templates/reading_progress/finish.html
Normal file
14
bookwyrm/templates/reading_progress/finish.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{% extends 'layout.html' %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% blocktrans trimmed with book_title=book.title %}
|
||||||
|
Finish "{{ book_title }}"
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% include "snippets/shelve_button/finish_reading_modal.html" with book=book active=True %}
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -9,6 +9,6 @@ Start "{{ book_title }}"
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% include "snippets/shelve_button/start_reading_modal.html" active=True %}
|
{% include "snippets/shelve_button/start_reading_modal.html" with book=book active=True %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
14
bookwyrm/templates/reading_progress/want.html
Normal file
14
bookwyrm/templates/reading_progress/want.html
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{% extends 'layout.html' %}
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{% blocktrans trimmed with book_title=book.title %}
|
||||||
|
Want to Read "{{ book_title }}"
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% include "snippets/shelve_button/want_to_read_modal.html" with book=book active=True no_body=True %}
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -7,6 +7,7 @@ from dateutil.parser import ParserError
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.http import HttpResponseBadRequest, HttpResponseNotFound
|
from django.http import HttpResponseBadRequest, HttpResponseNotFound
|
||||||
from django.shortcuts import get_object_or_404, redirect
|
from django.shortcuts import get_object_or_404, redirect
|
||||||
|
from django.template.response import TemplateResponse
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
from django.views import View
|
from django.views import View
|
||||||
from django.views.decorators.http import require_POST
|
from django.views.decorators.http import require_POST
|
||||||
|
@ -20,6 +21,11 @@ from .helpers import get_edition, handle_reading_status
|
||||||
class WantToRead(View):
|
class WantToRead(View):
|
||||||
"""consider reading a book"""
|
"""consider reading a book"""
|
||||||
|
|
||||||
|
def get(self, request, book_id):
|
||||||
|
"""modal page"""
|
||||||
|
book = get_edition(book_id)
|
||||||
|
return TemplateResponse(request, "reading_progress/want.html", {"book": book})
|
||||||
|
|
||||||
def post(self, request, book_id):
|
def post(self, request, book_id):
|
||||||
"""desire a book"""
|
"""desire a book"""
|
||||||
desired_shelf = models.Shelf.objects.filter(
|
desired_shelf = models.Shelf.objects.filter(
|
||||||
|
@ -33,6 +39,11 @@ class WantToRead(View):
|
||||||
class StartReading(View):
|
class StartReading(View):
|
||||||
"""begin a book"""
|
"""begin a book"""
|
||||||
|
|
||||||
|
def get(self, request, book_id):
|
||||||
|
"""modal page"""
|
||||||
|
book = get_edition(book_id)
|
||||||
|
return TemplateResponse(request, "reading_progress/start.html", {"book": book})
|
||||||
|
|
||||||
def post(self, request, book_id):
|
def post(self, request, book_id):
|
||||||
"""begin reading a book"""
|
"""begin reading a book"""
|
||||||
desired_shelf = models.Shelf.objects.filter(
|
desired_shelf = models.Shelf.objects.filter(
|
||||||
|
@ -46,6 +57,11 @@ class StartReading(View):
|
||||||
class FinishReading(View):
|
class FinishReading(View):
|
||||||
"""finish a book"""
|
"""finish a book"""
|
||||||
|
|
||||||
|
def get(self, request, book_id):
|
||||||
|
"""modal page"""
|
||||||
|
book = get_edition(book_id)
|
||||||
|
return TemplateResponse(request, "reading_progress/finish.html", {"book": book})
|
||||||
|
|
||||||
def post(self, request, book_id):
|
def post(self, request, book_id):
|
||||||
"""a user completed a book, yay"""
|
"""a user completed a book, yay"""
|
||||||
desired_shelf = models.Shelf.objects.filter(
|
desired_shelf = models.Shelf.objects.filter(
|
||||||
|
|
Loading…
Reference in a new issue