forked from mirrors/bookwyrm
Compare commits
5 commits
main
...
list-statu
Author | SHA1 | Date | |
---|---|---|---|
|
7789b600e1 | ||
|
ea0e54e8da | ||
|
deb4676e2f | ||
|
f5fe746176 | ||
|
7a8a228dbe |
5 changed files with 46 additions and 0 deletions
|
@ -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
|
||||
|
|
1
bookwyrm/templates/components/header_with_button.html
Normal file
1
bookwyrm/templates/components/header_with_button.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>
|
|
@ -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>
|
||||
|
|
29
bookwyrm/templates/lists/list_status.html
Normal file
29
bookwyrm/templates/lists/list_status.html
Normal 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 %}
|
||||
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue