userid = session.get("userid", None)
show_private = userid == profile_userid
if show_private:
- plist_data = query_db("select * from playlists where userid = ?", [profile_userid])
+ plist_data = query_db("select * from playlists where userid = ? order by created desc", [profile_userid])
else:
- plist_data = query_db("select * from playlists where userid = ? and private = 0", [profile_userid])
+ plist_data = query_db("select * from playlists where userid = ? and private = 0 order by created desc", [profile_userid])
# Get songs for current profile
songs = Song.get_all_for_userid(profile_userid)
margin: 10px 0px;
}
+.playlist-type {
+ opacity: 50%;
+}
+
.draggable-song {
box-shadow: 0px 0px 5px 0px;
border-radius: 10px;
<h1>{{ name }}</h1>
-<p>Playlist by <a href="/users/{{ username }}" class="profile-link">{{ username }}</a></p>
+<p>
+Playlist by <a href="/users/{{ username }}" class="profile-link">{{ username }}</a>
+{% if session["userid"] == userid -%}
+<span class="playlist-type">
+[{% if private %}Private{% else %}Public{% endif %}]
+</span>
+{%- endif %}
+</p>
{% if session["userid"] == userid -%}
<p class="playlist-actions">
</div>
{%- endif %}
+{% if not songs -%}
+<p>This playlist doesn't have any songs yet. To add songs to the playlist, expand song details and use the "Add to Playlist..." dropdown.</p>
+{%- endif %}
+
{%- endblock %}
{% for plist in playlists -%}
<div class="playlist-list-entry">
<a class="playlist-name" href="/playlists/{{ plist['playlistid'] }}">{{ plist['name'] }}</a>
+ <!-- Only show playlist type to owner, everyone else only sees public playlists -->
+ {% if session["userid"] == userid -%}
+ <span class="playlist-type">
+ [{% if plist['private'] %}Private{% else %}Public{% endif %}]
+ </span>
+ {%- endif %}
</div>
{%- endfor %}
</div>