Skip to content

Commit

Permalink
website: disable pagination output if there is only one page
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Feb 26, 2024
1 parent c260b14 commit 672ad46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radio.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ type NewsList struct {
}

// NewsPostID is an identifier for a news post
type NewsPostID int64
type NewsPostID uint64

// NewsPost is a single news post created on the website
type NewsPost struct {
Expand Down Expand Up @@ -854,7 +854,7 @@ func (np NewsPost) HasRequired() (string, bool) {
}

// NewsCommentID is an identifier for a news comment
type NewsCommentID int64
type NewsCommentID uint64

// NewsComment is a single comment under a news post on the website
type NewsComment struct {
Expand Down
2 changes: 2 additions & 0 deletions templates/default/partials/pagination.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{define "pagination"}}
{{if gt .Total 1}}
<div class="columns">
<nav class="column pagination is-left is-flex mb-0" hx-boost="true" hx-push-url="true" hx-target="#content" role="navigation">
{{with .Prev 1}}
Expand Down Expand Up @@ -45,6 +46,7 @@
</form>
</div>
{{end}}
{{end}}
{{define "page-link"}}
<li class="m-0">
<a class="pagination-link" href="{{.URL}}">{{.Nr}}</a>
Expand Down

0 comments on commit 672ad46

Please sign in to comment.