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"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
@ -69,7 +68,6 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e
|
|||||||
return []Submission{}, err
|
return []Submission{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
os.Stdout.Write(body)
|
|
||||||
data := gjson.Parse(string(body))
|
data := gjson.Parse(string(body))
|
||||||
|
|
||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
@ -105,7 +103,5 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e
|
|||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
client.Cache.Set(fmt.Sprintf("trending-%s-%s-%s", section, sort, page), posts, cache.DefaultExpiration)
|
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
|
return posts, nil
|
||||||
}
|
}
|
||||||
|
@ -18,22 +18,42 @@
|
|||||||
<div class="flex flex-col items-center justify-center text-center">
|
<div class="flex flex-col items-center justify-center text-center">
|
||||||
<h2 class="text-2xl font-extrabold">Trending</h2>
|
<h2 class="text-2xl font-extrabold">Trending</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col sm:flex-row sm:justify-between">
|
||||||
{{#equal section "hot"}}
|
<div class="flex flex-col">
|
||||||
<a href="?section=hot"><b>Hot</b></a>
|
{{#equal section "hot"}}
|
||||||
<a href="?section=new">New</a>
|
<a href="?section=hot&sort={{sort}}"><b>Hot</b></a>
|
||||||
<a href="?section=top">Top</a>
|
<a href="?section=new&sort={{sort}}">New</a>
|
||||||
{{/equal}}
|
<a href="?section=top&sort={{sort}}">Top</a>
|
||||||
{{#equal section "new"}}
|
{{/equal}}
|
||||||
<a href="?section=hot">Hot</a>
|
{{#equal section "new"}}
|
||||||
<a href="?section=new"><b>New</b></a>
|
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||||
<a href="?section=top">Top</a>
|
<a href="?section=new&sort={{sort}}"><b>New</b></a>
|
||||||
{{/equal}}
|
<a href="?section=top&sort={{sort}}">Top</a>
|
||||||
{{#equal section "top"}}
|
{{/equal}}
|
||||||
<a href="?section=hot">Hot</a>
|
{{#equal section "top"}}
|
||||||
<a href="?section=new">New</a>
|
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||||
<a href="?section=top"><b>Top</b></a>
|
<a href="?section=new&sort={{sort}}">New</a>
|
||||||
{{/equal}}
|
<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>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user