<h3>Playlists</h3>
<form method="POST" action="">{% csrf_token %}
{% for playlist in playlists %}
- <h2>{{ playlist.name }}</h2>
+ <h2>{{ playlist.name }} {% if playlist.is_current %}(current){% endif %}</h2>
<table class="listing" width="75%">
<tr>
<th class="highlight">{% trans "Title" %}</th>
</tr>
{% for resource in playlist.resources %}
- <tr>
+ <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td>
{% if resource.type == "item" %}
<a href="{% url telemeta-item-detail resource.element.public_id %}">{{ resource.element }}</a>
<th>User</th>
</tr>
{% for r in revisions %}
- <tr>
+ <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td>{{ r.revision.time }}</td>
<td>{{ r.revision.element_type }}</td>
<td>
if isinstance(playlist_resource, dict):
m = PlaylistResource()
m.public_id = playlist_resource['public_id']
- m.playlist = Playlist.objects.get(public_id=playlist_resource['playlist_id'])
+ m.playlist = Playlist.objects.get(is_current=True, author=request.user)
m.resource_type = playlist_resource['resource_type']
m.resource_id = playlist_resource['resource_id']
m.save()