mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-05-17 22:18:53 +00:00
Make FileLink filetype editable
This commit is contained in:
parent
38e39ad870
commit
0630e34973
1 changed files with 50 additions and 42 deletions
|
@ -32,63 +32,71 @@
|
||||||
<th>{% trans "URL" %}</th>
|
<th>{% trans "URL" %}</th>
|
||||||
<th>{% trans "Added by" %}</th>
|
<th>{% trans "Added by" %}</th>
|
||||||
<th>{% trans "Filetype" %}</th>
|
<th>{% trans "Filetype" %}</th>
|
||||||
|
<th>{% trans "Availability" %}</th>
|
||||||
<th>{% trans "Domain" %}</th>
|
<th>{% trans "Domain" %}</th>
|
||||||
<th>{% trans "Status" %}</th>
|
<th>{% trans "Status" %}</th>
|
||||||
<th colspan="2">{% trans "Actions" %}</th>
|
<th colspan="2">{% trans "Actions" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for link in links %}
|
{% for link in links %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="overflow-wrap-anywhere">
|
<form name="edit-link-{{ link.id }}" class="control" method="post" action="{% url 'file-link' book.id link.id %}">
|
||||||
<a href="{{ link.url }}" target="_blank" rel="nofollow noopener noreferrer">{{ link.url }}</a>
|
{% csrf_token %}
|
||||||
</td>
|
<input type="hidden" name="url" value="{{ link.form.url.value }}">
|
||||||
<td>
|
<input type="hidden" name="added_by" value="{{ link.form.added_by.value }}">
|
||||||
{% if link.added_by %}
|
<input type="hidden" name="book" value="{{ link.form.book.value }}">
|
||||||
<a href="{% url 'user-feed' link.added_by.id %}">{{ link.added_by.display_name }}</a>
|
<td class="overflow-wrap-anywhere">
|
||||||
{% else %}
|
<a href="{{ link.url }}" target="_blank" rel="nofollow noopener noreferrer">{{ link.url }}</a>
|
||||||
<em>{% trans "Unknown user" %}</em>
|
</td>
|
||||||
{% endif %}
|
<td>
|
||||||
</td>
|
{% if link.added_by %}
|
||||||
<td>
|
<a href="{% url 'user-feed' link.added_by.id %}">{{ link.added_by.display_name }}</a>
|
||||||
{{ link.filelink.filetype }}
|
{% else %}
|
||||||
</td>
|
<em>{% trans "Unknown user" %}</em>
|
||||||
<td>
|
{% endif %}
|
||||||
{{ link.domain.name }}
|
</td>
|
||||||
<p>
|
<td>
|
||||||
<a href="{% url 'report-link' link.id %}">{% trans "Report spam" %}</a>
|
<div class="field">
|
||||||
</p>
|
<div class="control">
|
||||||
</td>
|
{{ link.form.filetype }}
|
||||||
<td>
|
</div>
|
||||||
{% with status=link.domain.status %}
|
</div>
|
||||||
<span class="tag {% if status == 'blocked' %}has-background-danger{% elif status == 'approved' %}has-background-primary{% endif %}">
|
</td>
|
||||||
<span class="icon" aria-hidden="true">
|
<td>
|
||||||
<span class="icon-{% if status == 'blocked' %}x{% elif status == 'approved' %}check{% else %}lock{% endif %}"></span>
|
<div class="field">
|
||||||
</span>
|
|
||||||
<span>
|
|
||||||
{{ link.domain.get_status_display }}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
{% endwith %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<form name="edit-link" class="control" method="post" action="{% url 'file-link' book.id link.id %}">
|
|
||||||
{% csrf_token %}
|
|
||||||
<input type="hidden" name="url" value="{{ link.form.url.value }}">
|
|
||||||
<input type="hidden" name="filetype" value="{{ link.form.filetype.value }}">
|
|
||||||
<input type="hidden" name="added_by" value="{{ link.form.added_by.value }}">
|
|
||||||
<input type="hidden" name="book" value="{{ link.form.book.value }}">
|
|
||||||
<div class="field has-addons">
|
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<div class="select">
|
<div class="select">
|
||||||
{{ link.form.availability }}
|
{{ link.form.availability }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ link.domain.name }}
|
||||||
|
<p>
|
||||||
|
<a href="{% url 'report-link' link.id %}">{% trans "Report spam" %}</a>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{% with status=link.domain.status %}
|
||||||
|
<span class="tag {% if status == 'blocked' %}has-background-danger{% elif status == 'approved' %}has-background-primary{% endif %}">
|
||||||
|
<span class="icon" aria-hidden="true">
|
||||||
|
<span class="icon-{% if status == 'blocked' %}x{% elif status == 'approved' %}check{% else %}lock{% endif %}"></span>
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
{{ link.domain.get_status_display }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
{% endwith %}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include 'snippets/form_errors.html' with errors_list=link.form.availability.errors id="desc_availability" %}
|
{% include 'snippets/form_errors.html' with errors_list=link.form.availability.errors id="desc_availability" %}
|
||||||
</form>
|
</td>
|
||||||
</td>
|
</form>
|
||||||
<td>
|
<td>
|
||||||
<form name="delete-link-{{ link.id }}" class="control" method="post" action="{% url 'file-link-delete' book.id link.id %}">
|
<form name="delete-link-{{ link.id }}" class="control" method="post" action="{% url 'file-link-delete' book.id link.id %}">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
@ -99,7 +107,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if not book.file_links.exists %}
|
{% if not book.file_links.exists %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5"><em>{% trans "No links available for this book." %}</em></td>
|
<td colspan="8"><em>{% trans "No links available for this book." %}</em></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue