Compare commits

...

5 commits

Author SHA1 Message Date
Mouse Reeve
7789b600e1 Python formatting 2021-04-22 13:01:05 -07:00
Mouse Reeve
ea0e54e8da Merge branch 'main' into list-status 2021-04-22 12:59:56 -07:00
Mouse Reeve
deb4676e2f WIP 2021-03-05 06:56:45 -08:00
Mouse Reeve
f5fe746176 Merge branch 'main' into list-status 2021-03-04 17:37:41 -08:00
Mouse Reeve
7a8a228dbe Markup for posting a status about a list 2021-02-03 15:59:26 -08:00
5 changed files with 46 additions and 0 deletions

View file

@ -121,6 +121,12 @@ class StatusForm(CustomForm):
fields = ["user", "content", "content_warning", "sensitive", "privacy"]
class ListStatusForm(CustomForm):
class Meta:
model = models.GeneratedNote
fields = ["user", "content", "privacy", "mention_books"]
class EditUserForm(CustomForm):
class Meta:
model = models.User

View file

@ -0,0 +1 @@
<h1>

View file

@ -3,6 +3,15 @@
{% load bookwyrm_tags %}
{% block panel %}
{% if items.object_list.exists and list.user == request.user %}
<section class="block">
<h2 class="title is-4">{% trans "Post list to feed" %}</h2>
<div class="block column is-three-quarters">
{% include 'lists/list_status.html' %}
</div>
</section>
{% endif %}
{% if request.user == list.user and pending_count %}
<div class="block content">
<p>

View file

@ -0,0 +1,29 @@
{% extends 'components/card.html' %}
{% load bookwyrm_tags %}
{% load humanize %}
{% load i18n %}
{% block card-header %}
<h3 class="card-header-title has-background-white-ter is-block">
{% include 'snippets/avatar.html' with user=request.user %}
{% blocktrans with username=user.display_name list_name=list.name %}{{ username }} created a list: "{{ list_name }}"{% endblocktrans %}
</h3>
{% endblock %}
{% block card-footer %}
<form name="list-status" action="" method="post" class="card-footer-item">
{% csrf_token %}
<input type="hidden" name="user" value="{{ request.user.id }}">
<input type="hidden" name="list" value="{{ list.id }}">
<div class="field has-addons">
<div class="control">
{% include 'snippets/privacy_select.html' with current=list.privacy %}
</div>
<div class="control">
<button type="submit" class="button is-primary">{% trans "Post" %}</button>
</div>
</div>
</form>
{% endblock %}

View file

@ -156,6 +156,7 @@ class List(View):
"pending_count": book_list.listitem_set.filter(approved=False).count(),
"suggested_books": suggestions,
"list_form": forms.ListForm(instance=book_list),
"status_form": forms.ListStatusForm(),
"query": query or "",
"sort_form": forms.SortListForm(
{"direction": direction, "sort_by": sort_by}