Inverted logic, deletion is not allowed by default.
This commit is contained in:
parent
7d82bb50b2
commit
46f7d50ed7
view/src/main/java/se/su/dsv/scipro
@ -89,7 +89,7 @@ public class ForumPostPanel extends Panel {
|
||||
}
|
||||
|
||||
protected boolean allowDeletion() {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void onPostDeleted() {}
|
||||
|
@ -61,6 +61,11 @@ public class ViewForumThreadPanel<A> extends GenericPanel<A> {
|
||||
ListView<ForumPost> listView = this;
|
||||
item.add(
|
||||
new ForumPostPanel(POST, item.getModel()) {
|
||||
@Override
|
||||
protected boolean allowDeletion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostDeleted() {
|
||||
// Refresh the list of posts
|
||||
|
@ -22,13 +22,7 @@ interface Event {
|
||||
|
||||
@Override
|
||||
public Component component(String id, IModel<Event> model) {
|
||||
return new ForumPostPanel(id, model.map(Message.class::cast).map(m -> m.forumPost)) {
|
||||
@Override
|
||||
protected boolean allowDeletion() {
|
||||
// Do not allow deleting forum posts in the timeline
|
||||
return false;
|
||||
}
|
||||
};
|
||||
return new ForumPostPanel(id, model.map(Message.class::cast).map(m -> m.forumPost));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user