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() {
|
protected boolean allowDeletion() {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onPostDeleted() {}
|
protected void onPostDeleted() {}
|
||||||
|
@ -61,6 +61,11 @@ public class ViewForumThreadPanel<A> extends GenericPanel<A> {
|
|||||||
ListView<ForumPost> listView = this;
|
ListView<ForumPost> listView = this;
|
||||||
item.add(
|
item.add(
|
||||||
new ForumPostPanel(POST, item.getModel()) {
|
new ForumPostPanel(POST, item.getModel()) {
|
||||||
|
@Override
|
||||||
|
protected boolean allowDeletion() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostDeleted() {
|
protected void onPostDeleted() {
|
||||||
// Refresh the list of posts
|
// Refresh the list of posts
|
||||||
|
@ -22,13 +22,7 @@ interface Event {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component component(String id, IModel<Event> model) {
|
public Component component(String id, IModel<Event> model) {
|
||||||
return new ForumPostPanel(id, model.map(Message.class::cast).map(m -> m.forumPost)) {
|
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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user