mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2026-02-15 13:05:46 +00:00
Compare commits
1 Commits
permissive
...
2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61a312aba0 |
@@ -36,6 +36,8 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e
|
|||||||
case "best":
|
case "best":
|
||||||
q.Add("filter[window]", "all")
|
q.Add("filter[window]", "all")
|
||||||
q.Add("sort", "-top")
|
q.Add("sort", "-top")
|
||||||
|
case "random":
|
||||||
|
q.Add("sort", "random")
|
||||||
case "popular":
|
case "popular":
|
||||||
fallthrough
|
fallthrough
|
||||||
default:
|
default:
|
||||||
@@ -51,6 +53,8 @@ func (client *Client) FetchTrending(section, sort, page string) ([]Submission, e
|
|||||||
case "top":
|
case "top":
|
||||||
q.Add("filter[section]", "eq:top")
|
q.Add("filter[section]", "eq:top")
|
||||||
q.Add("filter[window]", "day")
|
q.Add("filter[window]", "day")
|
||||||
|
case "random":
|
||||||
|
q.Add("filter[section]", "eq:random")
|
||||||
default:
|
default:
|
||||||
q.Add("filter[section]", "eq:hot")
|
q.Add("filter[section]", "eq:hot")
|
||||||
section = "hot"
|
section = "hot"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ func HandleTrending(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
section := c.Query("section")
|
section := c.Query("section")
|
||||||
switch section {
|
switch section {
|
||||||
case "hot", "new", "top":
|
case "hot", "new", "top", "random":
|
||||||
default:
|
default:
|
||||||
section = "hot"
|
section = "hot"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,20 +30,35 @@
|
|||||||
<a href="?section=hot&sort={{sort}}"><b>Hot</b></a>
|
<a href="?section=hot&sort={{sort}}"><b>Hot</b></a>
|
||||||
<a href="?section=new&sort={{sort}}">New</a>
|
<a href="?section=new&sort={{sort}}">New</a>
|
||||||
<a href="?section=top&sort={{sort}}">Top</a>
|
<a href="?section=top&sort={{sort}}">Top</a>
|
||||||
|
<a href="?section=random&sort=random">Random</a>
|
||||||
{{/equal}}
|
{{/equal}}
|
||||||
{{#equal section "new"}}
|
{{#equal section "new"}}
|
||||||
<a href="?section=hot&sort={{sort}}">Hot</a>
|
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||||
<a href="?section=new&sort={{sort}}"><b>New</b></a>
|
<a href="?section=new&sort={{sort}}"><b>New</b></a>
|
||||||
<a href="?section=top&sort={{sort}}">Top</a>
|
<a href="?section=top&sort={{sort}}">Top</a>
|
||||||
|
<a href="?section=random&sort=random">Random</a>
|
||||||
{{/equal}}
|
{{/equal}}
|
||||||
{{#equal section "top"}}
|
{{#equal section "top"}}
|
||||||
<a href="?section=hot&sort={{sort}}">Hot</a>
|
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||||
<a href="?section=new&sort={{sort}}">New</a>
|
<a href="?section=new&sort={{sort}}">New</a>
|
||||||
<a href="?section=top&sort={{sort}}"><b>Top</b></a>
|
<a href="?section=top&sort={{sort}}"><b>Top</b></a>
|
||||||
|
<a href="?section=random&sort=random">Random</a>
|
||||||
|
{{/equal}}
|
||||||
|
{{#equal section "random"}}
|
||||||
|
<a href="?section=hot&sort={{sort}}">Hot</a>
|
||||||
|
<a href="?section=new&sort={{sort}}">New</a>
|
||||||
|
<a href="?section=top&sort={{sort}}">Top</a>
|
||||||
|
<a href="?section=random&sort=random"><b>Random</b></a>
|
||||||
{{/equal}}
|
{{/equal}}
|
||||||
</div>
|
</div>
|
||||||
<hr class="sm:hidden my-2" />
|
<hr class="sm:hidden my-2" />
|
||||||
<div class="flex flex-col sm:items-end">
|
<div class="flex flex-col sm:items-end">
|
||||||
|
{{#equal section "random"}}
|
||||||
|
<a href="?section=hot&sort=popular">Popular</a>
|
||||||
|
<a href="?section=hot&sort=newest">Newest</a>
|
||||||
|
<a href="?section=hot&sort=best">Best</a>
|
||||||
|
{{/equal}}
|
||||||
|
{{#noteq section "random"}}
|
||||||
{{#equal sort "popular"}}
|
{{#equal sort "popular"}}
|
||||||
<a href="?section={{section}}&sort=popular"><b>Popular</b></a>
|
<a href="?section={{section}}&sort=popular"><b>Popular</b></a>
|
||||||
<a href="?section={{section}}&sort=newest">Newest</a>
|
<a href="?section={{section}}&sort=newest">Newest</a>
|
||||||
@@ -59,6 +74,7 @@
|
|||||||
<a href="?section={{section}}&sort=newest">Newest</a>
|
<a href="?section={{section}}&sort=newest">Newest</a>
|
||||||
<a href="?section={{section}}&sort=best"><b>Best</b></a>
|
<a href="?section={{section}}&sort=best"><b>Best</b></a>
|
||||||
{{/equal}}
|
{{/equal}}
|
||||||
|
{{/noteq}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Reference in New Issue
Block a user