{{ define "title" }}issues · {{ .RepoInfo.FullName }}{{ end }} {{ define "extrameta" }} {{ $title := "issues"}} {{ $url := printf "https://tangled.org/%s/issues" .RepoInfo.FullName }} {{ template "repo/fragments/og" (dict "RepoInfo" .RepoInfo "Title" $title "Url" $url) }} {{ end }} {{ define "repoContent" }} {{ $active := "closed" }} {{ if .FilteringByOpen }} {{ $active = "open" }} {{ end }} {{ $open := (dict "Key" "open" "Value" "open" "Icon" "circle-dot" "Meta" (string .RepoInfo.Stats.IssueCount.Open)) }} {{ $closed := (dict "Key" "closed" "Value" "closed" "Icon" "ban" "Meta" (string .RepoInfo.Stats.IssueCount.Closed)) }} {{ $values := list $open $closed }}
{{ template "fragments/tabSelector" (dict "Name" "state" "Values" $values "Active" $active) }}
{{ i "circle-plus" "w-4 h-4" }} new
{{ end }} {{ define "repoAfter" }}
{{ template "repo/issues/fragments/issueListing" (dict "Issues" .Issues "RepoPrefix" .RepoInfo.FullName "LabelDefs" .LabelDefs) }}
{{if gt .IssueCount .Page.Limit }} {{ block "pagination" . }} {{ end }} {{ end }} {{ end }} {{ define "pagination" }}
{{ $currentState := "closed" }} {{ if .FilteringByOpen }} {{ $currentState = "open" }} {{ end }} {{ $prev := .Page.Previous.Offset }} {{ $next := .Page.Next.Offset }} {{ $lastPage := sub .IssueCount (mod .IssueCount .Page.Limit) }} {{ i "chevron-left" "w-4 h-4" }} previous {{ if gt .Page.Offset 0 }} 1 {{ end }} {{ if gt $prev .Page.Limit }} ... {{ end }} {{ if gt $prev 0 }} {{ add (div $prev .Page.Limit) 1 }} {{ end }} {{ add (div .Page.Offset .Page.Limit) 1 }} {{ if lt $next $lastPage }} {{ add (div $next .Page.Limit) 1 }} {{ end }} {{ if lt ($next) (sub .IssueCount (mul (2) .Page.Limit)) }} ... {{ end }} {{ if lt .Page.Offset $lastPage }} {{ add (div $lastPage .Page.Limit) 1 }} {{ end }} next {{ i "chevron-right" "w-4 h-4" }}
{{ end }}