forked from mirrors/bookwyrm
Compose window for dms
This commit is contained in:
parent
bae54b6847
commit
779a5e0cbf
5 changed files with 31 additions and 12 deletions
|
@ -92,6 +92,12 @@ class ReplyForm(CustomForm):
|
||||||
'user', 'content', 'content_warning', 'sensitive',
|
'user', 'content', 'content_warning', 'sensitive',
|
||||||
'reply_parent', 'privacy']
|
'reply_parent', 'privacy']
|
||||||
|
|
||||||
|
class StatusForm(CustomForm):
|
||||||
|
class Meta:
|
||||||
|
model = models.Status
|
||||||
|
fields = [
|
||||||
|
'user', 'content', 'content_warning', 'sensitive', 'privacy']
|
||||||
|
|
||||||
|
|
||||||
class EditUserForm(CustomForm):
|
class EditUserForm(CustomForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -4,6 +4,11 @@
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h1 class="title">Direct Messages</h1>
|
<h1 class="title">Direct Messages</h1>
|
||||||
|
|
||||||
|
<div class="box">
|
||||||
|
{% include 'snippets/create_status_form.html' with type="direct" uuid=1 %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="block">
|
||||||
{% if not activities %}
|
{% if not activities %}
|
||||||
<p>You have no messages right now.</p>
|
<p>You have no messages right now.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -14,6 +19,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% include 'snippets/pagination.html' with page=activities path="direct-messages" %}
|
{% include 'snippets/pagination.html' with page=activities path="direct-messages" %}
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
{% block panel %}{% endblock %}
|
{% block panel %}{% endblock %}
|
||||||
|
|
||||||
{% if activities %}
|
{% if activities %}
|
||||||
{% include 'snippets/pagination.html' with page=activities path='/'|add:tab anchor="#feed" %}
|
{% include 'snippets/pagination.html' with page=activities path=path anchor="#feed" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% load bookwyrm_tags %}
|
{% load bookwyrm_tags %}
|
||||||
<form class="is-flex-grow-1" name="{{ type }}" action="/post/{{ type }}" method="post" id="tab-{{ type }}-{{ book.id }}{{ reply_parent.id }}">
|
<form class="is-flex-grow-1" name="{{ type }}" action="/post/{% if type == 'direct' %}status{% else %}{{ type }}{% endif %}" method="post" id="tab-{{ type }}-{{ book.id }}{{ reply_parent.id }}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="hidden" name="book" value="{{ book.id }}">
|
<input type="hidden" name="book" value="{{ book.id }}">
|
||||||
<input type="hidden" name="user" value="{{ request.user.id }}">
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="control">
|
<div class="control">
|
||||||
{% if not type == 'reply' %}
|
{% if type != 'reply' and type != 'direct' %}
|
||||||
<label class="label" for="id_{% if type == 'quotation' %}quote{% else %}content{% endif %}_{{ book.id }}_{{ type }}">{{ type|title }}:</label>
|
<label class="label" for="id_{% if type == 'quotation' %}quote{% else %}content{% endif %}_{{ book.id }}_{{ type }}">{{ type|title }}:</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -53,7 +53,12 @@
|
||||||
{% include 'snippets/toggle/toggle_button.html' with text="Include spoiler alert" icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid focus="id_content_warning" checkbox="id_show_spoilers" class="toggle-button" pressed=status.content_warning %}
|
{% include 'snippets/toggle/toggle_button.html' with text="Include spoiler alert" icon="warning is-size-4" controls_text="spoilers" controls_uid=uuid focus="id_content_warning" checkbox="id_show_spoilers" class="toggle-button" pressed=status.content_warning %}
|
||||||
</div>
|
</div>
|
||||||
<div class="control">
|
<div class="control">
|
||||||
{% include 'snippets/privacy_select.html' with current=reply_parent.privacy%}
|
{% if type == 'direct' %}
|
||||||
|
<input type="hidden" name="privacy" value="direct">
|
||||||
|
<button type="button" class="button" aria-label="Privacy" disabled>Private</button>
|
||||||
|
{% else %}
|
||||||
|
{% include 'snippets/privacy_select.html' with current=reply_parent.privacy %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-narrow">
|
<div class="column is-narrow">
|
||||||
|
|
|
@ -44,6 +44,7 @@ class Feed(View):
|
||||||
'activities': paginated.page(page),
|
'activities': paginated.page(page),
|
||||||
'tab': tab,
|
'tab': tab,
|
||||||
'goal_form': forms.GoalForm(),
|
'goal_form': forms.GoalForm(),
|
||||||
|
'path': '/%s' % tab,
|
||||||
}}
|
}}
|
||||||
return TemplateResponse(request, 'feed/feed.html', data)
|
return TemplateResponse(request, 'feed/feed.html', data)
|
||||||
|
|
||||||
|
@ -65,6 +66,7 @@ class DirectMessage(View):
|
||||||
'title': 'Direct Messages',
|
'title': 'Direct Messages',
|
||||||
'user': request.user,
|
'user': request.user,
|
||||||
'activities': activity_page,
|
'activities': activity_page,
|
||||||
|
'path': '/direct-messages',
|
||||||
}}
|
}}
|
||||||
return TemplateResponse(request, 'feed/direct_messages.html', data)
|
return TemplateResponse(request, 'feed/direct_messages.html', data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue