forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview/gfi: style tweaks

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 446e557c d7fa863a

verified
Changed files
+16 -5
appview
pages
templates
goodfirstissues
state
+3 -4
appview/pages/templates/goodfirstissues/index.html
···
{{ else }}
{{ range .RepoGroups }}
<div class="mb-4 gap-1 flex flex-col drop-shadow-sm rounded bg-white dark:bg-gray-800">
-
<div class="flex px-6 pt-4 flex-row gap-1 items-center justify-between">
<div class="font-medium dark:text-white flex items-center justify-between">
<div class="flex items-center min-w-0 flex-1 mr-2">
{{ if .Repo.Source }}
···
<div class="flex-shrink-0 flex items-center gap-2 text-gray-500 dark:text-gray-400">
<span>
<div class="inline-flex items-center gap-1">
-
{{ i "message-square" "w-3 h-3 md:hidden" }}
{{ len .Comments }}
-
<span class="hidden md:inline">comment{{ if ne (len .Comments) 1 }}s{{ end }}</span>
</div>
</span>
<span class="before:content-['·'] before:select-none"></span>
<span class="text-sm">
-
{{ template "repo/fragments/time" .Created }}
</span>
<div class="hidden md:inline-flex md:gap-1">
{{ $labelState := .Labels }}
···
{{ else }}
{{ range .RepoGroups }}
<div class="mb-4 gap-1 flex flex-col drop-shadow-sm rounded bg-white dark:bg-gray-800">
+
<div class="flex px-6 pt-4 flex-row gap-1 items-center justify-between flex-wrap">
<div class="font-medium dark:text-white flex items-center justify-between">
<div class="flex items-center min-w-0 flex-1 mr-2">
{{ if .Repo.Source }}
···
<div class="flex-shrink-0 flex items-center gap-2 text-gray-500 dark:text-gray-400">
<span>
<div class="inline-flex items-center gap-1">
+
{{ i "message-square" "w-3 h-3" }}
{{ len .Comments }}
</div>
</span>
<span class="before:content-['·'] before:select-none"></span>
<span class="text-sm">
+
{{ template "repo/fragments/shortTimeAgo" .Created }}
</span>
<div class="hidden md:inline-flex md:gap-1">
{{ $labelState := .Labels }}
+13 -1
appview/state/gfi.go
···
repoUris = append(repoUris, rl.RepoAt.String())
}
-
allIssues, err := db.GetIssues(
s.db,
db.FilterIn("repo_at", repoUris),
db.FilterEq("open", 1),
)
···
}
sort.Slice(sortedGroups, func(i, j int) bool {
return sortedGroups[i].Repo.Name < sortedGroups[j].Repo.Name
})
···
repoUris = append(repoUris, rl.RepoAt.String())
}
+
allIssues, err := db.GetIssuesPaginated(
s.db,
+
pagination.Page{
+
Limit: 500,
+
},
db.FilterIn("repo_at", repoUris),
db.FilterEq("open", 1),
)
···
}
sort.Slice(sortedGroups, func(i, j int) bool {
+
iIsTangled := sortedGroups[i].Repo.Did == consts.TangledDid
+
jIsTangled := sortedGroups[j].Repo.Did == consts.TangledDid
+
+
// If one is tangled and the other isn't, non-tangled comes first
+
if iIsTangled != jIsTangled {
+
return jIsTangled // true if j is tangled (i should come first)
+
}
+
+
// Both tangled or both not tangled: sort by name
return sortedGroups[i].Repo.Name < sortedGroups[j].Repo.Name
})