mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-07-18 09:08:22 +00:00
fix trending header
This commit is contained in:
parent
be88c02d99
commit
f099d12b0b
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@ -69,7 +68,6 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e
|
||||
return []Submission{}, err
|
||||
}
|
||||
|
||||
os.Stdout.Write(body)
|
||||
data := gjson.Parse(string(body))
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
@ -105,7 +103,5 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e
|
||||
wg.Wait()
|
||||
|
||||
client.Cache.Set(fmt.Sprintf("trending-%s-%s-%s", section, sort, page), posts, cache.DefaultExpiration)
|
||||
// TODO: Cache trending
|
||||
// client.Cache.Set(tag+sort+page+"-tag", tagData, cache.DefaultExpiration)
|
||||
return posts, nil
|
||||
}
|
||||
|
@ -18,22 +18,42 @@
|
||||
<div class="flex flex-col items-center justify-center text-center">
|
||||
<h2 class="text-2xl font-extrabold">Trending</h2>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
{{#equal section "hot"}}
|
||||
<a href="?section=hot"><b>Hot</b></a>
|
||||
<a href="?section=new">New</a>
|
||||
<a href="?section=top">Top</a>
|
||||
{{/equal}}
|
||||
{{#equal section "new"}}
|
||||
<a href="?section=hot">Hot</a>
|
||||
<a href="?section=new"><b>New</b></a>
|
||||
<a href="?section=top">Top</a>
|
||||
{{/equal}}
|
||||
{{#equal section "top"}}
|
||||
<a href="?section=hot">Hot</a>
|
||||
<a href="?section=new">New</a>
|
||||
<a href="?section=top"><b>Top</b></a>
|
||||
{{/equal}}
|
||||
<div class="flex flex-col sm:flex-row sm:justify-between">
|
||||
<div class="flex flex-col">
|
||||
{{#equal section "hot"}}
|
||||
<a href="?section=hot&sort={{sort}}"><b>Hot</b></a>
|
||||
<a href="?section=new&sort={{sort}}">New</a>
|
||||
<a href="?section=top&sort={{sort}}">Top</a>
|
||||
{{/equal}}
|
||||
{{#equal section "new"}}
|
||||
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||
<a href="?section=new&sort={{sort}}"><b>New</b></a>
|
||||
<a href="?section=top&sort={{sort}}">Top</a>
|
||||
{{/equal}}
|
||||
{{#equal section "top"}}
|
||||
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||
<a href="?section=new&sort={{sort}}">New</a>
|
||||
<a href="?section=top&sort={{sort}}"><b>Top</b></a>
|
||||
{{/equal}}
|
||||
</div>
|
||||
<hr class="sm:hidden my-2" />
|
||||
<div class="flex flex-col sm:items-end">
|
||||
{{#equal sort "popular"}}
|
||||
<a href="?section={{section}}&sort=popular"><b>Popular</b></a>
|
||||
<a href="?section={{section}}&sort=newest">Newest</a>
|
||||
<a href="?section={{section}}&sort=best">Best</a>
|
||||
{{/equal}}
|
||||
{{#equal sort "newest"}}
|
||||
<a href="?section={{section}}&sort=popular">Popular</a>
|
||||
<a href="?section={{section}}&sort=newest"><b>Newest</b></a>
|
||||
<a href="?section={{section}}&sort=best">Best</a>
|
||||
{{/equal}}
|
||||
{{#equal sort "best"}}
|
||||
<a href="?section={{section}}&sort=popular">Popular</a>
|
||||
<a href="?section={{section}}&sort=newest">Newest</a>
|
||||
<a href="?section={{section}}&sort=best"><b>Best</b></a>
|
||||
{{/equal}}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user