partitioncloud-server/partitioncloud/templates/partition/edit.html

66 lines
2.1 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<h2>{% block title %}{{ _("Modify \"%(name)s\"", name=partition.name) }}{% endblock %}</h2>
<br/>
<form action="/partition/{{ partition.uuid }}/edit" method="post" enctype="multipart/form-data">
<table>
<tbody>
<tr>
<td>{{ _("File") }}</td>
<td><a href="/partition/{{ partition.uuid }}">
<img class="partition-thumbnail" src="/thumbnails/{{ partition.uuid }}.jpg" loading="lazy">
</a><br/>
{% block input_file %}
{% set required=false %}
{% set filetype=".pdf" %}
{% include 'components/input_file.html' %}
{% endblock %}
</td>
</tr>
{% if partition.source != "unknown" and partition.source != "upload" %}
<tr>
<td>
{{ _("Source") }}
</td>
<td class="partition-source">
<a href="{{ partition.source }}">{{ partition.source.split("/")[2] }}</a>
</td>
</tr>
{% endif %}
<tr>
<td>{{ _("Title") }}</td>
<td><input name="name" type="text" value="{{ partition.name }}" placeholder="{{ _('Title') }}" required /><br/></td>
</tr>
<tr>
<td>{{ _("Author") }}</td>
<td><input name="author" type="text" value="{{ partition.author }}" placeholder="{{ _('Author') }}" /><br/></td>
</tr>
<tr>
<td>{{ _("Lyrics") }}</td>
<td><textarea id="lyrics" name="body" type="text" placeholder="{{ _('Lyrics') }}">{{ partition.body }}</textarea><br/></td>
</tr>
<tr>
<td>{{ _("Attachments") }}</td>
{{ partition.load_attachments() }}
<td><a href="/partition/{{ partition.uuid }}/attachments">
{% if partition.attachments %}
{% set number=partition.attachments | length %}
{{ _("Yes, %(number)s", number=number) }}
{% else %}
{{ _("Add one") }}
{% endif %}
</a></td>
</tr>
</tbody>
</table>
<input type="submit" value="{{ _('Update') }}" />
</form>
<a href="/partition/{{ partition.uuid }}/delete">
<button id="delete-partition">{{ _("Delete") }}</button>
</a>
{% endblock %}