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

95 lines
3.0 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<h2>{% block title %}{{ _('Details of "%(name)s"', name=partition.name)}}{% endblock %}</h2>
<br/>
<form action="/partition/{{ partition.uuid }}/edit" method="post" enctype="multipart/form-data">
<table>
<tbody>
<tr>
<td>
{{ _("Added by") }}
</td>
<td>
{% if user is not none %}
<div class="user-profile"><!-- Completely messy html for this -->
<div class="table-username">{{ partition_user.username }}</div>
<div class="user-profile-picture" style="background-color:{{ partition_user.color }};" title="{{ partition_user.username }}">
{{ partition_user.username[0] | upper }}
</div>
</div>
{% else %}
{{ _("Unknown") }}
{% endif %}
</td>
</tr>
<tr>
<td>
{{ _("Type") }}
</td>
<td>
{% if partition.source == "unknown" or partition.source == "upload" %}
{{ partition.source }}
{% else %}
<a href="{{ partition.source }}">search</a>
{% endif %}
</td>
</tr>
<tr>
<td>
{{ _("Albums") }}
</td>
<td class="liste">
<ul>
{% for album in albums %}
<li><a href="/albums/{{ album.uuid }}">{{ album.name }}</a></li>
{% endfor %}
</ul>
</td>
</tr>
<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>
<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 %}