From 1d5d7f896584ef2b7619d14de3f0dcf64ce1cfc9 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 29 Sep 2020 21:45:59 -0700 Subject: [PATCH] Invites page --- bookwyrm/templates/import.html | 13 ++++-- bookwyrm/templates/layout.html | 8 +++- bookwyrm/templates/manage_invites.html | 57 ++++++++++++++++++-------- bookwyrm/templates/user.html | 6 ++- bookwyrm/urls.py | 2 +- bookwyrm/view_actions.py | 2 +- 6 files changed, 62 insertions(+), 26 deletions(-) diff --git a/bookwyrm/templates/import.html b/bookwyrm/templates/import.html index 6ea032a3..3b8708be 100644 --- a/bookwyrm/templates/import.html +++ b/bookwyrm/templates/import.html @@ -1,17 +1,22 @@ {% extends 'layout.html' %} {% load humanize %} {% block content %} -
-

Import Books from GoodReads

+
+

Import Books from GoodReads

{% csrf_token %} {{ import_form.as_p }} - +

Imports are limited in size, and only the first {{ limit }} items will be imported. +

-

Recent Imports

+
+

Recent Imports

+ {% if not jobs %} +

No recent imports

+ {% endif %}
    {% for job in jobs %}
  • {{ job.created_date | naturaltime }}
  • diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index d3f13c5a..61187e8a 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -67,7 +67,13 @@ Profile - + + Settings + + + Invites + + Import books diff --git a/bookwyrm/templates/manage_invites.html b/bookwyrm/templates/manage_invites.html index ee62ed6a..b9bb1c00 100644 --- a/bookwyrm/templates/manage_invites.html +++ b/bookwyrm/templates/manage_invites.html @@ -1,16 +1,18 @@ {% extends 'layout.html' %} {% load humanize %} {% block content %} -
    -
    -

    Invites

    - - - - - - - +
    +

    Invites

    +
    LinkExpiresMax usesTimes used
    + + + + + + + {% if not invites %} + + {% endif %} {% for invite in invites %} @@ -19,14 +21,33 @@ {% endfor %} -
    LinkExpiresMax usesTimes used
    No active invites
    {{ invite.link }}{{ invite.times_used }}
    -

    Generate New Invite

    + +
    -
    - {% csrf_token %} - {{ form.as_p }} - -
    -
    +
    +

    Generate New Invite

    + +
    + {% csrf_token %} +
    +
    + +
    +
    + {{ form.expiry }} +
    +
    + +
    +
    + +
    +
    + {{ form.use_limit }} +
    +
    + + +
    {% endblock %} diff --git a/bookwyrm/templates/user.html b/bookwyrm/templates/user.html index 64c90d0e..c6187592 100644 --- a/bookwyrm/templates/user.html +++ b/bookwyrm/templates/user.html @@ -14,7 +14,11 @@ {% if shelf.size > 3 %}(See all {{ shelf.size }}){% endif %}
    {% for book in shelf.books %} - {% include 'snippets/book_cover.html' with book=book size="medium" %} + {% endfor %}
diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py index c5846656..89dfeceb 100644 --- a/bookwyrm/urls.py +++ b/bookwyrm/urls.py @@ -40,8 +40,8 @@ urlpatterns = [ re_path(r'^login/?$', views.login_page), re_path(r'^register/?$', views.register_page), re_path(r'^about/?$', views.about_page), + re_path(r'^invite/?$', views.manage_invites), re_path(r'^invite/(?P[A-Za-z0-9]+)/?$', views.invite_page), - re_path(r'^manage_invites/?$', views.manage_invites), path('', views.home), re_path(r'^(?Phome|local|federated)/?$', views.home_tab), diff --git a/bookwyrm/view_actions.py b/bookwyrm/view_actions.py index 0001d6e6..604fe3a7 100644 --- a/bookwyrm/view_actions.py +++ b/bookwyrm/view_actions.py @@ -444,4 +444,4 @@ def create_invite(request): invite.user = request.user invite.save() - return redirect('/manage_invites') + return redirect('/invite')