mirror of
https://github.com/daylinmorgan/nimpkgs.git
synced 2024-12-22 02:50:44 -06:00
feat: update package info with commit age
This commit is contained in:
parent
0175ac9548
commit
9c45cf8983
1 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
import std/[algorithm, sugar]
|
import std/[algorithm, sugar]
|
||||||
import karax/[karaxdsl, vdom, jstrutils]
|
import karax/[kbase, karaxdsl, vdom, jstrutils]
|
||||||
|
|
||||||
import ../[context, packages, style]
|
import ../[context, packages, style]
|
||||||
import ../components/[tag, package]
|
import ../components/[tag, package]
|
||||||
|
@ -14,7 +14,7 @@ proc versionTable(pkg: NimPackage): VNode =
|
||||||
table(class = "table-auto w-full text-center"):
|
table(class = "table-auto w-full text-center"):
|
||||||
tr:
|
tr:
|
||||||
th: text "version"
|
th: text "version"
|
||||||
th: text "release"
|
th: text "released"
|
||||||
th: text "hash"
|
th: text "hash"
|
||||||
for version in versions:
|
for version in versions:
|
||||||
tr:
|
tr:
|
||||||
|
@ -43,6 +43,11 @@ proc renderLinks(pkg: NimPackage): VNode = buildHtml(tdiv):
|
||||||
tdiv(class = "i-mdi-file-outline shrink-0")
|
tdiv(class = "i-mdi-file-outline shrink-0")
|
||||||
span: text pkg.doc.noProtocol
|
span: text pkg.doc.noProtocol
|
||||||
|
|
||||||
|
proc getTimeSinceCommit(pkg: NimPackage): kstring =
|
||||||
|
if pkg.lastCommitTime == fromUnix(0): "unknown".jss
|
||||||
|
else:
|
||||||
|
let d = getTime() - pkg.lastCommitTime
|
||||||
|
d.inDays.jss & " days ago"
|
||||||
|
|
||||||
proc renderPkgInfo(pkg: NimPackage): VNode =
|
proc renderPkgInfo(pkg: NimPackage): VNode =
|
||||||
buildHtml:
|
buildHtml:
|
||||||
|
@ -56,6 +61,9 @@ proc renderPkgInfo(pkg: NimPackage): VNode =
|
||||||
tdiv:
|
tdiv:
|
||||||
tdiv: text "tags:"
|
tdiv: text "tags:"
|
||||||
pkg.tags.renderTags
|
pkg.tags.renderTags
|
||||||
|
tdiv:
|
||||||
|
tdiv: text "last commit:"
|
||||||
|
text pkg.getTimeSinceCommit
|
||||||
tdiv:
|
tdiv:
|
||||||
tdiv: text "usage:"
|
tdiv: text "usage:"
|
||||||
tdiv(class = "bg-ctp-surfacezero rounded my-2 mx-3 p-2 w-auto"):
|
tdiv(class = "bg-ctp-surfacezero rounded my-2 mx-3 p-2 w-auto"):
|
||||||
|
|
Loading…
Reference in a new issue