track_detail.html 1.63 KB
Newer Older
fred's avatar
fred committed
1
{% extends "base.html" %}
2
{% load i18n %}
fred's avatar
fred committed
3 4

{% block appbar %}
fred's avatar
fred committed
5
<h2>Nonstop - Track: {{ object.artist.name }} / {{ object.title }}</h2>
fred's avatar
fred committed
6 7
{% endblock %}

8 9 10 11 12
{% block more-user-links %}
{{ block.super }}
<a href="{% url 'nonstop-quick-links' %}">Gestion nonstop</a>
{% endblock %}

fred's avatar
fred committed
13
{% block content %}
fred's avatar
fred committed
14

15 16 17 18
{% if not object.file_exists %}
<p class="missing-file">{% trans "The track is no longer available on the server." %}</p>
{% endif %}

fred's avatar
fred committed
19
<ul class="soma-list">
fred's avatar
fred committed
20
    {% for somalog in object.recent_diffusions|slice:":20" %}
fred's avatar
fred committed
21 22 23 24 25 26 27 28 29 30
        <li><span class="timestamp">{{ somalog.play_timestamp|date:"d/m/Y H:i" }}</span>:
            {% if somalog.filepath.track %}
            <a href="{{ somalog.filepath.track.get_absolute_url }}" class="tracktitle">{{ somalog.filepath.track.title }}</a>
            <span class="trackartist">(<a href="{{ somalog.filepath.track.artist.get_absolute_url }}" class="trackartist">{{ somalog.filepath.track.artist.name }}</a>)</span>
            {% endif %}
            <span class="filepath">{{ somalog.filepath.short }}</span>
</li>
    {% endfor %}
</ul>

31
{% if object.file_exists %}
fred's avatar
fred committed
32 33 34 35 36
<div class="side">
{% if internal_ip %}
<audio src="{{object.file_path}}" controls></audio>
{% endif %}

37 38
<p>In nonstop since {{ object.added_to_nonstop_timestamp|date:"SHORT_DATE_FORMAT" }}.</p>

39
{% if perms.nonstop.add_track %}
40 41
<form method="POST">
  {% csrf_token %}
42
  {{ metadata_form.as_p }}
43 44 45 46
  <div class="buttons">
    <button class="submit-button">{% trans "Update" %}</button>
  </div>
</form>
fred's avatar
fred committed
47
</div>
48 49
{% endif %}

50 51
{% endif %}

fred's avatar
fred committed
52 53 54 55 56 57 58 59 60 61 62 63
<style>
ul.soma-list {
  float: left;
}

div.side {
float: right;
background: #f0f0f0;
padding: 1ex;
}
</style>

fred's avatar
fred committed
64
{% endblock %}