\n\n"
+
+ page := pager.NewPager(e.itemsSorted, pageSize).MustGetPageByPath(path)
+
+ for i := len(page.Items) - 1; i >= 0; i-- {
+ item := page.Items[i]
+
+ out += "
\n\n"
+ id, _ := seqid.FromString(item.Key)
+ out += ufmt.Sprintf("### Submission #%d\n\n", int(id))
+ out += item.Value.(*Item).Render(dashboard)
+ out += "
"
+ }
+
+ out += "
\n\n"
+
+ out += page.Selector()
+
+ return out
+}
+
+func (i Item) Render(dashboard bool) string {
+ out := ufmt.Sprintf("\n```\n%s\n```\n\n", i.pkgpath)
+ out += ufmt.Sprintf("by %s\n\n", strings.Split(i.pkgpath, "/")[2])
+ out += ufmt.Sprintf("[View realm](%s)\n\n", strings.TrimPrefix(i.pkgpath, "gno.land")) // gno.land/r/leon/home > /r/leon/home
+ out += ufmt.Sprintf("Submitted at Block #%d\n\n", i.blockNum)
+
+ out += ufmt.Sprintf("#### [%dπ](%s) - [%dπ](%s)\n\n",
+ i.upvote.Size(), txlink.URL("Upvote", "pkgpath", i.pkgpath),
+ i.downvote.Size(), txlink.URL("Downvote", "pkgpath", i.pkgpath),
+ )
+
+ if dashboard {
+ out += ufmt.Sprintf("[Delete](%s)", txlink.URL("Delete", "pkgpath", i.pkgpath))
+ }
+
+ return out
+}
+
+func renderDashboard() string {
+ out := "---\n\n"
+ out += "## Dashboard\n\n"
+ out += ufmt.Sprintf("Total submissions: %d\n\n", exhibition.items.Size())
+
+ out += ufmt.Sprintf("Exhibition admin: %s\n\n", owner.Owner().String())
+
+ if !exhibition.IsPaused() {
+ out += ufmt.Sprintf("[Pause exhibition](%s)\n\n", txlink.URL("Pause"))
+ } else {
+ out += ufmt.Sprintf("[Unpause exhibition](%s)\n\n", txlink.URL("Unpause"))
+ }
+
+ out += "---\n\n"
+
+ return out
+}
+
+func RenderExhibWidget(itemsToRender int) string {
+ if itemsToRender < 1 {
+ return ""
+ }
+
+ out := ""
+ i := 0
+ exhibition.items.Iterate("", "", func(key string, value interface{}) bool {
+ item := value.(*Item)
+
+ out += ufmt.Sprintf("- %s\n", fqname.RenderLink(item.pkgpath, ""))
+
+ i++
+ return i >= itemsToRender
+ })
+
+ return out
+}
diff --git a/examples/gno.land/r/gnoland/home/gno.mod b/examples/gno.land/r/gnoland/home/gno.mod
index c208ad421c9..ff52ef4c8b1 100644
--- a/examples/gno.land/r/gnoland/home/gno.mod
+++ b/examples/gno.land/r/gnoland/home/gno.mod
@@ -4,6 +4,7 @@ require (
gno.land/p/demo/ownable v0.0.0-latest
gno.land/p/demo/ufmt v0.0.0-latest
gno.land/p/demo/ui v0.0.0-latest
+ gno.land/r/demo/hof v0.0.0-latest
gno.land/r/gnoland/blog v0.0.0-latest
gno.land/r/gnoland/events v0.0.0-latest
)
diff --git a/examples/gno.land/r/gnoland/home/home.gno b/examples/gno.land/r/gnoland/home/home.gno
index c6b3929a16c..ce976923ef5 100644
--- a/examples/gno.land/r/gnoland/home/home.gno
+++ b/examples/gno.land/r/gnoland/home/home.gno
@@ -6,6 +6,7 @@ import (
"gno.land/p/demo/ownable"
"gno.land/p/demo/ufmt"
"gno.land/p/demo/ui"
+ "gno.land/r/demo/hof"
blog "gno.land/r/gnoland/blog"
events "gno.land/r/gnoland/events"
)
@@ -37,7 +38,7 @@ func Render(_ string) string {
ui.Columns{3, []ui.Element{
lastBlogposts(4),
upcomingEvents(),
- lastContributions(4),
+ latestHOFItems(5),
}},
)
@@ -90,6 +91,15 @@ func upcomingEvents() ui.Element {
}
}
+func latestHOFItems(num int) ui.Element {
+ submissions := hof.RenderExhibWidget(num)
+
+ return ui.Element{
+ ui.H3("[Hall of Fame](/r/demo/hof)"),
+ ui.Text(submissions),
+ }
+}
+
func introSection() ui.Element {
return ui.Element{
ui.H3("Weβre building gno.land, set to become the leading open-source smart contract platform, using Gno, an interpreted and fully deterministic variation of the Go programming language for succinct and composable smart contracts."),
@@ -270,7 +280,7 @@ func discoverLinks() ui.Element {
- [Gnoscan](https://gnoscan.io)
- [Portal Loop](https://docs.gno.land/concepts/portal-loop)
- [Testnet 4](https://test4.gno.land/)
-- Testnet Faucet Hub (soon)
+- [Faucet Hub](https://faucet.gno.land)
`),
diff --git a/examples/gno.land/r/gnoland/home/home_filetest.gno b/examples/gno.land/r/gnoland/home/home_filetest.gno
index b22c22567b3..c587af9b817 100644
--- a/examples/gno.land/r/gnoland/home/home_filetest.gno
+++ b/examples/gno.land/r/gnoland/home/home_filetest.gno
@@ -57,7 +57,7 @@ func main() {
// - [Gnoscan](https://gnoscan.io)
// - [Portal Loop](https://docs.gno.land/concepts/portal-loop)
// - [Testnet 4](https://test4.gno.land/)
-// - Testnet Faucet Hub (soon)
+// - [Faucet Hub](https://faucet.gno.land)
//
//
//
@@ -78,9 +78,9 @@ func main() {
//
//
//
-// ### Latest Contributions
+// ### [Hall of Fame](/r/demo/hof)
+//
//
-// [View latest contributions](https://github.com/gnolang/gno/pulls)
//
//
//
diff --git a/examples/gno.land/r/leon/home/gno.mod b/examples/gno.land/r/leon/home/gno.mod
index 48cf64a9d0a..4649cf4abe6 100644
--- a/examples/gno.land/r/leon/home/gno.mod
+++ b/examples/gno.land/r/leon/home/gno.mod
@@ -4,5 +4,6 @@ require (
gno.land/p/demo/ufmt v0.0.0-latest
gno.land/r/demo/art/gnoface v0.0.0-latest
gno.land/r/demo/art/millipede v0.0.0-latest
+ gno.land/r/demo/hof v0.0.0-latest
gno.land/r/leon/config v0.0.0-latest
)
diff --git a/examples/gno.land/r/leon/home/home.gno b/examples/gno.land/r/leon/home/home.gno
index ba688792a4c..aea8b43e9cd 100644
--- a/examples/gno.land/r/leon/home/home.gno
+++ b/examples/gno.land/r/leon/home/home.gno
@@ -8,6 +8,7 @@ import (
"gno.land/r/demo/art/gnoface"
"gno.land/r/demo/art/millipede"
+ "gno.land/r/demo/hof"
"gno.land/r/leon/config"
)
@@ -31,6 +32,8 @@ My contributions to gno.land can mainly be found
TODO import r/gh
`,
}
+
+ hof.Register()
}
func UpdatePFP(url, caption string) {
diff --git a/examples/gno.land/r/manfred/home/gno.mod b/examples/gno.land/r/manfred/home/gno.mod
index 6e7aac70cc7..9885cac19c2 100644
--- a/examples/gno.land/r/manfred/home/gno.mod
+++ b/examples/gno.land/r/manfred/home/gno.mod
@@ -1,3 +1,6 @@
module gno.land/r/manfred/home
-require gno.land/r/manfred/config v0.0.0-latest
+require (
+ gno.land/r/demo/hof v0.0.0-latest
+ gno.land/r/manfred/config v0.0.0-latest
+)
diff --git a/examples/gno.land/r/manfred/home/home.gno b/examples/gno.land/r/manfred/home/home.gno
index 720796a2201..4766f54e51f 100644
--- a/examples/gno.land/r/manfred/home/home.gno
+++ b/examples/gno.land/r/manfred/home/home.gno
@@ -1,6 +1,9 @@
package home
-import "gno.land/r/manfred/config"
+import (
+ "gno.land/r/demo/hof"
+ "gno.land/r/manfred/config"
+)
var (
todos []string
@@ -12,6 +15,7 @@ func init() {
todos = append(todos, "fill this todo list...")
status = "Online" // Initial status set to "Online"
memeImgURL = "https://i.imgflip.com/7ze8dc.jpg"
+ hof.Register()
}
func Render(path string) string {
diff --git a/examples/gno.land/r/morgan/home/gno.mod b/examples/gno.land/r/morgan/home/gno.mod
index 573a7e139e7..35e2fbb2119 100644
--- a/examples/gno.land/r/morgan/home/gno.mod
+++ b/examples/gno.land/r/morgan/home/gno.mod
@@ -1 +1,3 @@
module gno.land/r/morgan/home
+
+require gno.land/r/demo/hof v0.0.0-latest
diff --git a/examples/gno.land/r/morgan/home/home.gno b/examples/gno.land/r/morgan/home/home.gno
index 33d7e0b2df7..571f14ed5ec 100644
--- a/examples/gno.land/r/morgan/home/home.gno
+++ b/examples/gno.land/r/morgan/home/home.gno
@@ -1,10 +1,14 @@
package home
+import "gno.land/r/demo/hof"
+
const staticHome = `# morgan's (gn)home
- [π sign my guestbook](/r/morgan/guestbook)
`
+func init() { hof.Register() }
+
func Render(path string) string {
return staticHome
}