mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-15 21:31:26 +00:00
Add notes form
This commit is contained in:
parent
6009593b6b
commit
38ccc23cd5
1 changed files with 27 additions and 3 deletions
|
@ -71,7 +71,7 @@
|
|||
</div>
|
||||
{% endwith %}
|
||||
|
||||
{% if item.note or item.user == request.user %}
|
||||
{% if item.notes %}
|
||||
<div class="media notification">
|
||||
<figure class="media-left">
|
||||
{% include "snippets/avatar.html" with user=item.user %}
|
||||
|
@ -85,14 +85,14 @@
|
|||
{% endblocktrans %}
|
||||
</header>
|
||||
<p>
|
||||
{{ item.notes|to_markdown|safe }}
|
||||
{{ item.notes|to_markdown|safe }}
|
||||
</p>
|
||||
</div>
|
||||
{% if item.user == request.user %}
|
||||
<div>
|
||||
<details class="details-panel box">
|
||||
<summary>
|
||||
{% trans "Edit:" %}
|
||||
{% trans "Edit notes:" %}
|
||||
<span class="details-close icon icon-pencil" aria-hidden></span>
|
||||
</summary>
|
||||
<form name="edit-notes-{{ item.id }}" method="POST" action="{% url 'list-item' list.id item.id %}">
|
||||
|
@ -115,6 +115,30 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% elif item.user == request.user %}
|
||||
<div>
|
||||
<details class="details-panel box">
|
||||
<summary>
|
||||
{% trans "Add notes:" %}
|
||||
<span class="details-close icon icon-plus" aria-hidden></span>
|
||||
</summary>
|
||||
<form name="add-notes-{{ item.id }}" method="POST" action="{% url 'list-item' list.id item.id %}">
|
||||
{% csrf_token %}
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<textarea class="textarea" maxlength="300" name="notes">{{ item.notes|default:'' }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-success">
|
||||
{% trans "Save" %}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="card-footer is-stacked-mobile has-background-white-bis is-align-items-stretch">
|
||||
|
|
Loading…
Reference in a new issue