projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add page that dismisses a notification.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
CreateReplyPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java
b/src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java
index
e48232e
..
65e8e57
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/CreateReplyPage.java
@@
-38,7
+38,7
@@
public class CreateReplyPage extends SoneTemplatePage {
* The Sone web interface
*/
public CreateReplyPage(Template template, WebInterface webInterface) {
* The Sone web interface
*/
public CreateReplyPage(Template template, WebInterface webInterface) {
- super("createReply.html", template, "Page.CreateReply.Title", webInterface);
+ super("createReply.html", template, "Page.CreateReply.Title", webInterface
, true
);
}
//
}
//
@@
-50,31
+50,22
@@
public class CreateReplyPage extends SoneTemplatePage {
*/
@Override
protected void processTemplate(Request request, Template template) throws RedirectException {
*/
@Override
protected void processTemplate(Request request, Template template) throws RedirectException {
- String postId = request.getHttpRequest().getPartAsStringFailsafe("postId", 36);
+ super.processTemplate(request, template);
+ String postId = request.getHttpRequest().getPartAsStringFailsafe("post", 36);
String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim();
String text = request.getHttpRequest().getPartAsStringFailsafe("text", 65536).trim();
+ String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64);
if (request.getMethod() == Method.POST) {
if (request.getMethod() == Method.POST) {
- Post post = webInterface.
c
ore().getPost(postId);
+ Post post = webInterface.
getC
ore().getPost(postId);
if (text.length() > 0) {
Sone currentSone = getCurrentSone(request.getToadletContext());
if (text.length() > 0) {
Sone currentSone = getCurrentSone(request.getToadletContext());
- webInterface.
c
ore().createReply(currentSone, post, text);
- throw new RedirectException(
"viewPost.html?post=" + post.getId()
);
+ webInterface.
getC
ore().createReply(currentSone, post, text);
+ throw new RedirectException(
returnPage
);
}
template.set("errorTextEmpty", true);
}
template.set("postId", postId);
template.set("text", text);
}
template.set("errorTextEmpty", true);
}
template.set("postId", postId);
template.set("text", text);
- }
-
- //
- // SONETEMPLATEPAGE METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean requiresLogin() {
- return true;
+ template.set("returnPage", returnPage);
}
}
}
}