Skip to content

Commit

Permalink
Add index for files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisngyn committed Sep 8, 2024
1 parent 2b3bfbb commit 8e7a8a7
Show file tree
Hide file tree
Showing 7 changed files with 391 additions and 505 deletions.
48 changes: 14 additions & 34 deletions ui/index_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion ui/info.templ
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,17 @@ templ Info(infoHash string, info torrent.Info) {
>
<thead>
<tr class="border-b-2 border-gray-400 bg-stone-800">
<th class="px-4 py-2">Index</th>
<th class="px-4 py-2">{ i18n.T(ctx, "Info.Name") }</th>
<th class="px-4 py-2">{ i18n.T(ctx, "Info.Length") }</th>
<th class="px-4 py-2">{ i18n.T(ctx, "Info.Completed") }</th>
<th class="px-4 py-2">{ i18n.T(ctx, "Info.Action") }</th>
</tr>
</thead>
<tbody>
for _, file := range info.Files {
for i, file := range info.Files {
<tr class="hover:text-red-600">
<td class="px-4 py-2">{ toString(i) }</td>
<td class="px-4 py-2">{ file.DisplayPath }</td>
<td class="px-4 py-2 text-right">{ byteCounter(file.Length) }</td>
<td class="px-4 py-2 text-right">{ percent(file.BytesCompleted, file.Length) }</td>
Expand Down
Loading

0 comments on commit 8e7a8a7

Please sign in to comment.