From 316fc0ece142b24138ce0d9c4358bfe45f93d2d7 Mon Sep 17 00:00:00 2001 From: Laptop Date: Sat, 5 Oct 2024 20:08:46 +0300 Subject: [PATCH] i don't know how to describe this hoppity --- templates/playlist.templ | 20 ++++++++++++++++++++ templates/searchPlaylists.templ | 28 ---------------------------- templates/searchTracks.templ | 28 ---------------------------- templates/searchUsers.templ | 30 ------------------------------ templates/track.templ | 21 +++++++++++++++++++++ templates/user.templ | 22 ++++++++++++++++++++++ 6 files changed, 63 insertions(+), 86 deletions(-) delete mode 100644 templates/searchPlaylists.templ delete mode 100644 templates/searchTracks.templ delete mode 100644 templates/searchUsers.templ diff --git a/templates/playlist.templ b/templates/playlist.templ index e9e4afe..a6b8e94 100644 --- a/templates/playlist.templ +++ b/templates/playlist.templ @@ -59,3 +59,23 @@ templ Playlist(p sc.Playlist) {

Last modified: { p.LastModified }

} + +templ SearchPlaylists(p *sc.Paginated[*sc.Playlist]) { + Found { strconv.FormatInt(p.Total, 10) } playlists +
+
+ for _, playlist := range p.Collection { + + if playlist.Artwork != "" { + + } else { + + } +
+

{ playlist.Title }

+ { playlist.Author.Username } +
+
+ } + More playlists +} diff --git a/templates/searchPlaylists.templ b/templates/searchPlaylists.templ deleted file mode 100644 index 22cf288..0000000 --- a/templates/searchPlaylists.templ +++ /dev/null @@ -1,28 +0,0 @@ -package templates - -import ( - "github.com/maid-zone/soundcloak/lib/sc" - "net/url" - "strconv" - "strings" -) - -templ SearchPlaylists(p *sc.Paginated[*sc.Playlist]) { - Found { strconv.FormatInt(p.Total, 10) } playlists -
-
- for _, playlist := range p.Collection { - - if playlist.Artwork != "" { - - } else { - - } -
-

{ playlist.Title }

- { playlist.Author.Username } -
-
- } - More playlists -} diff --git a/templates/searchTracks.templ b/templates/searchTracks.templ deleted file mode 100644 index d75f943..0000000 --- a/templates/searchTracks.templ +++ /dev/null @@ -1,28 +0,0 @@ -package templates - -import ( - "github.com/maid-zone/soundcloak/lib/sc" - "net/url" - "strconv" - "strings" -) - -templ SearchTracks(p *sc.Paginated[*sc.Track]) { - Found { strconv.FormatInt(p.Total, 10) } tracks -
-
- for _, track := range p.Collection { - - if track.Artwork != "" { - - } else { - - } -
-

{ track.Title }

- { track.Author.Username } -
-
- } - More tracks -} diff --git a/templates/searchUsers.templ b/templates/searchUsers.templ deleted file mode 100644 index 22db97d..0000000 --- a/templates/searchUsers.templ +++ /dev/null @@ -1,30 +0,0 @@ -package templates - -import ( - "github.com/maid-zone/soundcloak/lib/sc" - "net/url" - "strconv" - "strings" -) - -templ SearchUsers(p *sc.Paginated[*sc.User]) { - Found { strconv.FormatInt(p.Total, 10) } users -
-
- for _, user := range p.Collection { - - if user.Avatar != "" { - - } else { - - } -
-

{ user.Username }

- if user.FullName != "" { - { user.FullName } - } -
-
- } - More users -} diff --git a/templates/track.templ b/templates/track.templ index be5f530..81c63e7 100644 --- a/templates/track.templ +++ b/templates/track.templ @@ -4,6 +4,7 @@ import ( "github.com/maid-zone/soundcloak/lib/sc" "strconv" "strings" + "net/url" ) templ TrackHeader(t sc.Track) { @@ -102,3 +103,23 @@ templ TrackEmbed(t sc.Track, stream string) { } + +templ SearchTracks(p *sc.Paginated[*sc.Track]) { + Found { strconv.FormatInt(p.Total, 10) } tracks +
+
+ for _, track := range p.Collection { + + if track.Artwork != "" { + + } else { + + } +
+

{ track.Title }

+ { track.Author.Username } +
+
+ } + More tracks +} diff --git a/templates/user.templ b/templates/user.templ index 8f57e81..397b8d1 100644 --- a/templates/user.templ +++ b/templates/user.templ @@ -54,3 +54,25 @@ templ User(u sc.User, p *sc.Paginated[sc.Track]) { no more tracks } } + +templ SearchUsers(p *sc.Paginated[*sc.User]) { + Found { strconv.FormatInt(p.Total, 10) } users +
+
+ for _, user := range p.Collection { + + if user.Avatar != "" { + + } else { + + } +
+

{ user.Username }

+ if user.FullName != "" { + { user.FullName } + } +
+
+ } + More users +} \ No newline at end of file