</div>
<div class="buttons">
- <input type="submit" name="add" value="{% trans 'Add' %}">
+ <br />
+ <a href="#" class="component_icon button icon_add"
+ onclick="document.getElementById('addenum').submit(); return false;">{% trans "Add" %}</a>
</div>
</fieldset>
</form>
{% if enumeration_values %}
- <form method="POST" action="{% url telemeta-enumeration-update enumeration_id %}">{% csrf_token %}
+ <form method="POST" id="editenum" action="{% url telemeta-enumeration-update enumeration_id %}">{% csrf_token %}
<table class="listing">
<thead>
<tr><th class="sel"> </th><th>{% trans "Value"%}</th>
</thead><tbody>
{% for record in enumeration_values %}
<tr>
- <td><input type="checkbox" name="sel" value="{{record.id}}" /></td>
+ <td><input type="checkbox" name="sel" value="{{instrument.id}}" /></td>
<td><a href="{% url telemeta-enumeration-record-edit enumeration_id,record.id %}">
{{record.value}}</a></td>
</tr>
</tbody>
</table>
<div class="buttons">
- <input type="submit" name="remove" value="{% trans 'Remove selected items' %}" />
+ <br />
+ <a href="#" class="component_icon button icon_cancel"
+ onclick="document.getElementById('editenum').submit(); return false;">{% trans "Remove selected items" %}</a>
</div>
</form>
{% else %}
{% block content %}
-<div class="module-set">
+<div class="module-set" style="width: 33%">
{% block modules %}
<h3><a href="{% url telemeta-rss %}">
<img src="{% url telemeta-images "rss.png" %}" style="vertical-align:middle" /></a>
{% trans "Last changes" %}</h3>
- <table class="listing" bgcolor="#FFFFFF" width="390px">
+ <table class="listing" bgcolor="#FFFFFF" style="width: 100%">
<tr>
<th class="highlight">{% trans "Date" %}</th>
<th>{% trans "Title" %}</th>
{% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %}
-{% block submenu %}
- <div>
- {% block tools %}
- {% if user.is_authenticated %}
- <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- {% endif %}
- {% endblock tools %}
- </div>
-{% endblock %}
+
{% block content %}
- <h3>{% trans "User profile" %} : {{ usr.username }}</h3>
+ <div class="module-set" style="width: 33%">
+ {% block modules %}
+ <div id="module" class="module">
+ <h3><img src="{% url telemeta-images "module_playlist.png" %}" style="vertical-align:middle" />
+ {% trans "Playlists" %}</h3>
+ <ul class="playlist">
+ {% for p in playlists %}
+ <li>
+ <b>{{ p.playlist.title }}</b>
+ <br />
+ <span class="info">{{ p.playlist.description }}</span>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+ {% endblock %}
+ </div>
+
+ <h3>{% trans "User profile" %} : {{ usr.username }}</h3>
+{% if user.is_authenticated %}
+ <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button icon_edit" style="float:right">{% trans "Edit" %}</a>
+ {% endif %}
<div class="infos" style="padding-top: 1em;">
<dl class="listing">
<dt>{% trans "First Name" %}</dt><dd>{{ usr.first_name }}</dd>
<dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
</dl>
</div>
+ </div>
{% endblock %}
m = Playlist.objects.get(public_id=public_id)
m.delete()
- def get_playlists(self, request):
- user = request.user
+ def get_playlists(self, request, user=None):
+ if not user:
+ user = request.user
playlists = []
if user.is_authenticated():
user_playlists = Playlist.objects.filter(author=user)
profile = user.get_profile()
except:
profile = None
- return render(request, template, {'profile' : profile, 'usr': user})
+ playlists = self.get_playlists(request, user)
+ return render(request, template, {'profile' : profile, 'usr': user, 'playlists': playlists})
def profile_edit(self, request, username, template='telemeta/profile_edit.html'):
if request.user.is_staff: