Skip to content

Commit

Permalink
link to delete thread
Browse files Browse the repository at this point in the history
  • Loading branch information
jaekwon committed Apr 28, 2022
1 parent d4d56e2 commit d7ce03d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
12 changes: 11 additions & 1 deletion cmd/gnoland/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,17 @@ func makeGenesisDoc(pvPub crypto.PubKey) *bft.GenesisDoc {
}
// Load initial packages from examples.
txs := []std.Tx{}
for _, path := range []string{"p/avl", "p/grc/grc20", "p/grc/grc721", "p/maths", "p/ufmt", "r/foo20", "r/users", "r/boards", "r/banktest"} {
for _, path := range []string{
"p/ufmt",
"p/avl",
"p/grc/grc20",
"p/grc/grc20/impl",
"p/grc/grc721",
"p/maths",
"r/foo20",
"r/users",
"r/boards",
"r/banktest"} {
// open files in directory as MemPackage.
memPkg := gno.ReadMemPackage("./examples/gno.land/"+path, "gno.land/"+path)
var tx std.Tx
Expand Down
8 changes: 4 additions & 4 deletions examples/gno.land/r/boards/post.gno
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ func (post *Post) RenderSummary() string {
str += "\n"
}
str += post.GetSummary() + "\n"
str += "\\- " + displayAddressMD(post.creator) + ", "
str += "[" + std.FormatTimestamp(post.createdAt, "2006-01-02 3:04pm MST") + "](" + post.GetURL() + ") "

str += "(" + strconv.Itoa(post.replies.Size()) + " replies)" + "\n"
str += "\\- " + displayAddressMD(post.creator) + ","
str += " [" + std.FormatTimestamp(post.createdAt, "2006-01-02 3:04pm MST") + "](" + post.GetURL() + ")"
str += " \\[[x](" + post.GetDeleteFormURL() + ")]"
str += " (" + strconv.Itoa(post.replies.Size()) + " replies)" + "\n"
return str
}

Expand Down
4 changes: 2 additions & 2 deletions tests/files2/zrealm_boards0.gno
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ func main() {
// ## [First Post (title)](/r/boards:test_board/1)
//
// Body of the first post. (body)
// \- [g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985](/r/users:g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985), [1970-01-01 12:00am UTC](/r/boards:test_board/1) (0 replies)
// \- [g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985](/r/users:g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985), [1970-01-01 12:00am UTC](/r/boards:test_board/1) \[[x](/r/boards?help&__func=DeletePost&bid=1&threadid=1&postid=1)] (0 replies)
//
// ----------------------------------------
// ## [Second Post (title)](/r/boards:test_board/2)
//
// Body of the second post. (body)
// \- [g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985](/r/users:g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985), [1970-01-01 12:00am UTC](/r/boards:test_board/2) (1 replies)
// \- [g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985](/r/users:g1arjyc64rpthwn8zhxtzjvearm5scy43y7vm985), [1970-01-01 12:00am UTC](/r/boards:test_board/2) \[[x](/r/boards?help&__func=DeletePost&bid=1&threadid=2&postid=2)] (1 replies)
2 changes: 1 addition & 1 deletion tests/files2/zrealm_boards7.gno
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ func main() {
// ## [First Post (title)](/r/boards:test_board/1)
//
// Body of the first post. (body)
// \- [@gnouser](/r/users:gnouser), [1970-01-01 12:00am UTC](/r/boards:test_board/1) (0 replies)
// \- [@gnouser](/r/users:gnouser), [1970-01-01 12:00am UTC](/r/boards:test_board/1) \[[x](/r/boards?help&__func=DeletePost&bid=1&threadid=1&postid=1)] (0 replies)

0 comments on commit d7ce03d

Please sign in to comment.