added front-end side of post submission and columns for replies and followers

This commit is contained in:
Yvan 2025-02-05 15:55:29 +00:00
parent 0de5a95bab
commit be59844d57
2 changed files with 41 additions and 0 deletions

View file

@ -72,4 +72,13 @@ public class BotController {
model.addAttribute("bot", bot); model.addAttribute("bot", bot);
return "makebot_submitted"; return "makebot_submitted";
} }
@PostMapping("/viewbot/{username}")
public String viewbotpost(String posttext, @PathVariable String username, Model model) {
log.info("BotController::postpost: " + username + ", content: " + posttext);
Bot bot = botServ.getBotByUsername(username);
model.addAttribute("bot", bot);
return "viewbot";
}
} }

View file

@ -18,6 +18,15 @@
.value { .value {
font-weight: bold; font-weight: bold;
} }
#posts {
border-right: solid 1px;
}
#followers {
border-left: solid 1px;
}
#posttext {
height: 5em;
}
</style> </style>
</head> </head>
<body> <body>
@ -42,6 +51,29 @@
Public Key:<br> Public Key:<br>
<pre th:text="${bot.getPublicKeyPEMString()}"></pre> <pre th:text="${bot.getPublicKeyPEMString()}"></pre>
<div class="container-fluid">
<div class="row h">
<div id="posts" class="col-sm-4">
<h3>New Post</h3>
<form class="g-3" method="post">
<div class="mb-3">
<textarea class="form-control" id="posttext" name="posttext" placeholder="Post as this bot..." th:value="${posttext}"></textarea>
</div>
<div class="mb-3 text-right">
<button type="submit" class="btn btn-primary">Post!</button>
</div>
</form>
<h3>Past Posts</h3>
</div>
<div id="replies" class="col-sm-4">
<h3>Replies</h3>
</div>
<div id="followers" class="col-sm-4">
<h3>Followers</h3>
</div>
</div>
</div>
</div> </div>
<div class="col-sm-2"></div> <div class="col-sm-2"></div>
</div> </div>