squashed bugs, made stuff neater, typical yada yada

-finally fixed favourites page for good
-made favourites and feed pages look Neater™
-maybe broke the search results page idk lmao
This commit is contained in:
4 raccoons in a trenchcoat. / luna vivian 2023-04-20 00:38:15 +02:00
parent 96458c41a8
commit 4ddf2f784a
5 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,4 @@
<a href='/watch?v=${.id}'> <a href='/watch?v=${.id}'>
<img src='https://i.ytimg.com/vi/${.id}/mqdefault.jpg'><br>${.title} <img src='https://i.ytimg.com/vi/${.id}/mqdefault.jpg'><br>${.title}
</a> | ${.runtime} seconds | ${.views} views<br> </a> | ${.runtime} seconds<br>
Uploaded by <a href='/channel/${.channel_id}'>${.channel}</a><br> Uploaded by <a href='/channel/${.channel_id}'>${.channel}</a> · ${.views} views<br>

View file

@ -1,15 +1,16 @@
<h1>Your favourites</h1> <h1>Your favourites</h1>
{{_info}} {{_info}}
{{_fav}} <div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));'>
{{start ?fav}} {{start ?fav}}
{{start _fav}} {{start _fav}}
<div> <div>
<a href='watch?v={{.id}}'> <a href='watch?v={{.id}}'>
<img src='https://i.ytimg.com/vi/{{.id}}/mqdefault.jpg'><br> <img src='https://i.ytimg.com/vi/{{.id}}/mqdefault.jpg'><br>
<b>{{.name}}</b> <b>{{.name}}</b>
</a><br> </a>
</div> </div>
{{end _fav}} {{end _fav}}
{{else ?fav}} {{else ?fav}}
Meow? no faves? Meow? no faves?
{{end ?fav}} {{end ?fav}}
</div>

View file

@ -1,17 +1,18 @@
<h1>Your Feed</h1> <h1>Your Feed</h1>
You can unclutter your feed by going to your <a href="/subscribe.shs">subscribed channels</a>.<br><br> You can unclutter your feed by going to your <a href="/subscribe.shs">list of subscribed channels</a>.<br><br>
<div style='display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));'>
{{start ?feed}} {{start ?feed}}
{{start _feed}} {{start _feed}}
<div class='video-image-container'> <div class='video-image-container'>
<a href='watch?v={{.id}}'> <a href='watch?v={{.id}}'>
<div class='video-image' style='background-image: url(http://i.ytimg.com/vi/{{.id}}/mqdefault.jpg)'></div> <div class='video-image' style='background-image: url(http://i.ytimg.com/vi/{{.id}}/mqdefault.jpg)'></div>
{{.title}} <b>{{.title}}</b></a><br>
</a> Uploaded <!--by {{.uploader}} -->on <b>{{.date}}</b>
{{.date}}
</div> </div>
{{end _feed}} {{end _feed}}
{{else ?feed}} {{else ?feed}}
Eh. something went wrong. Check if you're logged in and if you <a href="/subscribe.shs">subscribe</a> to anyone :p Eh. something went wrong. Check if you're logged in and if you <a href="/subscribe.shs">subscribe</a> to anyone :p
{{end ?feed}} {{end ?feed}}
</div>

View file

@ -33,7 +33,7 @@ for i in $(tac storage/faves | grep -P "^$(session_get_username ${cookies[sh_ses
nested_add fav fav_ nested_add fav fav_
done done
[[ ${fav_[id]} != '' ]] && strings[?sub]=true [[ ${fav_[id]} != '' ]] && strings[?fav]=true
strings[_fav]="fav" strings[_fav]="fav"
strings[_info]="info" strings[_info]="info"

View file

@ -29,7 +29,7 @@ if session_verify "${cookies[sh_session]}"; then
while read i; do while read i; do
feed_[id]="${video_id[$i]}" feed_[id]="${video_id[$i]}"
feed_[title]="${video_title[$i]}" feed_[title]="${video_title[$i]}"
feed_[date]="$(date -d "@${video_date[$i]}" "+%H:%M, %d %h %Y")" feed_[date]="$(date -d "@${video_date[$i]}" "+%d %h %Y, %H:%M")"
feed_[uploader]="${video_uploader[$i]}" feed_[uploader]="${video_uploader[$i]}"
#strings[feed]+="<div class='video-image-container'><a href='watch?v='><div class='video-image' style='background-image: url(http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg)'></div></a></div>" #strings[feed]+="<div class='video-image-container'><a href='watch?v='><div class='video-image' style='background-image: url(http://i.ytimg.com/vi/${video_id[$i]}/mqdefault.jpg)'></div></a></div>"
nested_add feed feed_ nested_add feed feed_