mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-26 06:39:26 +00:00
More styling on the index page - highlighting for paused artist
This commit is contained in:
@@ -169,7 +169,7 @@ table.display tr.odd.gradeA {
|
||||
}
|
||||
|
||||
table.display tr.even.gradeA {
|
||||
background-color: #eeffee;
|
||||
background-color: #ddffdd;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeC {
|
||||
@@ -177,7 +177,7 @@ table.display tr.odd.gradeC {
|
||||
}
|
||||
|
||||
table.display tr.even.gradeC {
|
||||
background-color: #eeeeff;
|
||||
background-color: #ddddff;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeX {
|
||||
@@ -185,7 +185,7 @@ table.display tr.odd.gradeX {
|
||||
}
|
||||
|
||||
table.display tr.even.gradeX {
|
||||
background-color: #ffeeee;
|
||||
background-color: #ffdddd;
|
||||
}
|
||||
|
||||
table.display tr.odd.gradeU {
|
||||
@@ -197,11 +197,11 @@ table.display tr.even.gradeU {
|
||||
}
|
||||
|
||||
|
||||
tr.odd {
|
||||
background-color: #eeeeee;
|
||||
table.display tr.odd.gradeZ {
|
||||
background-color: #FCFAFA;
|
||||
}
|
||||
|
||||
tr.even {
|
||||
table.display tr.even.gradeZ {
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,15 +124,15 @@ div#searchbar { margin: 24px 30px auto auto; float: right; }
|
||||
|
||||
div#main { margin: 0; padding: 80px 0 0 0; }
|
||||
|
||||
table#artist_table { background-color: white; width: 88%; padding: 20px; }
|
||||
table#artist_table { background-color: white; width: 100%; padding: 20px; }
|
||||
|
||||
table#artist_table th#name { text-align: left; min-width: 200px; }
|
||||
table#artist_table th#status { text-align: center; }
|
||||
table#artist_table th#album { text-align: center; min-width: 300px; }
|
||||
table#artist_table th#reldate { width: 175px; text-align: center; min-width: 100px; }
|
||||
table#artist_table th#have { text-align: center; }
|
||||
table#artist_table td#name { vertical-align: middle; text-align: left; min-width:200px; }
|
||||
table#artist_table td#status { vertical-align: middle; text-align: center; }
|
||||
table#artist_table td#album { vertical-align: middle; text-align: center; min-width: 300px; }
|
||||
table#artist_table td#reldate { vertical-align: middle; text-align: center; min-width: 100px; }
|
||||
table#artist_table td#have { vertical-align: middle; }
|
||||
|
||||
div#paddingheader { padding-top: 48px; font-size: 24px; font-weight: bold; text-align: center; }
|
||||
@@ -150,7 +150,7 @@ table#album_table td#status { vertical-align: middle; text-align: center; }
|
||||
table#album_table td#type { vertical-align: middle; text-align: center; }
|
||||
table#album_table td#have { vertical-align: middle; }
|
||||
|
||||
table#history_table { background-color: white; width: 88%; }
|
||||
table#history_table { background-color: white; width: 100%; }
|
||||
|
||||
table#log_table { background-color: white; }
|
||||
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
<%inherit file="base.html"/>
|
||||
<%!
|
||||
from headphones import db
|
||||
%>
|
||||
|
||||
<%def name="headerIncludes()">
|
||||
<div id="subhead_container">
|
||||
<ul id="subhead_menu">
|
||||
<li><a href="refresh?ArtistID=${artist['ArtistID']}">Refresh Artist</a></li>
|
||||
<li><a href="delete?ArtistID=${artist['ArtistID']}">Delete Artist</a></li>
|
||||
<li><a href="pause?ArtistID=${artist['ArtistID']}">Pause Artist</a></li>
|
||||
<li><a href="refreshArtist?ArtistID=${artist['ArtistID']}">Refresh Artist</a></li>
|
||||
<li><a href="deleteArtist?ArtistID=${artist['ArtistID']}">Delete Artist</a></li>
|
||||
%if artist['Status'] == 'Paused':
|
||||
<li><a href="resumeArtist?ArtistID=${artist['ArtistID']}">Resume Artist</a></li>
|
||||
%else:
|
||||
<li><a href="pauseArtist?ArtistID=${artist['ArtistID']}">Pause Artist</a></li>
|
||||
%endif
|
||||
<li><a href="getExtras?ArtistID=${artist['ArtistID']}">Get Extras</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</%def>
|
||||
@@ -27,13 +35,36 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
%for album in albums:
|
||||
<tr>
|
||||
<%
|
||||
if album['Status'] == 'Skipped':
|
||||
grade = 'Z'
|
||||
elif album['Status'] == 'Wanted':
|
||||
grade = 'X'
|
||||
elif album['Status'] == 'Snatched':
|
||||
grade = 'C'
|
||||
else:
|
||||
grade = 'A'
|
||||
|
||||
myDB = db.DBConnection()
|
||||
totaltracks = len(myDB.select('SELECT TrackTitle from tracks WHERE AlbumID=?', [album['AlbumID']]))
|
||||
havetracks = len(myDB.select('SELECT TrackTitle from have WHERE ArtistName like ? AND AlbumTitle like ?', [album['ArtistName'], album['AlbumTitle']]))
|
||||
|
||||
try:
|
||||
percent = (havetracks*100.0)/totaltracks
|
||||
if percent > 100:
|
||||
percent = 100
|
||||
except (ZeroDivisionError, TypeError):
|
||||
percent = 0
|
||||
totaltracks = '?'
|
||||
|
||||
%>
|
||||
<tr class="grade${grade}">
|
||||
<td id="albumart"><img src="http://ec1.images-amazon.com/images/P/${album['AlbumASIN']}.01.MZZZZZZZ.jpg" height="50" width="50"></td>
|
||||
<td id="albumname"><a href="albumPage?AlbumID=${album['AlbumID']}">${album['AlbumTitle']}</a></td>
|
||||
<td id="reldate">${album['ReleaseDate']}</td>
|
||||
<td id="type">${album['Type']}</td>
|
||||
<td id="status">${album['Status']}</td>
|
||||
<td id="have"><div class="progress-container"><div style="width:100%"><div class="havetracks">tracks</div></div></div></td>
|
||||
<td id="have"><span title="${percent}"><span><div class="progress-container"><div style="width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
|
||||
</tr>
|
||||
%endfor
|
||||
</tbody>
|
||||
@@ -51,6 +82,14 @@
|
||||
{
|
||||
$('#album_table').dataTable(
|
||||
{
|
||||
"aoColumns": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
{ "sType": "title-numeric"}
|
||||
],
|
||||
"oLanguage": {
|
||||
"sLengthMenu":"Show _MENU_ albums per page",
|
||||
"sEmptyTable": "No album information available",
|
||||
|
||||
@@ -26,7 +26,17 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
%for item in history:
|
||||
<tr>
|
||||
<%
|
||||
if item['Status'] == 'Processed':
|
||||
grade = 'A'
|
||||
elif item['Status'] == 'Snatched':
|
||||
grade = 'C'
|
||||
elif item['Status'] == 'Unprocessed':
|
||||
grade = 'X'
|
||||
else:
|
||||
grade = 'U'
|
||||
%>
|
||||
<tr class="grade${grade}">
|
||||
<td id="dateadded">${item['DateAdded']}</td>
|
||||
<td id="filename"><a href="${item['URL']}">${item['Title']}</a></td>
|
||||
<td id="size">${item['Size']}</td>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<%
|
||||
<%inherit file="base.html"/>
|
||||
<%!
|
||||
from headphones import helpers
|
||||
%>
|
||||
<%inherit file="base.html"/>
|
||||
|
||||
<%def name="body()">
|
||||
<table class="display" id="artist_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th id="name">Artist Name</th>
|
||||
<th id="status">Status</th>
|
||||
<th id="album">Latest Album</th>
|
||||
<th id="reldate">Release Date</th>
|
||||
<th id="have">Have</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -30,14 +30,22 @@
|
||||
|
||||
if artist['ReleaseDate']:
|
||||
releasedate = artist['ReleaseDate']
|
||||
if releasedate > helpers.today():
|
||||
grade = 'A'
|
||||
else:
|
||||
grade = 'Z'
|
||||
else:
|
||||
releasedate = ''
|
||||
grade = 'Z'
|
||||
|
||||
if artist['Status'] == 'Paused':
|
||||
grade = 'X'
|
||||
|
||||
%>
|
||||
<tr>
|
||||
<tr class="grade${grade}">
|
||||
<td id="name"><span title="${artist['ArtistSortName']}"><span><a href="artistPage?ArtistID=${artist['ArtistID']}">${artist['ArtistName']}</a></td>
|
||||
<td id="album"><a href="albumPage?AlbumID=${artist['AlbumID']}">${artist['LatestAlbum']}</a></td>
|
||||
<td id="reldate">${releasedate}</td>
|
||||
<td id="status">${artist['Status']}</td>
|
||||
<td id="album"><span title="${releasedate}"><span><a href="albumPage?AlbumID=${artist['AlbumID']}">${artist['LatestAlbum']} ${releasedate}</a></td>
|
||||
<td id="have"><span title="${percent}"><span><div class="progress-container"><div style="width:${percent}%"><div class="havetracks">${havetracks}/${totaltracks}</div></div></div></td>
|
||||
</tr>
|
||||
%endfor
|
||||
@@ -59,7 +67,7 @@
|
||||
"aoColumns": [
|
||||
{ "sType": "title-string"},
|
||||
null,
|
||||
null,
|
||||
{ "sType": "title-string"},
|
||||
{ "sType": "title-numeric"}
|
||||
],
|
||||
"bStateSave": true,
|
||||
|
||||
Reference in New Issue
Block a user