Skip to content

Commit 742a29d

Browse files
committed
more efficient tables
1 parent 1e1c465 commit 742a29d

5 files changed

Lines changed: 94 additions & 34 deletions

File tree

assets/script.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ document.querySelector('.js-desc-less-link')?.addEventListener('click', function
6464
this.style.display = 'none';
6565
});
6666

67-
// Expand Torrents
68-
document.querySelectorAll('.js-torrent-more-link').forEach(elem => {
69-
elem.addEventListener('click', function(e) {
70-
e.preventDefault();
71-
this.style.display = 'none';
72-
document.querySelector('.js-torrent-container-' + this.getAttribute('groupId')).style.maxHeight = 'none';
73-
});
74-
});
7567

7668
// Release Info
7769
document.querySelectorAll('.js-more-info').forEach(elem => {

assets/style.css

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,74 @@ table {
8585
}
8686

8787
.torrent-container {
88-
max-height: 275px;
89-
overflow: hidden;
88+
overflow: auto;
89+
padding-top: 10px;
90+
}
91+
92+
/* Optimized table spacing */
93+
table {
94+
border-collapse: collapse;
95+
width: 100%;
96+
}
97+
98+
th, td {
99+
padding: 6px 8px !important;
100+
text-align: left;
101+
border-bottom: 1px solid #7a3a3a;
102+
line-height: 1.2;
103+
vertical-align: top;
104+
}
105+
106+
th {
107+
font-weight: 600;
108+
background-color: #4a2222;
109+
white-space: nowrap;
110+
}
111+
112+
td {
113+
font-size: 1.25rem;
114+
}
115+
116+
/* Reduce spacing in torrent info cells */
117+
.torrent-container td {
118+
padding: 4px 6px !important;
119+
}
120+
121+
/* Compact button styling */
122+
.torrent-container .button {
123+
padding: 2px 8px !important;
124+
font-size: 0.8rem !important;
125+
height: 24px !important;
126+
line-height: 20px !important;
127+
margin: 0 !important;
128+
}
129+
130+
/* Optimized torrent info layout */
131+
.torrent-info {
132+
line-height: 1.2;
133+
}
134+
135+
.torrent-title {
136+
font-weight: 600;
137+
margin-bottom: 2px;
138+
}
139+
140+
.torrent-details {
141+
font-size: 0.8rem;
142+
color: #ccc;
143+
line-height: 1.1;
144+
}
145+
146+
/* Remove bottom margin from table rows */
147+
tr {
148+
margin: 0;
149+
padding: 0;
150+
}
151+
152+
/* Reduce table row height */
153+
tbody tr {
154+
height: auto;
155+
min-height: 32px;
90156
}
91157

92158
.brand-link {

lib/wat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def make_artist_title(group, torrent):
132132
if group.get("groupRecordLabel") != '':
133133
torrent['displayTitle'] += " / " + group.get("groupRecordLabel")
134134
else:
135-
torrent['displayTitle'] = torrent.get('remasterTitle') + " / "
135+
torrent['displayTitle'] = str(torrent.get('remasterYear')) + " / "
136136
torrent['displayTitle'] += torrent.get('remasterRecordLabel')
137137

138138
def make_browse_title(torrent):

templates/artist.html

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,19 @@ <h2 class="js-title">{{ res.groupYear }} - {{ res.groupName | safe }}</h2>
6060
<tbody>
6161
{% for torrent in res.torrent %}
6262
<tr>
63-
<td width=25%>
64-
{{ torrent.displayTitle }}<br>
65-
{{ torrent.media }} / {{ torrent.format }} {{ torrent.encoding }}
66-
{% if torrent.hasLog %}
67-
/ {{ torrent.logScore }}%
68-
{% endif %}
69-
{% if torrent.hasCue %}
70-
/ Cue
71-
{% endif %}
63+
<td>
64+
<div class="torrent-info">
65+
<div class="torrent-title">
66+
{{ torrent.media }} / {{ torrent.format }} {{ torrent.encoding }}
67+
{% if torrent.hasLog %}
68+
/ {{ torrent.logScore }}%
69+
{% endif %}
70+
{% if torrent.hasCue %}
71+
/ Cue
72+
{% endif %}
73+
</div>
74+
<div class="torrent-details">{{ torrent.displayTitle }}</div>
75+
</div>
7276
</td>
7377
<td>{{ torrent.fileCount }}</td>
7478
<td class='small-up-column'>{{ torrent.size }}</td>
@@ -88,9 +92,6 @@ <h2 class="js-title">{{ res.groupYear }} - {{ res.groupName | safe }}</h2>
8892
</tbody>
8993
</table>
9094
</div>
91-
<div class="u-full-width desc-more">
92-
<a href="" groupId="{{ res.groupId }}" class="js-torrent-more-link">More</a>
93-
</div>
9495
</div>
9596
{% endfor %}
9697
{% endblock %}

templates/browse.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ <h2 class="js-title">{{ res.artist }} - {{ res.groupName }}</h2>
1212
{% for torrent in res.torrents %}
1313
<tr>
1414
<td>
15-
{{ torrent.displayTitle }}<br>
16-
{{ torrent.media }} / {{ torrent.format }} {{ torrent.encoding }}
17-
{% if torrent.hasLog %}
18-
/ {{ torrent.logScore }}%
19-
{% endif %}
20-
{% if torrent.hasCue %}
21-
/ Cue
22-
{% endif %}
15+
<div class="torrent-info">
16+
<div class="torrent-title">{{ torrent.displayTitle }}</div>
17+
<div class="torrent-details">
18+
{{ torrent.media }} / {{ torrent.format }} {{ torrent.encoding }}
19+
{% if torrent.hasLog %}
20+
/ {{ torrent.logScore }}%
21+
{% endif %}
22+
{% if torrent.hasCue %}
23+
/ Cue
24+
{% endif %}
25+
</div>
26+
</div>
2327
</td>
2428
<td>{{ torrent.fileCount }}</td>
2529
<td class='small-up-column'>{{ torrent.size }}</td>
@@ -39,9 +43,6 @@ <h2 class="js-title">{{ res.artist }} - {{ res.groupName }}</h2>
3943
</table>
4044
</div>
4145

42-
<div class="u-full-width desc-more">
43-
<a href="" groupId="{{ res.groupId }}" class="js-torrent-more-link">More</a>
44-
</div>
4546
<hr>
4647
</div>
4748
{% endfor %}

0 commit comments

Comments
 (0)